dsp:select
lets you define drop-down lists or select boxes in JSPs much like the HTML tag select
. The drop-down list contains options supplied by dsp:option
.
This tag must be enclosed in a dsp:form
, which can be provided in the same page or a parent page. See Embedding Pages in Forms for instructions on the latter.
Note:dsp:select
uses the iclass
attribute in place of the cascading stylesheet class
attribute to avoid using a Java reserved word in Java code.
Attributes
DestinationValue:bean(Required)
The bean
attribute holds the Nucleus path, component name, and property name where the user’s selection is saved.
InputName:name
The name
attribute provides a name to a drop-down list that is used during form processing. It is not necessary to include a name in dsp:select
tags; the ATG platform automatically supplies one if none is specified.
OperationOrdering:priority
The priority
attribute lets you set a dsp:select
tag at a high priority so it is processed before other tags in a JSP. This is especially helpful when making changes to an item’s repository ID and the properties it contains. If you first update the supplemental properties and then the repository ID, the new property values can be flushed when the repository ID change occurs. The priority
attribute takes an integer value. By default, priority
is set to –10.
For more information on how the ATG platform can prioritize tag processing, see Order of Tag Processing
BlockDefaultValues:nodefault
When the bean property in the dsp:select
tag holds a value that matches one or more options provided by the subordinate dsp:option
tags, those values display as default selections. You can block this behavior by setting the nodefault
attribute to true as a runtime expression, indicating that default values are not displayed.
MultipleSelect:multiple
The multiple
attribute indicates that more than one option can be selected from a drop-down list. When you use this attribute, make sure your destination property is an array. This attribute is a Boolean so you invoke it by setting it to an expression of true. Excluding this attribute assumes the default (false).
TagConverters
The tag converter tools let you convert a value into the format of your choice:
number
currency
(includingcurrencyConversion
,euro
,reverse
, andsymbol
)date
maxdate
andmindate
nullable
required
creditCard
(includinggroupingsize
,maskcharacter
, andnumcharsunmasked
)valueishtml
You can also use tag converters to require users to enter data in a specific format. For more information, see Tag Converters.
Example
<dsp:select bean="Student_01.Summerhobbies" multiple="true"
nodefault="true" priority="10">
<dsp:option value="hiking">hiking</dsp:option>
<dsp:option value="biking">biking</dsp:option>
<dsp:option value="swimming">swimming</dsp:option>
</dsp:select>
This example creates a select box of summer hobbies from which a user can select options: hiking, biking, or swimming. The user’s selection, which is saved to the summerHobbies
property of the Student_01
component, can include multiple options (hiking and biking, for example) so the summerHobbies
property must be an array. If the summerHobbies
property already holds the values biking and swimming, for example, those values are not selected as defaults in the form because the nodefault
attribute blocks that functionality. By indicating a high priority number, you ensure that this tag set is processed before others in the form.