I wrote:
> Finally!  This works:
> <logic:iterate id="resView" name="foundPersons"
>       type="edu.asu.vpia.value.ResolutionView">
> <html:radio name="resView" property="key" value="<%=resView.getKey()%>"/> 
> 
> It turns into: 
> <input type="radio" name="key" value="0123456">

Thought I'd follow up on this one since there was more to it.  The radio
buttons were actually *all* getting "checked".
    <input type="radio" name="key" value="0123456" checked="checked">

Apparently radio buttons are meant to display a pre-defined set of choices,
and the <html:radio> tag will pre-select one of them based on a property of
a bean.  What I need is the ability to display a set of choices that I don't
know until right before the page is displayed.

I've got a Collection [foundPersons] of [ResolutionView] beans I'm iterating
through, doing one radio button *per bean*.

I ended up defining a getResolutionKey() method in my bean.  It just returns
an empty String, which keeps the <html:radio> tag from selecting every
single radio button.  (Of course the browser only showed the final one
selected, but I don't want *any* of them pre-selected.)

So now I have:
  <logic:iterate id="resView" name="foundPersons"
type="edu.asu.vpia.value.ResolutionView">
        <html:radio name="resView" property="resolutionKey"
value="<%=resView.getKey()%>"/> 
        <bean:write name="resView" property="key" filter="true"/>

And I get:
  <input type="radio" name="resolutionKey" value="0143062"> 0143062

I think that's the best I can do at present, although I'll probably try to
get rid of the scriptlet one day.

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

Reply via email to