File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Multiboxes - How to show the  selected ones ? " Watch "Multiboxes - How to show the  selected ones ? " New topic

Multiboxes - How to show the selected ones ?

Renata Santos

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"/>
<bean:write name="possiveisMembros" property="nomeMembro"/>

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:
subject: Multiboxes - How to show the selected ones ?
It's not a secret anymore!