dsp:option is used in conjunction with dsp:select to display a list of options in a drop-down list. When you use this tag, make sure it is enclosed in a dsp:select tag.

Note:dsp:option uses the iclass attribute in place of the cascading style sheet class attribute to avoid using a Java reserved word in Java code.

Attributes

ListEntries:beanvalue,paramvalue,orvalue(Required)

These attributes hold an option that is represented in the drop-down list defined by dsp:select . When a user selects an option, the value supplied by these list entry attributes is saved to the component property identified in the dsp:select attribute bean. A list entry attribute can be a bean property (beanvalue), page parameter (param), or a constant (value). The actual option the user sees (a list entry attribute holds only the item saved to the property) must be included after dsp:option closing tag so it too can be a dynamic or static.

Attribute

Description

Example

beanvalue

Nucleus path, component name, and property name to display in the input field.

beanvalue="/atg/userprofiling
/profile.login">

paramvalue

Page parameter to display in the input field.

paramvalue="username"

value

Constant value or runtime expression to display in the input field.

value="Ms. User"

or (to indicate a Boolean value)

value="${nameSupplied}"

DefaultSelection:selected

This attribute lets you overwrite the default setting provided by the property in the dsp:select bean attribute. By setting the selected attribute to a runtime expression of true, you can set a particular option or group of options (when using the multiple attribute for an array property) to display as selected. Using the false setting lets you indicate you want an option to display as unselected.

TagConverters

The tag converter tools let you convert a value into the format of your choice:

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">
  <dsp:option value="hiking">hiking</dsp:option>
  <dsp:option value="biking">biking</dsp:option>
  <dsp:option value="swimming">swimming</dsp:option>
</dsp:select>

This drop-down list provides a list of hobbies that include hiking, biking, and swimming. The hobbies property is a collection, so it can hold as many options as the user selects. No items are set to display as selected, so none appear as such unless the summerHobbies property current has a value of hiking, biking, swimming, or some combination of the three.

 
loading table of contents...