You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Wendy Smoak <We...@asu.edu> on 2002/10/10 01:29:11 UTC

Radio buttons inside an iterate tag?

I can't find an example of this one:

<logic:iterate id="resView" name="foundPersons" >
   <html:radio property="key" value="???" /> 
   <bean:write name="resView" property="key" filter="true"/>
</logic:iterate>

What I really need for the radio button is something like:
<html:radio property="key" value="<% resView.getKey(); %>" /> 

Have I reached the point where I *must* use JSTL, or is there a way to get a
property from the 'current' bean as you iterate through and use it as the
value of a radio button?

(It's not that I don't want to use JSTL, I just haven't figured out Struts
yet, and I can only absorb so much at one time!)

If it helps, I'm presenting a "resolution page" after the user has typed in
a name.  S/he will choose one of the names, and we'll go back to the
original form for more data entry.

Thanks,

-- 
Wendy Smoak
http://sourceforge.net/projects/unidbtags 



Re: Radio buttons inside an iterate tag?

Posted by Will Jaynes <ja...@umich.edu>.
Wendy,
Your example with the scriptlet is just what you need to do. This is a 
case where scriptlets are still necessary. JSTL will be the way to do it 
in the future, but you don't need to move to them before you are ready. 
And to use JSTL now in a struts tag like html:radio you would need to 
get the brand new struts-el tag library, which would be yet another 
thing.  So go ahead and use the scriptlet. They aren't so evil that they 
can't be used judiciously.

Wendy Smoak wrote:
> I can't find an example of this one:
> 
> <logic:iterate id="resView" name="foundPersons" >
>    <html:radio property="key" value="???" /> 
>    <bean:write name="resView" property="key" filter="true"/>
> </logic:iterate>
> 
> What I really need for the radio button is something like:
> <html:radio property="key" value="<% resView.getKey(); %>" /> 
> 
> Have I reached the point where I *must* use JSTL, or is there a way to get a
> property from the 'current' bean as you iterate through and use it as the
> value of a radio button?
> 
> (It's not that I don't want to use JSTL, I just haven't figured out Struts
> yet, and I can only absorb so much at one time!)
> 
> If it helps, I'm presenting a "resolution page" after the user has typed in
> a name.  S/he will choose one of the names, and we'll go back to the
> original form for more data entry.
> 
> Thanks,
> 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Radio buttons inside an iterate tag?

Posted by John Owen <jo...@hotmail.com>.
Also, I think you have to supply the name attribute in the <html:radio> tag.
----- Original Message -----
From: "John Owen" <jo...@hotmail.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Thursday, October 10, 2002 8:58 AM
Subject: Re: Radio buttons inside an iterate tag?


> I think the body of the <html:radio> tag is the value, so just do this :
>
> <logic:iterate id="resView" name="foundPersons" >
>    <html:radio property="key">
>    <bean:write name="resView" property="key" filter="true"/>
>   </html:radio>
> </logic:iterate>
>
> ----- Original Message -----
> From: "Wendy Smoak" <We...@asu.edu>
> To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
> Sent: Wednesday, October 09, 2002 6:29 PM
> Subject: Radio buttons inside an iterate tag?
>
>
> >
> > I can't find an example of this one:
> >
> > <logic:iterate id="resView" name="foundPersons" >
> >    <html:radio property="key" value="???" />
> >    <bean:write name="resView" property="key" filter="true"/>
> > </logic:iterate>
> >
> > What I really need for the radio button is something like:
> > <html:radio property="key" value="<% resView.getKey(); %>" />
> >
> > Have I reached the point where I *must* use JSTL, or is there a way to
get
> a
> > property from the 'current' bean as you iterate through and use it as
the
> > value of a radio button?
> >
> > (It's not that I don't want to use JSTL, I just haven't figured out
Struts
> > yet, and I can only absorb so much at one time!)
> >
> > If it helps, I'm presenting a "resolution page" after the user has typed
> in
> > a name.  S/he will choose one of the names, and we'll go back to the
> > original form for more data entry.
> >
> > Thanks,
> >
> > --
> > Wendy Smoak
> > http://sourceforge.net/projects/unidbtags
> >
> >
> >
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Radio buttons inside an iterate tag?

Posted by John Owen <jo...@hotmail.com>.
I think the body of the <html:radio> tag is the value, so just do this :

<logic:iterate id="resView" name="foundPersons" >
   <html:radio property="key">
   <bean:write name="resView" property="key" filter="true"/>
  </html:radio>
</logic:iterate>

----- Original Message -----
From: "Wendy Smoak" <We...@asu.edu>
To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
Sent: Wednesday, October 09, 2002 6:29 PM
Subject: Radio buttons inside an iterate tag?


>
> I can't find an example of this one:
>
> <logic:iterate id="resView" name="foundPersons" >
>    <html:radio property="key" value="???" />
>    <bean:write name="resView" property="key" filter="true"/>
> </logic:iterate>
>
> What I really need for the radio button is something like:
> <html:radio property="key" value="<% resView.getKey(); %>" />
>
> Have I reached the point where I *must* use JSTL, or is there a way to get
a
> property from the 'current' bean as you iterate through and use it as the
> value of a radio button?
>
> (It's not that I don't want to use JSTL, I just haven't figured out Struts
> yet, and I can only absorb so much at one time!)
>
> If it helps, I'm presenting a "resolution page" after the user has typed
in
> a name.  S/he will choose one of the names, and we'll go back to the
> original form for more data entry.
>
> Thanks,
>
> --
> Wendy Smoak
> http://sourceforge.net/projects/unidbtags
>
>
>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>