File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Multiboxes - How to show the  selected ones ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Multiboxes - How to show the  selected ones ? " Watch "Multiboxes - How to show the  selected ones ? " New topic
Author

Multiboxes - How to show the selected ones ?

Renata Santos
Greenhorn

Joined: Jan 30, 2009
Posts: 1
Hi all,

I have a team form and a member form, team contains members.
In my members jsp, I want to show checkboxes with the possible members and I want to show the already members as checked checkbox.

I am doing something wrong , because its not working… Can someone help me ?

I have in my form two ArrayList with getters and setters
private List possiveisMembros = new ArrayList(); //possible member
private List membrosSelecionados = new ArrayList(); // selected member

in my action i populate them with value from my database.
//each member have a id(codigoFuncionario) and a name (nomeMembro).
//mef is my membersForm
ArrayList possiveisMembros = getListaPossiveisMembrosEquipe(); //method that get the values from DB for possible members
ArrayList membrosSelecionados = getListaMembrosEquipeSelecionados(mef); //method that get the values from DB for my selected members

mef.setPossiveisMembros(possiveisMembros); // setting value in my form – possible members
mef.setMembrosSelecionados(membrosSelecionados); // setting value in my form – selected members

in my JSP :

<logic:iterate id="possiveisMembros" name="membrosEquipeForm" property="possiveisMembros" scope="request">
<html:multibox name="membrosEquipeForm" property="membrosSelecionados" >
<bean:write name="possiveisMembros" property="codigoFuncionario"/>
</html:multibox>
<bean:write name="possiveisMembros" property="nomeMembro"/>
<br>
</logic:iterate>


when i execute thr members jsp , the page show all my possible members, but it doest bring the already members checked . WHY? What am doing wrong?

TKS, in advance !!!

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Multiboxes - How to show the selected ones ?
 
Similar Threads
Multibox Not Populating as Checked!!!
Display Check Boxes & Dropdowns in Struts with search results
logic:iterate problem
On htm:multibox
how to deselct a checkbox after coming back to same JSP