You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Ted Husted <hu...@apache.org> on 2002/06/21 19:11:24 UTC
html:radio.valueProperty
I haven't needed one before, but it looks like we could use a tag
enhancement for printing a collection of radio buttons.
Given a standard LabelValue type collection, this seems to work well
enough
<logic:iterate id="row" name="HOURS"
type="org.apache.struts.util.LabelValueBean">
<html:radio property="hours" value="<%=row.getValue()%>"/> <bean:write
name="row" property="label"/>
</logic:iterate>
And just adding a "valueProperty" property could eliminate the
scriptlet, so we'd have
<logic:iterate id="row" name="HOURS">
<html:radio property="hours" name="row" valueProperty="value"/>
<bean:write name="row" property="label"/>
</logic:iterate>
Should I give this a whirl, or is there a better solution already?
-- Ted Husted, Husted dot Com, Fairport NY US
-- Java Web Development with Struts
-- Tel: +1 585 737-3463
-- Web: http://husted.com/about/services
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: html:radio.valueProperty
Posted by Mirko Maischberger <mi...@lilik.dmti.unifi.it>.
Il ven, 2002-06-21 alle 19:11, Ted Husted ha scritto:
> [...]
> Given a standard LabelValue type collection, this seems to work well
> enough
> [...]
> <logic:iterate id="row" name="HOURS">
> <html:radio property="hours" name="row" valueProperty="value"/>
> <bean:write name="row" property="label"/>
> </logic:iterate>
>
> Should I give this a whirl, or is there a better solution already?
<html:radio>, <html:checkbox> and <html:select> (single or multiple) are
almost the same thing. I think there is a way to switch between
different views with a lot fewer typing.
What about:
<html:select type="radio|cehckbox|single|multiple">
<logic:iterate>
some HTML <html:option property="" valueProperty=""> HTML
</logic:iterate>
</html:select>
And
<html:select type="radio|cehckbox|single|multiple">
<html:options property="" valueProperty=""
prefixKey="HTML" suffixKey="HTML">
</html:select>
Bye,
Mirko Maischberger
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>