Apache Struts 2 Documentation > Home > Guides > Tag Developers Guide > Struts Tags > Tag Reference > UI Tag Reference > optiontransferselect |
Please make sure you have read the Tag Syntax document and understand how tag attribute syntax works. |
Important Note that the doublelistkey and doublelistvalue attribute will default to "key" and "value" respectively only when the doublelist attribute is evaluated to a Map or its decendant. Other thing else, will result in doublelistkey and doublelistvalue to be null and not used. |
Create a option transfer select component which is basically two <select ...> tag with buttons in the middle of them allowing options in each of the <select ...> to be moved between themselves. Will auto-select all its elements upon its containing form submision.
NOTE: The id and doubleId need not be supplied as they will generated provided that the optiontransferselect tag is being used in a form tag. The generated id and doubleId will be <form_id>_<optiontransferselect_doubleName> and <form_id>_<optiontransferselect_doubleName> respectively.
Name |
Required |
Default |
Evaluated |
Type |
Description |
---|---|---|---|---|---|
accesskey | false | true | String | Set the html accesskey attribute on rendered html element | |
addAllToLeftLabel | false | true | String | Set Add To Left button label | |
addAllToRightLabel | false | true | String | Set Add All To Right button label | |
addToLeftLabel | false | true | String | Set Add To Left button label | |
addToRightLabel | false | true | String | Set Add To Right button label | |
allowAddAllToLeft | false | true | String | Enable Add All To Left button | |
allowAddAllToRight | false | true | String | Enable Add All To Right button | |
allowAddToLeft | false | true | String | Enable Add To Left button | |
allowAddToRight | false | true | String | Enable Add To Right button | |
allowSelectAll | false | true | String | Enable Select All button | |
allowUpDownOnLeft | false | true | String | Enable up / down on the left side | |
allowUpDownOnRight | false | true | String | Enable up / down on the right side | |
buttonCssClass | false | true | String | Set buttons css class | |
buttonCssStyle | false | true | String | Set button css style | |
cssClass | false | true | String | The css class to use for element | |
cssStyle | false | true | String | The css style definitions for element ro use | |
disabled | false | true | String | Set the html disabled attribute on rendered html element | |
doubleAccesskey | false | true | String | Set the html accesskey attribute. | |
doubleCssClass | false | true | String | The css class for the second list | |
doubleCssStyle | false | true | String | The css style for the second list | |
doubleDisabled | false | true | String | Decides if a disable attribute should be added to the second list | |
doubleEmptyOption | false | true | String | Decides if the second list will add an empty option | |
doubleHeaderKey | false | true | String | The header key for the second list | |
doubleHeaderValue | false | true | String | The header value for the second list | |
doubleId | false | true | String | The id of the second list | |
doubleList | true | true | String | The second iterable source to populate from. | |
doubleListKey | false | true | String | Set the list key of the second attribute | |
doubleListValue | false | true | String | The value expression to use for second list | |
doubleMultiple | false | true | String | Decides if multiple attribute should be set on the second list | |
doubleName | true | true | String | The name for complete component | |
doubleOnblur | false | true | String | Set the onblur attribute of the second list | |
doubleOnchange | false | true | String | Set the onchange attribute of the second list | |
doubleOnclick | false | true | String | Set the onclick attribute of the second list | |
doubleOndblclick | false | true | String | Set the ondbclick attribute of the second list | |
doubleOnfocus | false | true | String | Set the onfocus attribute of the second list | |
doubleOnkeydown | false | true | String | Set the onkeydown attribute of the second list | |
doubleOnkeypress | false | true | String | Set the onkeypress attribute of the second list | |
doubleOnkeyup | false | true | String | Set the onkeyup attribute of the second list | |
doubleOnmousedown | false | true | String | Set the onmousedown attribute of the second list | |
doubleOnmousemove | false | true | String | Set the onmousemove attribute of the second list | |
doubleOnmouseout | false | true | String | Set the onmouseout attribute of the second list | |
doubleOnmouseover | false | true | String | Set the onmouseover attribute of the second list | |
doubleOnmouseup | false | true | String | Set the onmouseup attribute of the second list | |
doubleOnselect | false | true | String | Set the onselect attribute of the second list | |
doubleSize | false | true | String | Set the size attribute of the second list | |
doubleValue | false | true | String | The value expression for complete component | |
emptyOption | false | false | true | Boolean | Decides of an empty option is to be inserted in the second list |
formName | false | true | String | The form name this component resides in and populates to | |
headerKey | false | true | String | Set the header key of the second list. Must not be empty! '-1' and '' is correct, '' is bad. | |
headerValue | false | true | String | Set the header value of the second list | |
id | false | true | String | id for referencing element. For UI and form tags it will be used as HTML id attribute | |
key | false | true | String | Set the key (name, value, label) for this particular component | |
label | false | true | String | Label expression used for rendering a element specific label | |
labelposition | false | true | String | Define label position of form element (top/left) | |
leftDownLabel | false | true | String | Down label for the left side. | |
leftTitle | false | true | String | Set Left title | |
leftUpLabel | false | true | String | Up label for the left side | |
list | true | true | String | Iterable source to populate from. If the list is a Map (key, value), the Map key will become the option 'value' parameter and the Map value will become the option body. | |
listKey | false | true | String | Property of list objects to get field value from | |
listValue | false | true | String | Property of list objects to get field content from | |
multiple | false | true | String | Creates a multiple select. The tag will pre-select multiple values if the values are passed as an Array (of appropriate types) via the value attribute. | |
name | false | true | String | The name to set for element | |
onblur | false | true | String | Set the html onblur attribute on rendered html element | |
onchange | false | true | String | Set the html onchange attribute on rendered html element | |
onclick | false | true | String | Set the html onclick attribute on rendered html element | |
ondblclick | false | true | String | Set the html ondblclick attribute on rendered html element | |
onfocus | false | true | String | Set the html onfocus attribute on rendered html element | |
onkeydown | false | true | String | Set the html onkeydown attribute on rendered html element | |
onkeypress | false | true | String | Set the html onkeypress attribute on rendered html element | |
onkeyup | false | true | String | Set the html onkeyup attribute on rendered html element | |
onmousedown | false | true | String | Set the html onmousedown attribute on rendered html element | |
onmousemove | false | true | String | Set the html onmousemove attribute on rendered html element | |
onmouseout | false | true | String | Set the html onmouseout attribute on rendered html element | |
onmouseover | false | true | String | Set the html onmouseover attribute on rendered html element | |
onmouseup | false | true | String | Set the html onmouseup attribute on rendered html element | |
onselect | false | true | String | Set the html onselect attribute on rendered html element | |
required | false | false | true | Boolean | If set to true, the rendered element will indicate that input is required |
requiredposition | false | true | String | Define required position of required form element (left|right) | |
rightDownLabel | false | true | String | Down label for the left side. | |
rightTitle | false | true | String | Set Right title | |
rightUpLabel | false | true | String | Up label for the right side. | |
selectAllLabel | false | true | String | Set Select All button label | |
size | false | true | Integer | Size of the element box (# of elements to show) | |
tabindex | false | true | String | Set the html tabindex attribute on rendered html element | |
template | false | true | String | The template (other than default) to use for rendering the element | |
templateDir | false | true | String | The template directory. | |
theme | false | true | String | The theme (other than default) to use for rendering the element | |
title | false | true | String | Set the html title attribute on rendered html element | |
tooltip | false | true | String | Set the tooltip of this particular component | |
tooltipConfig | false | true | String | Set the tooltip configuration | |
value | false | true | String | Preset the value of input element. |
<-- minimum configuration --> <s:optiontransferselect label="Favourite Cartoons Characters" name="leftSideCartoonCharacters" list="{'Popeye', 'He-Man', 'Spiderman'}" doubleName="rightSideCartoonCharacters" doubleList="{'Superman', 'Mickey Mouse', 'Donald Duck'}" /> <-- possible configuration --> <s:optiontransferselect label="Favourite Cartoons Characters" name="leftSideCartoonCharacters" leftTitle="Left Title" rightTitle="Right Title" list="{'Popeye', 'He-Man', 'Spiderman'}" multiple="true" headerKey="headerKey" headerValue="--- Please Select ---" emptyOption="true" doubleList="{'Superman', 'Mickey Mouse', 'Donald Duck'}" doubleName="rightSideCartoonCharacters" doubleHeaderKey="doubleHeaderKey" doubleHeaderValue="--- Please Select ---" doubleEmptyOption="true" doubleMultiple="true" />