Please make sure you have read the Tag Syntax document and understand how tag attribute syntax works.
NOTE: that the
doublelistkey
anddoublelistvalue
attribute will default tokey
andvalue
respectively only when thedoublelist
attribute is evaluated to a Map or its descendant. Other thing else, will result indoublelistkey
anddoublelistvalue
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 submission.
NOTE: The
id
anddoubleId
need not be supplied as they will generated provided that theoptiontransferselect
tag is being used in a form tag. The generatedid
anddoubleId
will be<form_id>_<optiontransferselect_name>
and<form_id>_<optiontransferselect_doubleName>
respectively.
{% remote_file_content https://raw.githubusercontent.com/apache/struts/master/core/src/site/resources/tags/optiontransferselect-description.html %}
{% remote_file_content https://raw.githubusercontent.com/apache/struts/master/core/src/site/resources/tags/optiontransferselect-attributes.html %}
The tag supports dynamic attributes but if you want to add the attributes to the right control which is generated by the tag use the right-
prefix as below:
<s:ioptiontransferselect ... right-control-id="id2"/>
The prefix will be stripped while generating the second control.
Minimum example
<s:optiontransferselect label="Favourite Cartoons Characters" name="leftSideCartoonCharacters" list="{'Popeye', 'He-Man', 'Spiderman'}" doubleName="rightSideCartoonCharacters" doubleList="{'Superman', 'Mickey Mouse', 'Donald Duck'}" />
Possible example
<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" />