V
Vasu
Hi
i have used the following code to populate a list and have multiple
selection.
The scenario is when a user is clecked the proposiitons (some values)
associated with the user should get selelcted in the jsp in the mutiple
select list box.
edituser.jsp
--------------------
<bean:define id="userProp" name="addUserForm"
property="userPropositions" />
<html:select property="selProposition" multiple="true"
name="addUserForm" onchange="showProposition()">
<logic:equal name="userProp" property="isUserPropMatch" value="1">
<html
ptions collection="userProp" labelProperty="label"
property="value" selected/>
</logic:equal>
<logic:notEqual name="userProp" property="isUserPropMatch" value="1">
<html
ptions collection="userProp" labelProperty="label"
property="value" />
</logic:notEqual>
action.java
-------------------
String clickuserId = request.getParameter(CommonConstants.U_ID);
addUserForm.setUserPropositions(DAOFetchMasterRecords.getUserAssociatedProposition(clickuserId));
ArrayList user_proposition =
DAOFetchMasterRecords.getUserAssociatedProposition(clickuserId);
addUserForm is the name of the form where the jsp is present.
getUserAssociatedProposition is the method that gets the values from
the database and fills it in the jsp.
clickuserId is the userid of the user who has been selected.
the get and set method for userPropositions is available in the form
and for isUserPropMatch is at a util.java file.
the jsp page is getting loaded but the values are not getting selected.
kindly help.
thanks in advance.
Vasu
i have used the following code to populate a list and have multiple
selection.
The scenario is when a user is clecked the proposiitons (some values)
associated with the user should get selelcted in the jsp in the mutiple
select list box.
edituser.jsp
--------------------
<bean:define id="userProp" name="addUserForm"
property="userPropositions" />
<html:select property="selProposition" multiple="true"
name="addUserForm" onchange="showProposition()">
<logic:equal name="userProp" property="isUserPropMatch" value="1">
<html
property="value" selected/>
</logic:equal>
<logic:notEqual name="userProp" property="isUserPropMatch" value="1">
<html
property="value" />
</logic:notEqual>
action.java
-------------------
String clickuserId = request.getParameter(CommonConstants.U_ID);
addUserForm.setUserPropositions(DAOFetchMasterRecords.getUserAssociatedProposition(clickuserId));
ArrayList user_proposition =
DAOFetchMasterRecords.getUserAssociatedProposition(clickuserId);
addUserForm is the name of the form where the jsp is present.
getUserAssociatedProposition is the method that gets the values from
the database and fills it in the jsp.
clickuserId is the userid of the user who has been selected.
the get and set method for userPropositions is available in the form
and for isUserPropMatch is at a util.java file.
the jsp page is getting loaded but the values are not getting selected.
kindly help.
thanks in advance.
Vasu