You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Sh...@ny.frb.org on 2005/07/06 17:02:16 UTC
Multibox problem
Hi-
I am having a problem with repopulating multiboxes.
Scenario:
My application is a wizard based one. User clicks on a couple of
checkboxes(multibox) and does a submit and after a couple of screens he
wants to come back to the checkboxes screen and the way i do is, i save
the values he clicked and then when he wants to come back i store those
values in a list and then to the request with the same name as that of
multibox, but the multiboxes are not selected and there is no tag in
multibox using which i can say that.
For Eg:
My JSP page:
<html:multibox property="districtIds">10</html:multibox>Kansas City
<html:multibox property="districtIds">11</html:multibox>Dallas
<html:multibox property="districtIds">12</html:multibox>San Francisco
My form Bean:
private String [] districtIds = null;
public void setDistrictIds(String [] districtIds) {
this.districtIds = districtIds;
}
public String [] getDistrictIds() {
return this.districtIds;
}
Code where i put the values back:
map.put("districtIds", stringArr);
where stringArr is an array of what the user selected.
Thanks,
Shyam.