Name:
Location: Bangalore, India

Monday, October 22, 2007

bean:define

To Define a new bean at runtime
<bean:define id="row" name="BankForm" property="countryNameKeyMap" />

So the rules for attribute usage are as follows:

id is used to define a new bean
name is used to refer to an existing bean
property refers to an existing property of the form that’s defined using name property.

For Iterating
<bean:define id="row" name="BankForm" property="countryNameKeyMap" />
<html:options collection="row" property="value" labelProperty="key" />

Collection – refers to the newly created bean.
Property – Refers to the corresponding key (int) value in the drop downs in the screen. The select value(int value) will be sent to java layer.
labelProperty - Refers to the string values that are displayed in the drop down in UI screen for user to select.

To iterate a List/Map

<logic:present name="BankForm" property="countryNameKeyMap">
<html:select size="1" name="BankForm" property="countryDetailsKey">
<html:option value="">Select Country :</html:option>
<bean:define id="row" name="BankForm" property="countryNameKeyMap" />
<html:options collection="row" property="value" labelProperty="key" />
</html:select>
</logic:present>

0 Comments:

Post a Comment

<< Home