Form Tag - WordPress.com

advertisement
Struts Tags
 Classification of Struts Tags are:




Form tags.
Control tags.
Data tags.
Ajax tags.
Form Tags
 The list of form tags is a subset of Struts UI Tags.
 These tags help in the rendering of the user interface
required for the Struts web applications and can be
categorized into three categories.



Simple UI Tags.
Group UI Tags.
Select UI Tags.
Simple UI Tags.
 If you are aware of HTML then all the tags used are
very common HTML tags with an additional
prefix s: along with each tag and different attributes.
Simple UI Tags
<s:form>
<s:textarea>
<s:div>
<s:label>
<s:submit>
<s:file>
<s:reset>
<s:text>
<s:textfield>
<s:password>
Simple UI Tags.
<s:form>
Attributes
Description
Required
method
Define method “GET” or “POST”
False
action
Define action name
False
</s:form>
 Renders an input form.
Simple UI Tags.
<s:div>
Attributes
Description
Required
id
Define ID to the particular division
False
key
Retrieve key value from the property file
False
</s:div>
 Render an HTML div.
Simple UI Tags.
<s:submit>
Attributes
Description
Required
id
Define ID to the submit button
False
key
Retrieve key value from the property file
False
value
Caption of the submit button
False
</s:submit>
 Render an Submit button.
Simple UI Tags.
<s:reset>
Attributes
Description
Required
id
Define ID to the reset button
False
key
Retrieve key value from the property file
False
value
Caption of the reset button
False
</s:reset>
 Render an Reset button.
Simple UI Tags.
<s:text>
Attributes
Description
Required
id
Define ID to the text element
False
name
Define TEXT to display
True
</s:text>
 Render I18n text message.
Simple UI Tags.
<s:textfield>
Attributes
Description
Required
name
Define NAME to the text element
False
key
Retrieve key value from the property file
False
label
Label for the textbox
False
readonly
if true than it makes textbox as readonly
False
disabled
if true than it makes textbox disabled
False
size
Defines the width of the textbox
False
maxLength
Defines the maximum characters as an input
False
</s:textfield>
 Render an HTML input field of type text.
Simple UI Tags.
<s:password>
Attributes
Description
Required
name
Define NAME to the password element
False
key
Retrieve key value from the property file
False
label
Label for the textbox
False
readonly
if true than it makes textbox as readonly
False
disabled
if true than it makes textbox disabled
False
size
Defines the width of the textbox
False
maxLength
Defines the maximum characters as an input
False
</s:password>
 Render an HTML input tag of type password.
Simple UI Tags.
<s:textarea>
Attributes
Description
Required
name
Define NAME to the textarea element
False
key
Retrieve key value from the property file
False
label
Label for the textbox
False
readonly
if true than it makes textbox as readonly
False
disabled
if true than it makes textbox disabled
False
rows
Defines Height of the Textarea (default is 2)
False
cols
Defines Width of the Textarea (default is 20)
False
</s:textarea>
 Render HTML textarea tag.
Simple UI Tags.
<s:label>
Attributes
Description
Required
id
Define ID to the label element
False
label
Define Label text
False
</s:label>
 Render a label that displays read-only information.
Simple UI Tags.
<s:file>
Attributes
Description
Required
name
Define NAME to the file element
False
label
Define Label text
False
</s:file>
 Render a file input field.
Group UI Tags.
 The group UI tags are used to create radio button and
the checkbox.
Group UI Tags
<s:radio>
<s:checkboxlist>
<s:checkbox>
Group UI Tags.
<s:radio>
Attributes
Description
Required
name
Define NAME to the radio element
False
label
Define Label text
False
list
Define List of Data to be selected (Only one)
True
</s:radio>
 Renders a radio button input field.
Group UI Tags.
<s:checkboxlist>
Attributes
Description
Required
name
Define NAME to the checkbox element
False
label
Define Label text
False
list
Define List of Data to be selected (Multiple)
True
</s:checkboxlist>
 Render a list of checkboxes .
Group UI Tags.
<s:checkbox>
Attributes
Description
Required
name
Define NAME to the checkbox element
False
label
Define Label text
False
</s:checkbox>
 Render a checkbox input field.
Select UI Tags.
 The Select UI tags are used to create select options and
dropdown lists.
Select UI Tags
<s:select>
<s:doubleselect>
<s:combobox>
Select UI Tags.
<s:select>
Attributes
Description
Required
name
Define NAME to the select element
False
label
Define Label text
False
list
Define List of Data to be selected (Only one)
True
</s:select>
 Renders a Select element.
Select UI Tags.
<s:combobox>
Attributes
Description
Required
name
Define NAME to the combobox element
False
label
Define Label text
False
list
Define List of Values
True
headerKey
Define Header Key
False
headerValue
Define Header Text
False
</s:combobox>
 Widget that fills a text box from a select.
Select UI Tags.
<s:doubleselect>
Attributes
Description
Required
name
Define NAME to the first Select element
False
label
Define Label text
False
list
Define List of Data to be selected (Multiple)
True
doubleName
Define NAME to the second Select element
True
doubleList
Define List for the second Select
True
</s:doubleselect>
 Renders two HTML select elements with second one
changing displayed values depending on selected
entry of first one.
Summary
Form Tag
Simple
<s:form>
<s:div>
<s:submit>
<s:reset>
<s:text>
<s:textfield>
<s:password>
<s:textarea>
<s:label>
<s:file>
Group
Select
<s:radio>
<s:select>
<s:checkbox>
<s:combobox>
<s:checkboxlist>
<s:doubleselect>
Download