struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Degoutin Jean-Philippe <jean-philippe.degou...@devoteam.com>
Subject How to manage s:radio or s:select in s:iterator (Struts2)
Date Fri, 06 Mar 2009 13:06:25 GMT
My problem is as follow :

I iterate over a map of objects and theses objects contains a property that I want to expose
in a s:radio.

Like this : I got a map "myMap" with 2 properties :
                - P1, the unique identifier of the object (P1 is also the key value of the
 map)
                - P2 the property I want to expose as a s:radio (I also expose it a 2nd time
as a s:textfield)


      <s:iterator value="myMap" >

            <s:textfield value="%{value.P1}" name=" myMap['%{key}'].P1"/>

            <s:radio list="#{'1':'1','2':'2','3':'3'}"

                  value="myMap['%{key}'].P2"

                  name="myMap['%{key}'].P2"

                  id="%{value.P1}"

            />

            <s:textfield value="%{value.P2}" name="myMap['%{key}'].P2"/>

      </s:iterator>

My map is initialized with several objects and properties of objects are also initialized.
 Result : When I display, I see P1 and P2 in the textfield but nothing is checked in radio
buttons.
                When I submit, I can retrieve datas in texfields but not those in s:radio.

And it's exactly the same when I replace the s:radio by a s:select.

Thanks,
JPhilippe


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message