UDTT provides an extendable set of custom JSP tags that make it easier to create JSPs by limiting the amount of Java coding required to implement a JSP. The toolkit custom JSP tags are based on the JSP Custom Tags defined in the JSP 1.1 specification. The toolkit uses a tag library to describe the custom tags, their attributes, and their related Java classes (beans). A tag library (a TLD file) is an XML document that externalizes the tags. The toolkit uses the tags to instantiate JSPs based on the attributes of the tags and then render the HTML to display the JSPs.
You use the toolkit custom JSP tags in the same way you use any custom JSP tag that conforms to the JSP 1.1 specification. (If you are using Rational Application Developer to develop JSPs, you can see a representation of the tags at design time. See Visual custom tags.)
The JSP tags provided by the toolkit can be divided into the following categories:
▪ Simple components. These are a set of classes responsible for rendering the HTML contents based on the attributes of the tag and the dynamic information obtained from the context for the associated data name. These classes are stateless (no data from the session is needed). Following are the simple components:
▪ LabelTag
▪ TextFieldTag
▪ CheckBoxTag
▪ RadioButtonTag
▪ ComboBoxTag
▪ LabelListTag
▪ ListTag
▪ ButtonGroupTag
▪ TextAreaTag
▪ TableTag
▪ EditableTableTag
▪ SelectableTableTag
▪ FieldDescriptionTag
▪ FieldErrorTag
▪ ValidationErrorsTag
▪ AddBundleTag
▪ ResourceTag
Containers. The following tags are containers for the simple components listed above:
▪ FormTag
Control tags. These tags provide the functionality needed for submitting the required hidden fields to the client. This is done to get them back to the server side when the user performs a submit action in the rendered page. FormTag is also a container. Following are the control tags:
A label tag references a DataField in the context hierarchy and creates text on the HTML page with the value of the DataField.
LabelTag attributes
dataName
Name of the DataField in the context hierarchy. This is a required value if the text attribute is not defined.
Default value: null
fontColor
Color of the text
Default value: null
fontSize
Size of the text
Default value: null
fontFace
Typeface of the text
Default value: null
style
Style for the label
Default value: null
text
Key to use when searching in a resource bundle for the text to render. If the LabelTag has this attribute defined, it does not use a dataName attribute.
A TextFieldTag references a DataField in the Context hierarchy and creates either an HTML text or a password Input element, based on the isPassword attribute value.
Mandatory attributes
dataName
TextFieldTag attributes
dataName
Name of the DataField in the context hierarchy. If the DataField is read only, in Internet Explorer the text field is also read only.
If a form containing a text field is submitted, the context's element named dataName is set with the text field value.
isPassword
Whether the text field displays passwords
Default value: no
isHidden
Whether the text field is a hidden field
Default value: no
maxLength
Maximum number of characters in the text field
Default value: null
size
Size of the text field
Default value: null
error
Whether the text field shows any invalid value contained in the DataField
Default value: no
errorStyle
Style for any invalid text
Default value: font-style:italic;
color:orangered
style
Style for the text field
Default value: null
custom
Adds attributes to the input element. The following is the format of this attribute:
A CheckBoxTag references a DataField in the context hierarchy and creates an HTML check input element.
Mandatory attributes
dataName, value
CheckBoxTag attributes
dataName
Name of the DataField in the context hierarchy. If the DataField is read only, in Internet Explorer the check box is also read only.
When creating the check box, the toolkit retrieves the value of the DataField in the context and checks the check box if this value matches the value attribute. If a form containing a check box is submitted, the context's element named dataName is set with the check box value.
value
Value of the check box
style
Style for the check box
Default value: null
custom
Adds attributes to the input element. The following is the format of this attribute:
custom="att1Name=\"att1Value\
"att2Name=\"att2Value\"..."
Default value: null
Example
<H1>Using the Checkbox Tag</H1> <dse:form name="f1" nextEventName="ok"> <table><tr><td valign="top"> <dse:check dataName="doNotUse" value="Y"/></td><td> Please do not use the information collected here<br> for future marketing or promotional contacts or<br> other communications beyond the scope.</td></tr><tr><td> <dse:check dataName="doSend" value="Y"/></td><td> Yes! you may also send me relevant information by email. </td></tr></table> </dse:form>
A RadioButtonTag references a DataField in the context hierarchy and creates an HTML radio button element.
Mandatory attributes
dataName, value
RadioButtonTag attributes
dataName
Name of the DataField in the context hierarchy. If the DataField is read only, in Internet Explorer the radio button is also read only.
When creating the radio button, the toolkit retrieves the value of the DataField in the context and checks the radio button if this value matches the value attribute. If a form containing a radio button is submitted, the context's element named dataName is set with the radio button value.
value
Value of the radio button
style
Style for the radio button
Default value: null
custom
Adds attributes to the input element. The following is the format of this attribute:
A ComboBoxTag references a DataCollection in the context hierarchy and creates an HTML select element using the collection's inner elements.
Mandatory attributes
dataNameForList, dataName. If the DataCollection is an IndexedCollection, item and value are mandatory.
ComboBoxTag attributes
dataNameForList
ID of the DataCollection.
If the DataCollection is a KeyedCollection, each inner DataField corresponds to an option element. The combo box uses the field ID as the option label and the field value as the option value.
If the DataCollection is an IndexedCollection, the inner elements must be KeyedCollections, and the item and value attributes are mandatory. Each inner KeyedCollection corresponds to an option element. The combo box uses the collection field named in the item attribute as the option label and uses the collection field named in the value attribute as the option value. If the data element named dataName contains the value of an option element, the combo box highlights this option element as selected (it is the default).
dataName
Name of the DataField in the context hierarchy. If the DataField is read only, in Internet Explorer the combo box is also read only.
If a form containing a combo box is submitted, the context's element named dataName is set with the combo box value.
item
Collection field to use as the option label.
Default value: null
value
Collection field to use as the option value.
Default value: null
style
Style for the combo box.
Default value: null
custom
Adds attributes to the input element. The following is the format of this attribute:
A LabelList tag references a DataField and a DataCollection in the context hierarchy and creates text on the HTML page based on the value of the field and the collection.
Mandatory attributes
dataNameForList, dataName
LabelListTag attributes
dataNameForList
ID of the DataCollection.
If the DataCollection is a KeyedCollection, the toolkit looks for the inner data field containing the same value as the data field named dataName. The list label uses the inner data field's ID as the label.
If the DataCollection is an IndexedCollection, the inner elements must be KeyedCollections, and the item and value attributes are mandatory. The list label uses the collection field named in the item attribute as the option label and uses the collection field named in the value attribute as the option value.
dataName
Name of the DataField in the Context hierarchy. If the DataField is read only, in Internet Explorer the combo box is also read only.
A list tag references a DataCollection in the context hierarchy and creates a selectable HTML element populated with the inner elements of the collection.
Mandatory attributes
dataNameForList, dataName
ListTag attributes
dataNameForList
ID of the DataCollection.
If the DataCollection is a KeyedCollection, each inner DataField corresponds to an option element. The combo box uses the field ID as the option label and the field value as the option value.
If the DataCollection is an IndexedCollection, the inner elements must be KeyedCollections, and the item and value attributes are mandatory. Each inner KeyedCollection corresponds to an option element. The list uses the collection field named in the item attribute as the label and uses the collection field named in the value attribute as the option value. If the data element named dataName contains the value of an option element, the combo box highlights this option element as selected (it is the default).
dataName
Name of the DataField in the context hierarchy. If the DataField is read only, in Internet Explorer the combo box is also read only.
If a form containing a list is submitted, the context's element named dataName is set with the list's value (either a String or a String[] depending on how many option elements the user selected.)
multipleSelection
Whether the user can select more than one option.
Default value: no
item
Collection field to use as the option label.
Default value: null
value
Collection field to use as the option value.
Default value: null
size
Maximum number of items that the user can select.
Default value: null
style
Style for the list.
Default value: null
custom
Adds attributes to the input element. The following is the format of this attribute:
A ButtonGroupTag references a DataCollection in the context hierarchy and creates a group of radio buttons or check boxes (input elements) for the collection elements.
Mandatory attributes
dataNameForList, dataName
ButtonGroupTag attributes
dataNameForList
ID of the DataCollection.
If the DataCollection is a KeyedCollection, the toolkit looks for the inner data field containing the same value as the data field named dataName. The button group uses the inner data field's ID as the label.
If the DataCollection is an IndexedCollection, the inner elements must be KeyedCollections, and the item and value attributes are mandatory. The button group uses the collection field named in the item attribute as the option label and uses the collection field named in the value attribute as the option value.
dataName
Name of the DataField in the context hierarchy. If the DataField is read only, in Internet Explorer the combo box is also read only.
If a form containing a radio button or check box group is submitted, the context's element named dataName is set with the group's value (either a String or a String[] depending on how many option elements the user selected).
multipleSelection
Whether the user can select more than one option
Default value: no
item
Collection field to use as the option label
Default value: null
value
Collection field to use as the option value
Default value: null
fontColor
Color of the text
Default value: null
fontSize
Size of the text
Default value: null
fontFace
Typeface of the text
Default value: null
style
Style for the button group
Default value: null
custom
Adds attributes to the input element. The following is the format of this attribute:
A table tag references an IndexedCollection in the context hierarchy and creates an HTML Table element containing the collection's contents.
Mandatory attributes
dataNameForList
TableTag attributes
dataNameFor List
Name of the IndexedCollection in the context hierarchy. The inner data element can be a KeyedCollection or an Indexed Collection containing a data field. If the inner element is a KeyedCollection, the table has a row for each element in the collection.
border
Size of the border of the table
Default value: null
cellspacing
Amount of space between table cells
Default value: null
cellpadding
Amount of space between each table cell and the cell's contents
Default value: null
width
Width of the table
Default value: null
cellBGColor
Background color of the cells
Default value: null
cellBGColor2
Second background color. If this is enabled, the rows in the table alternate between this color and the cellBGColor.
Default value: null
showCaption
Whether the table displays a caption. If it does, the table uses the description of the IndexedCollection for the caption value.
Default value: yes
showHeaders
Whether the table displays header cells
Default value: yes
headers
Which cells are header cells. This is a list with the format of "{header1, header2, ...}". The contents of the list are used as keys to access a resource bundle.
Default value: null
headerBGColor
Background color of the header cells
Default value: null
headerAlignment
Alignment of the text in the header cells
Default value: null
headerFontFace
Typeface of the text in the header cells
Default value: null
headerFontSize
Size of the text in the header cells
Default value: null
headerFontColor
Color of the text in the header cells
Default value: null
fontFace
Typeface of the table text and caption
Default value: null
fontSize
Size of the table text and caption
Default value: null
fontColor
Color of the table text and caption
Default value: null
start First
element in the Collection to be displayed
Default value: null
end
Last element in the Collection to be displayed
Default value: null
colSizes
Width of each column. This is a list with the format of "{col1, col2, ...}".
Default value: null
colAlignments
Alignment of the text in each column. This is a list with the format of "{col1, col2, ...}".
Default value: null
skipCols
Whether to skip displaying a column. This is a list with the format of "{col1, col2, ...}".
Default value: null
style
Style for the table
Default value: null
custom
Adds attributes to the input element. The following is the format of this attribute:
An EditableTableTag references an IndexedCollection in the context hierarchy and creates an HTML table element containing the collection's contents. An input text field is created in an HTML table cell for each of the data fields contained by the IndexedCollection's inner element.
Mandatory attributes
dataNameForList
EditableTableTag attributes
dataNameForList
Name of the IndexedCollection in the Context hierarchy. The inner data element can be a KeyedCollection or an Indexed Collection containing a data field. If the inner element is a KeyedCollection, the table has a row for each element in the collection. If a data element is read only, the table displays its value as text but not in a input text field.
border
Size of the border of the table
Default value: null
cellspacing
Amount of space between table cells
Default value: null
cellpadding
Amount of space between each table cell and the cell's contents
Default value: null
cellBGColor
Background color of the cells
Default value: null
cellBGColor2
Second background color. If this is enabled, the rows in the table alternate between this color and the cellBGColor.
Default value: null
showCaption
Whether the table displays a caption. If it does, the table uses the description of the IndexedCollection for the caption value.
Default value: yes
showHeaders
Whether the table displays header cells
Default value: yes
headers
Which cells are header cells. This is a list with the format of "{header1, header2, ...}". The contents of the list are used as keys to access a resource bundle.
Default value: null
headerBGColor
Background color of the header cells
Default value: null
headerAlignment
Alignment of the text in the header cells
Default value: null
headerFontFace
Typeface of the text in the header cells
Default value: null
headerFontSize
Size of the text in the header cells
Default value: null
headerFontColor
Color of the text in the header cells
Default value: null
fontFace
Typeface of the table text and caption
Default value: null
fontSize
Size of the table text and caption
Default value: null
fontColor
Color of the text and caption
Default value: null
start
First element in the Collection to be displayed
Default value: null
end
Last element in the Collection to be displayed
Default value: null
colSizes
Width of each column. This is a list with the format of "{col1, col2, ...}".
Default value: null
colAlignments
Alignment of the text in each column. This is a list with the format of "{col1, col2, ...}".
Default value: null
skipCols
Whether to skip displaying a column. This is a list with the format of "{col1, col2, ...}".
Default value: null
cellSize
Size of all input text fields contained in the table
Default value: null
nonEditableColumns
Which columns do not have input text fields
Default value: null
nonEditableRows
Which rows do not have input text fields
Default value: null
style
Style for the table
Default value: null
custom
Adds attributes to the input element. The following is the format of this attribute:
A SelectableTableTag references an IndexedCollection in the context hierarchy and creates an HTML Table element containing the collection's contents. Each row of the HTML table is selectable.
Mandatory attributes
dataNameForList, dataName, dataNameForValue
SelectableTableTag attributes
dataNameForList
Name of the IndexedCollection in the Context hierarchy. The inner data element can be a KeyedCollection or an Indexed Collection containing a data field. If the inner element is a KeyedCollection, the table has a row for each element in the collection. If a data element is read only, the table displays its value as text but not in a input text field.
dataName
Which DataField in the context is updated with the row number of the selected row if the inner element is a KeyedCollection
dataNameForValue
Which DataField in the context is updated with the contents of the selected row if the inner element is an IndexedCollection
border
Size of the border of the table
Default value: null
cellspacing
Amount of space between table cells
Default value: null
cellpadding
Amount of space between each table cell and the cell's contents
Default value: null
cellBGColor
Background color of the cells
Default value: null
cellBGColor2
Second background color. If this is enabled, the rows in the table alternate between this color and the cellBGColor.
Default value: null
showCaption
Whether the table displays a caption. If it does, the table uses the description of the IndexedCollection for the caption value.
Default value: yes
showHeaders
Whether the table displays header cells.
Default value: yes
headers
Which cells are header cells. This is a list with the format of "{header1, header2, ...}". The contents of the list are used as keys to access a resource bundle.
Default value: null
headerBGColor
Background color of the header cells
Default value: null
headerAlignment
Alignment of the text in the header cells
Default value: null
headerFontFace
Typeface of the text in the header cells
Default value: null
headerFontSize
Size of the text in the header cells
Default value: null
headerFontColor
Color of the text in the header cells
Default value: null
fontFace
Typeface of the table text and caption
Default value: null
fontSize
Size of the table text and caption
Default value: null
fontColor
Color of the text and caption
Default value: null
start
First element in the Collection to be displayed
Default value: null
end
Last element in the Collection to be displayed
Default value: null
colSizes
Width of each column. This is a list with the format of "{col1, col2, ...}".
Default value: null
colAlignments
Alignment of the text in each column. This is a list with the format of "{col1, col2, ...}".
Default value: null
skipCols
Whether to skip displaying a column. This is a list with the format of "{col1, col2, ...}".
Default value: null
cellSize
Size of all input text fields contained in the table
Default value: null
nonEditableColumns
Which columns do not have input text fields
Default value: null
nonEditableRows
Which rows do not have input text fields
Default value: null
type
Type of button that the user uses to select a row
Default value: button
event
How to display the selectable rows.
If the event attribute is set, a button or an image button is created at the end of each row. When the user clicks a button, the JSP sets the dataName values and the dse_nextEventName value, and then submits the HTML Form.
If the event attribute is not set, a radio button is created at the end of each row and the JSP does not submit the Form when the user selects the row.
Default value: null
value
What is on the row selection buttons
Default value: select
width
Width of the button
Default value: null
style
Style for the table
Default value: null
custom
Adds attributes to the input element. The following is the format of this attribute:
A FieldErrorTag accesses the data element named dataName and, if this data element is in error, gets the element error information and writes it on the HTML page.
Mandatory attributes
dataName
FieldErrorTag attributes
dataName
Name of the DataField in the Context hierarchy
fontColor
Color of the text
Default value: null
fontSize
Size of the text
Default value: null
fontFace
Typeface of the text
Default value: null
style
Style for the field description
Default value: null
message
Preset message for any error in the DataElement. The value of this attribute is used as a key to retrieve the localized text from the resource bundle.
A ValidationErrorsTag accesses the context's validation error messages and writes them on the HTML page. Depending on the value of the mode attribute, this tag may only access the cross-validation errors or it may access all of them.
Mandatory attributes
renderMode (list | combo)
ValidationErrorsTag attributes
renderMode
Whether the error messages are shown as an HTML list (list) or combo box (combo)
fontColor
Color of the text
Default value: null
fontSize
Size of the text
Default value: null
fontFace
Typeface of the text
Default value: null
style
Style for the field description
Default value: null
mode
Whether the tag displays only cross-validation errors or all errors
Default value: X (cross-validation)
bundleFile
Resource bundle to use for localized messages. This resource prevails over the resource specified by an AddBundleTag.
Default value: null
Example
The following is an example of using FieldDescriptionTag, FieldErrorTag, and ValidationErrorsTag:
An AddBundle Tag sets the resource bundle file for the user locale in a concrete context (scope) to provide NLS. This tag should be placed at the beginning of the JSP process.
Mandatory attributes
file
AddBundleTag attributes
file
Where to find the resource bundle. This is a required value.
scope
Context in which the resource bundle is used. The values for this attribute are page, request, appli, or session.
Default value: session
Example
<H4>Using the AddBundle Tag</H4> <dse:add file="HTMLBundle" scope="page"/>
The FormTag creates a Form element on the HTML page with all the hidden fields required to access the toolkit server.
FormTag attributes
name
Name of the Form.
Default value: null
nextEventName
Name of the event to be executed when the form is submitted. This attribute can be omitted when starting a new processor as the event sent to the server is a start event.
Default value: null
opName
Name of the operation. This attribute is only required when a new processor is started.
Default value: null
parentCtxName
Name of the context. This attribute is only required when a new processor is started.
Default value: null
errorPage
Overrides the default error for a specific call
Default value: null
action
Class that is to execute the event
Default value: WebApplicationURI+ "/Request"
style
Style for the Form
Default value: null
custom
Adds attributes to the Input element. The following is the format of this attribute:
A InputButtonTag creates an input button element on the HTML page.
InputButtonTag attributes
type
Type of button. This attribute can have the following values: button, submit, reset, and image.
Default value: button
dataName
Name of the DataField in the Context hierarchy that is set when user clicks the button
Default value: null
event
Sets the value in the button's form field named "dse_nextEventName" with the attribute value and submits the form
Default value: null
onClick
Process to be used if a process other than dse_nextEventName is required
Default value: null
value
Label of the button or the path to the image. For a label, the value of the attribute is used as a key to access the text in the locale resource bundle.
Default value: null
style
Style for the text area
Default value: null
custom
Adds attributes to the input element. The following is the format of this attribute:
A URITag creates an URI on the HTML page with all the parameters required to access the toolkit server.
URITag attributes
nextEventName
Name of the event to be executed when the form is submitted. This attribute can be omitted when starting a new processor as the event sent to the server is a start event.
Default value: null
opName
Name of the operation. This attribute is only required when a new processor is started.
Default value: null
parentCtxName
Name of the context. This attribute is only required when a new processor is started.
Default value: null
parentCtxName
Name of the context. This attribute is only required when a new processor is started.
Default value: null
errorPage
Overrides the default error for a specific call
Default value: null
action
Class that is to execute the event
Default value: WebApplicationURI+"/Request"
extraParams
Additional parameters to be added to the URI. Use ampersands (&) to separate the parameters if there is more than one parameter.
An AnchorTag creates an Anchor element on the HTML page with all the parameters required to access the toolkit server. The Anchor uses the URI Tag as its "href" tag attribute. Refer to the URI Tag description for its attributes.
AnchorTag attributes
nextEventName
Name of the event to be executed when the form is submitted. This attribute can be omitted when starting a new processor as the event sent to the server is a start event.
Default value: null
opName
Name of the operation. This attribute is only required when a new processor is started.
Default value: null
parentCtxName
Name of the context. This attribute is only required when a new processor is started.
Default value: null
errorPage
Overrides the default error for a specific call
Default value: null
action
Class that is to execute the event
Default value: WebApplicationURI+"/Request"
extraParams
Additional parameters to be added to the URI. Use ampersands (&) to separate the parameters if there is more than one parameter.
Default value: null
style
Style for the Form.
Default value: null
custom
Adds attributes to the input element. The following is the format of this attribute: