KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > beehive > netui > tags > html > HtmlDefaultableDataSourceTag


1 /*
2  * Copyright 2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * $Header:$
17  */

18 package org.apache.beehive.netui.tags.html;
19
20 import javax.servlet.jsp.JspException JavaDoc;
21
22 /**
23  * Abstract base class extending the <code>HtmlDataSourceTag</code> and adding support
24  * for the <code>defaultValue</code> attribute.
25  */

26 abstract public class HtmlDefaultableDataSourceTag
27         extends HtmlDataSourceTag
28 {
29     protected Object JavaDoc _defaultValue; // A String that contains or references the data to render for the default value of this tag.
30

31     /**
32      * Sets the default value (can be an expression).
33      * @param defaultValue the default value
34      * @jsptagref.attributedescription <p><b>Use in &lt;netui:checkBoxGroup>, &lt;netui:checkBox>,
35      * &lt;netui:radioButtonGroup>, and &lt;netui:select> tags</b></p>
36      * <p>Sets the preselected value or values.
37      * <p>The <code>defaultValue</code> attribute takes either a String literal or
38      * a data binding expression.
39      * <p>If the <code>defaultValue</code> attribute has a String value (or if
40      * the data binding expression points to a String), then a single value
41      * will be preselected.
42      * <p>If the <code>defaultValue</code> attribute points to a String[] object
43      * (or any object which can be iterated over), then
44      * multiple values will be preselected.
45      *
46      *
47      * <p><b>Use in &lt;netui:textArea> and &lt;netui:textBox> tags</b></p>
48      * <p>Sets the initial display text.</p>
49      * <p>The <code>defaultValue</code> attribute takes either a String literal or
50      * a data binding expression that points to a String.
51      * @jsptagref.databindable Read / Write
52      * @jsptagref.attributesyntaxvalue <i>string_or_expression_default</i>
53      * @netui:attribute required="false" rtexprvalue="true" type="java.lang.Object"
54      * description="Sets the default value of the control which is used if the object bound to is null."
55      */

56     public void setDefaultValue(Object JavaDoc defaultValue)
57             throws JspException JavaDoc
58     {
59         _defaultValue = defaultValue;
60     }
61
62     /**
63      * Release any acquired resources.
64      */

65     protected void localRelease()
66     {
67         super.localRelease();
68         _defaultValue = null;
69     }
70 }
71
Popular Tags