Populating a drop-down box
In our example we are iterating listRequestTypes which is an arrayList holding objects of type RequestTxnTypesBean. It is a bean class which has (1) requestTxnTypeKey and (2) display property. The display property contains the names that will come in the drop down and requestTxnTypeKey holds the corresponding key.
If the user selects one of the values from the drop-down the selected value’s key from requestTxnTypeKey property gets stored in requestTransactionTypeKey.
<html:select size="1" property="requestTransactionTypeKey" name="RequestForm">
<html:option value="">Select Request Type: </html:option>
<logic:present name="RequestForm" property="listRequestTypes">
<bean:define id="row" name="RequestForm" property="listRequestTypes" />
<html:options collection="row" property="requestTxnTypeKey" labelProperty="display" />
</logic:present>
</html:select>
If the user selects one of the values from the drop-down the selected value’s key from requestTxnTypeKey property gets stored in requestTransactionTypeKey.
<html:select size="1" property="requestTransactionTypeKey" name="RequestForm">
<html:option value="">Select Request Type: </html:option>
<logic:present name="RequestForm" property="listRequestTypes">
<bean:define id="row" name="RequestForm" property="listRequestTypes" />
<html:options collection="row" property="requestTxnTypeKey" labelProperty="display" />
</logic:present>
</html:select>
0 Comments:
Post a Comment
<< Home