You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by tristan_colson <tr...@wickedbear.com> on 2008/04/15 19:49:12 UTC

Having trouble pre-populating a checkboxlist

I must be missing something obvious here, but I can't seem to get my
checkboxlist to prepopulate.

<s:checkboxlist name="platformsKeys" value="platformsKeys"
list="allPlatforms" listKey="value" listValue="label" />

platformsKeys is a array of integers and allPlatforms is a list of objects
with the key being an integer and the value being 
a string.

Here is what the HTML looks like:
<input type="checkbox" name="platformsKeys" value="1" id="platformsKeys-1"/>
<label for="platformsKeys-1" class="checkboxLabel">Queries</label>
<input type="checkbox" name="platformsKeys" value="2" id="platformsKeys-2"/>
<label for="platformsKeys-2" class="checkboxLabel">Alerts</label>

When I use the form to create the values for platformsKeys, it works fine.
But when I return to the form with
platformsKeys having values in it, I would expect the checkboxes to be
checked where they match the values 
that are found in platformsKeys. 

But they aren't. What am I doing wrong?


-- 
View this message in context: http://www.nabble.com/Having-trouble-pre-populating-a-checkboxlist-tp16703411p16703411.html
Sent from the Struts - User mailing list archive at Nabble.com.


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