struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From new2you <>
Subject Struts 2 - radio inside iterator
Date Sun, 26 Aug 2007 11:37:20 GMT

I've seen tons of similar posts here, but no solution:
I want to create a table of users, each row represents 1 user and has 3
radio buttons, which determine the user's role in the application. A user
can only have 1 role.
So I created the following code(shortened):

<s:iterator value="userList">
      ... ... ... ... <s:radio name="role" list="{0, 1, 2}"></s:radio>

userList: a List of "User"s
role: Integer property of entity "User". 
0, 1, 2: possible roles.

obviously, this cant work since the name of each radio is the same for all
the radios in the whole table.
No radio is correctly checked when accessing the page.
So I want an individual name for each radio-row, but without losing their
So I've tried a map approach:
doesnt work either.

funny thing is, if I use s:textfield this way, it gets pre-populated just

What would be the best way to approach this?

View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message