Hello All,
i am unable to figure out the problem ;
See here is my application classes & code
one bean name as
UserRoleMasterBean : having fields 'id' , 'role' with simple getter & setter.
one extension bean as
UerRoleMasterExt : having fields 'UserRoleMasterBean' ,'checked' ( for check box ) along with getter & setter
one form bean as
UserRoleMasterForm : having array of UerRoleMasterExt[ ] with getter & setter by index
in display
jsp i have putted code as bellow
<logic:iterate id="lUserRoleMasterExt" name="UserRoleMasterForm" property="userRoleMasterExt">
<tr>
<td width="20%" class="TDData" align="Center"><bean:write name="lUserRoleMasterExt" property="userRoleMasterBean.id" /></td>
<td width="60%" class="TDData" align="left"><html:text name="lUserRoleMasterExt" property="userRoleMasterBean.role" /></td>
<td width="20%" class="TDData" align="Center"><html:checkbox name="lUserRoleMasterExt" property="checked"></html:checkbox></td>
</tr>
</logic:iterate> while in LookupDispatchAction's edit method i have putted code as bellow :
UserRoleMasterForm userRoleForm = (UserRoleMasterForm) form;
UserRoleMasterExt[] roleArray = userRoleForm.getUserRoleMasterExt();
System.out.println(" roleArray is "+roleArray.length);
if(roleArray !=null && roleArray.length>0){
for(int i=0;i<roleArray.length;i++){
UserRoleMasterExt lUserRoleMasterExt = roleArray[i];
if(lUserRoleMasterExt.getChecked()){
UserRoleMasterBean lUserRoleMasterBean = lUserRoleMasterExt.getUserRoleMasterBean();
//check duplicate & Update the bean
}
}
} the display is working fine but while on update it is not working
the problem is i am getting
roleArray length
zero always.
should i have to place index also in property of <td>'s ?
If any one have good example/link for index display and saving please reply.
However i have read all the threads related to index.
Thanks,
Vijay Saraf.
[ November 24, 2006: Message edited by: vijay saraf ]