KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > wap > def > CommandButton


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 package org.apache.myfaces.wap.def;
17
18 /**
19  * This control can by rendered as a graphical button(PDA) or item in menu(mobile phones).
20  * The final view is depend on client browser. This element must be a childern of UIForm component.
21  *
22  * Decode Behavior
23  * Obtain the Map from the "requestParameterMap" property of the ExternalContext. If the value in theMap for
24  * the value of the "clientId" property of the component is not null, get the value of the "type" attribute,
25  * and convert it to lower case. If the result is equal to the String "reset" (without the quotes), return fromdecode().
26  * Otherwise, create ajavax.faces.event.ActionEvent around the component, and pass it to the queueEvent() method
27  * of the component, which must be an instance ofUICommand.
28  *
29  * Encode Behavior
30  * Wml don't contain submit button tag. This element is rendered using "do" and "go" wml tags.
31  * If is the button attribute type set to "reset", then is command button rendered as "do" and "setvar" tags. For reset is not needed reload the page.
32  *
33  * @wapfaces.tag
34  * componentFamily="UICommand"
35  * rendererType="CommandButtonRenderer"
36  * tagName="commandButton"
37  * tagBaseClass="org.apache.myfaces.wap.base.ActionSourceTagBase"
38  * bodyContent="JSP"
39  *
40  * @author <a HREF="mailto:Jiri.Zaloudek@ivancice.cz">Jiri Zaloudek</a> (latest modification by $Author: matzew $)
41  * @version $Revision: 1.1 $ $Date: 2004/12/30 09:37:25 $
42  * $Log: CommandButton.java,v $
43  * Revision 1.1 2004/12/30 09:37:25 matzew
44  * added a new RenderKit for WML. Thanks to Jirí Žaloudek
45  *
46  */

47
48
49 public class CommandButton extends javax.faces.component.UICommand {
50     
51     /**
52      * Defines the type of the "do" element.This attribute tells to the browser how present this element.
53      * Possible values: (accept | prev | help | reset | options | delete | unknown | x-* | vnd.*). Default value is "accept".
54      *
55      * @wapfaces.attribute
56      * initValue="\"accept\""
57      * valueBinding="true"
58      */

59     java.lang.String JavaDoc type;
60         
61     /**
62      * Defines xml:lang for the "do" tag. The xml:lang attribute specifies the natural or formal language of an element or its attributes.
63      *
64      * @wapfaces.attribute
65      * valueBinding="true"
66      */

67     //java.lang.String xmllang;
68

69     /**
70      * Defines style class for the "do" tag. Space-separated list of style class(es) to be applied when this element is rendered. This value must be passed through as the "class" attribute on generated markup.
71      *
72      * @wapfaces.attribute
73      * valueBinding="true"
74      */

75     //java.lang.String styleClass;
76

77     /**
78      * Defines a name for the "do" element.
79      *
80      * @wapfaces.attribute
81      * valueBinding="true"
82      */

83     //java.lang.String name;
84

85     /**
86      * If set to true, the browser ignores this element. If set to false, the browser does not ignore this element. Default is "false".
87      *
88      * @wapfaces.attribute
89      * initValue="false"
90      * valueBinding="true"
91      */

92     boolean optional;
93     
94         /**
95      * Sets the value property of the UICommand. This is most often rendered as a label.
96      *
97      * @wapfaces.attribute
98      * valueBinding="true"
99      */

100     java.lang.Object JavaDoc value;
101
102     
103     // ============= ABSTARACT ATTRIBUTES ======================================
104
/**
105      * MethodBinding representing the application action to invoke when this component is activated by the user. The expression must evaluate to a public method that takes no parameters, and returns a String (the logical outcome) which is passed to the NavigationHandler for this application.
106      *
107      * @wapfaces.attribute
108      * inherit="true"
109      * abstract="true"
110      */

111     java.lang.String JavaDoc action;
112     
113     /**
114      * MethodBinding representing an action listener method that will be notified when this component is activated by the user. The expression must evaluate to a public method that takes an ActionEvent parameter, with a return type of void.
115      *
116      * @wapfaces.attribute
117      * inherit="true"
118      * abstract="true"
119      */

120     java.lang.String JavaDoc actionListener;
121     
122     /**
123      * The component identifier for the associated component.
124      *
125      * @wapfaces.attribute
126      * abstract="true"
127      * inherit="true"
128      */

129     java.lang.String JavaDoc id;
130     
131     /**
132      * Flag indicating whether or not this component should be rendered (during Render Response Phase), or processed on any subsequent form submit.
133      *
134      * @wapfaces.attribute
135      * abstract="true"
136      * inherit="true"
137      */

138     boolean rendered;
139         
140     /**
141      * The value binding expression linking this component to a property in a backing bean.
142      *
143      * @wapfaces.attribute
144      * abstract="true"
145      * inherit="true"
146      */

147     java.lang.String JavaDoc binding;
148  
149     /**
150      * Flag indicating that this component's value must be converted and validated immediately (that is, during Apply Request Values phase), rather than waiting until Process Validations phase.
151      *
152      * @wapfaces.attribute
153      * inherit="true"
154      * abstract="true"
155      */

156     boolean immediate;
157     
158 }
159
Popular Tags