UIBean is the standard superclass of all Struts UI components. It defines common Struts and html properties all UI components should present for usage.
Attribute | Theme | Data Types | Description |
templateDir | n/a | String | define the template directory |
theme | n/a | String | define the theme name |
template | n/a | String | define the template name |
themeExpansionToken | n/a | String | special token (defined with struts.ui.theme.expansion.token) used to search for template in parent theme (don't use it separately!) |
expandTheme | n/a | String | concatenation of themeExpansionToken and theme which tells internal template loader mechanism to try load template from current theme and then from parent theme (and parent theme, and so on) when used with <#include/> directive |
Attribute | Theme | Data Types | Description |
cssClass | simple | String | define html class attribute |
cssStyle | simple | String | define html style attribute |
cssClass | simple | String | error class attribute |
cssStyle | simple | String | error style attribute |
title | simple | String | define html title attribute |
disabled | simple | String | define html disabled attribute |
label | xhtml | String | define label of form element |
labelPosition | xhtml | String | define label position of form element (top/left), default to left |
requiredPosition | xhtml | String | define required label position of form element (left/right), default to right |
errorPosition | xhtml | String | define error position of form element (top|bottom), default to top |
name | simple | String | Form Element's field name mapping |
required | xhtml | Boolean | add * to label (true to add false otherwise) |
tabIndex | simple | String | define html tabindex attribute |
value | simple | Object | define value of form element |
Attribute | Theme | Data Types | Description |
onclick | simple | String | html javascript onclick attribute |
ondblclick | simple | String | html javascript ondbclick attribute |
onmousedown | simple | String | html javascript onmousedown attribute |
onmouseup | simple | String | html javascript onmouseup attribute |
onmouseover | simple | String | html javascript onmouseover attribute |
onmouseout | simple | String | html javascript onmouseout attribute |
onfocus | simple | String | html javascript onfocus attribute |
onblur | simple | String | html javascript onblur attribute |
onkeypress | simple | String | html javascript onkeypress attribute |
onkeyup | simple | String | html javascript onkeyup attribute |
onkeydown | simple | String | html javascript onkeydown attribute |
onselect | simple | String | html javascript onselect attribute |
onchange | simple | String | html javascript onchange attribute |
Attribute | Data Type | Default | Description |
tooltip | String | none | Set the tooltip of this particular component |
jsTooltipEnabled | String | false | Enable js tooltip rendering |
tooltipIcon | String | /struts/static/tooltip/tooltip.gif | The url to the tooltip icon |
tooltipDelay | String | 500 | Tooltip shows up after the specified timeout (miliseconds). A behavior similar to that of OS based tooltips. |
key | simple | String | The name of the property this input field represents. This will auto populate the name, label, and value |
tooltipConfig is deprecated, use individual tooltip configuration attributes instead Every Form UI component (in xhtml / css_xhtml or any other that extends them) can have tooltips assigned to them. The Form component's tooltip related attribute, once defined, will be applied to all form UI components that are created under it unless explicitly overriden by having the Form UI component itself defined with their own tooltip attribute.
In Example 1, the textfield will inherit the tooltipDelay and tooltipIconPath attribte from its containing form. In other words, although it doesn't define a tooltipIconPath attribute, it will have that attribute inherited from its containing form.
In Example 2, the textfield will inherite both the tooltipDelay and tooltipIconPath attribute from its containing form, but the tooltipDelay attribute is overriden at the textfield itself. Hence, the textfield actually will have its tooltipIcon defined as /myImages/myIcon.gif, inherited from its containing form, and tooltipDelay defined as 5000.
Example 3, 4 and 5 show different ways of setting the tooltip configuration attribute.
Example 3: Set tooltip config through the body of the param tag
Example 4: Set tooltip config through the value attribute of the param tag
Example 5: Set tooltip config through the tooltip attributes of the component tag
<!-- Example 1: --> <s:form tooltipDelay="500" tooltipIconPath="/myImages/myIcon.gif" .... > .... <s:textfield label="Customer Name" tooltip="Enter the customer name" .... /> .... </s:form> <!-- Example 2: --> <s:form tooltipDelay="500" tooltipIconPath="/myImages/myIcon.gif" .... > .... <s:textfield label="Address" tooltip="Enter your address" tooltipDelay="5000" /> .... </s:form> <-- Example 3: --> <s:textfield label="Customer Name" tooltip="One of our customer Details"> <s:param name="tooltipDelay"> 500 </s:param> <s:param name="tooltipIconPath"> /myImages/myIcon.gif </s:param> </s:textfield> <-- Example 4: --> <s:textfield label="Customer Address" tooltip="Enter The Customer Address" > <s:param name="tooltipDelay" value="500" /> </s:textfield> <-- Example 5: --> <s:textfield label="Customer Telephone Number" tooltip="Enter customer Telephone Number" tooltipDelay="500" tooltipIconPath="/myImages/myIcon.gif" />