util:toggle

Sets up a toggle instance, which allows a template developer to repeatedly switch between two or more strings.

See also

util:toggleNext

Syntax
<util:toggle
   declare="..."?
   id="..."
   items="..."?
   name="..."?
   toScope="..."?
   value="..."?/>
Attributes
id, mandatory

Used to identify the toggle that will be made available as a scripting-variable.

NOTE: When declear is set to 'true', it is illegal to use a runtime expression in the 'id' attribute.

declare, no runtime expressions

Turn declaration of scripting-variables on/off. If set to 'true' will scripting-variables be created. Else it will not be created.

Default is set to true.

items

A java.util.List of values that are to be toggled. The Toggle will be initialized with the first value in the list. If the list does not contain String elements, it will convert them to strings first.

value

A comma separated list of values that are to be toggled. The Toggle will be initialized with the first value in the list, and all of the values will be trimmed of leading and trailing whitespace before being used.

name

The name of a scoped attribute that will be used as the list of names. The attribute can be a List, or a comma separated string.

toScope

To which scope the toggle will be put. Allowed values are: page, request, session and application.