struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Broadhurst <hou1...@gmail.com>
Subject Re: Handling dynamic set of radio buttons
Date Fri, 18 Feb 2011 01:57:42 GMT
Thanks Dave.

So are you saying have a Map property in the Action and the first radio
button would have Map position 1 as its name?

Nick

On Thu, Feb 17, 2011 at 2:40 PM, Dave Newton <davelnewton@gmail.com> wrote:

> Use a map or array rather than actual field names that include the index as
> part of the field names.
>
> dave
>  On Feb 17, 2011 12:04 PM, "Nick Broadhurst" <hou1nxb@gmail.com> wrote:
> > Hi Folks,
> >
> > I have a set of radio buttons and text fields that display based on user
> > selections from prior page. This code:
> >
> > <s:iterator value="deniedAreas" status="rowstatus">
> > <s:property/>
> > <s:radio name="conclusion.radio%{#rowstatus.index}"
> > list="#{'Yes':'Yes','No':'No'}"></s:radio>
> > <s:textfield name="conclusion.text%{rowstatus.index}"/>
> > </s:iterator>
> >
> > displays it fine and names the radio/text inputs, but is there any other
> way
> > to accept this info in my submit action than hard coding the field names
> in
> > the Action or the Conclusion entity in the Action? I am trying to avoid
> that
> > because everything this section is based on is dynamic. I am using JPA
> for
> > persistence, and I can handle this there with @ElementCollection but the
> > radio/text inputs having different names are getting in the way.
> >
> > Basically I need to capture a yes/no and explanation of each box selected
> in
> > a different part of app.
> >
> > Any ideas would be appreciated.
> >
> > Nick
>

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