wood burning stoves 2.0*
The moose likes Struts and the fly likes Multibox Not Populating as Checked!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Multibox Not Populating as Checked!!!" Watch "Multibox Not Populating as Checked!!!" New topic
Author

Multibox Not Populating as Checked!!!

suvendu patra
Greenhorn

Joined: Nov 19, 2002
Posts: 5
Hi All,
Has anybody got any idea about multibox, how to make it checked while displaying.
1) this is my iterate logic
=================================================
<table>
<tr>
<logic:iterate id="Org" name="hmTemp">
<td>
<html:multibox property = "hmOrg">
<bean:write name="Org" property="key"/>
</html:multibox>
<bean:write name="Org" property="value"/>
</td>
</TR>
</logic:iterate>
</table>
=================================================
i have an ActionForm which has getter & setter method as follows: for "hmOrg"
=================================================
public HashMap getHmOrg() {
return this.hmOrg;
}
public void setHmOrg(HashMap values) {
this.hmOrg = values;
}
=================================================
am calling hmOrg and setting the values in the bean, but its not populating for the selected checkboxes.

Thanks in Advance
suv
Darryl A. J. Staflund
Ranch Hand

Joined: Oct 06, 2002
Posts: 303
Hi there,
You need to prepopulate your action form in one action before handing it to another action for rendering in the browser.
For instance, assume you are create an 'Edit <xxx>' tool of some kind and some of the information to be modified contains populated checkboxes. In order to execute this command, you have to do something like the following:
1. Execute the 'prepopulateEditXXXForm' Action class.
2. Execute the 'editXXX' Action class.
3. Execute the 'processEditXXXForm' Action class.
These actions, if executed in order would: (i) populate the edit form with data before it is displayed on the screen; (ii) render the pre-populated form on the screen; and (iii) process the results of the editing.
If Step 1 is missed, then the action form's values will be reset to their default values before the form is displayed. It sounds as though this is what's happening in your example.
Cheers,
Darryl
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Multibox Not Populating as Checked!!!
 
Similar Threads
multibox functionality in struts
multibox and checked values
Iterator and multibox
multibox formating
multibox query