Please make sure you have read the Tag Syntax document and understand how tag attribute syntax works.
NOTE: that the
listkey
andlistvalue
attribute will default tokey
andvalue
respectively only when thelist
attribute is evaluated to a Map or its descendant. Everything else will result inlistkey
andlistvalue
to be null and not used.
Create a Select component with buttons to move the elements in the select component up and down. When the containing form is submitted, its elements will be submitted in the order they are arranged (top to bottom).
{% remote_file_content https://raw.githubusercontent.com/apache/struts/master/core/src/site/resources/tags/updownselect-description.html %}
{% remote_file_content https://raw.githubusercontent.com/apache/struts/master/core/src/site/resources/tags/updownselect-attributes.html %}
Example 1: simple example
<s:updownselect list="#{'england':'England', 'america':'America', 'germany':'Germany'}" name="prioritisedFavouriteCountries" headerKey="-1" headerValue="--- Please Order Them Accordingly ---" emptyOption="true" />
Example 2: more complex example
<s:updownselect list="defaultFavouriteCartoonCharacters" name="prioritisedFavouriteCartoonCharacters" headerKey="-1" headerValue="--- Please Order ---" emptyOption="true" allowMoveUp="true" allowMoveDown="true" allowSelectAll="true" moveUpLabel="Move Up" moveDownLabel="Move Down" selectAllLabel="Select All" />