|
IN FORM:
// Get all xxx Values for
DropDown.
xxxDropDown[] results = profileSession.getxxxValues(); // Create the arrays for the labels and values. xxxLabels = new ArrayList(); xxxValues = new ArrayList(); // For each value returned... for (int i = 0; i < results.length; i ++) { // Add a label and a value to the corresponding list. xxxLabels.add(new String(results[i].getLabel())); xxxValues.add(new String(results[i].getValue())); } IN JSP:
<html:select
property="selectedValue">
<html:options property="xxxValues" labelProperty="xxxLabels"/> </html:select> Make sure to define the xxxLabels and xxxValues as
type ArrayList and import the class.
Hope this helps! :-)
|
Title: Does anyone have a example to generate a drop down list?

