You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Sa...@roularta.be on 2009/03/24 11:23:14 UTC

checkboxlist

Hi,
 
Can anyone tell me how I can make a checkboxlist on my jsp that knows
which checkbox should be checked and which not.
I have my list of objects with three strings.
string1: name (label for the checkbox)
string2: key (value that identifies which object is checked)
string3: true or false (that says if that checkbox should already be
checked)
 
But for the checkboxlist tag I see only the listValue and listKey
parameters that write a property of the object.
All the other properties are not dependent on the object of the list..
 
Thx,

RE: checkboxlist

Posted by Muthu Velappan <mu...@aspiresys.com>.
<s:checkboxlist required="true" key="permissions" list="activePermissions"
value="permissions" name="permissions">
	<s:param name="rowstyle" value="%{'row31'}" />
</s:checkboxlist>
 

list="activePermissions" hold the entire collection holding Map<Permission
Id, Perimssion Name>.
value="permissions" holds the Set<Permission Id> that are applicable for
this user. 

So, you can assume it like this.. The set you provide in "list" will get
rendered as checkboxes and set in "value" will be used to check the rendered
textboxes.

Hope this helps you...

~Muthu.
-----Original Message-----
From: Sandy.Verfaille@roularta.be [mailto:Sandy.Verfaille@roularta.be] 
Sent: Tuesday, March 24, 2009 3:53 PM
To: user@struts.apache.org
Subject: checkboxlist

Hi,
 
Can anyone tell me how I can make a checkboxlist on my jsp that knows
which checkbox should be checked and which not.
I have my list of objects with three strings.
string1: name (label for the checkbox)
string2: key (value that identifies which object is checked)
string3: true or false (that says if that checkbox should already be
checked)
 
But for the checkboxlist tag I see only the listValue and listKey
parameters that write a property of the object.
All the other properties are not dependent on the object of the list..
 
Thx,



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org