You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Zoran Avtarovski <zo...@sparecreative.com> on 2007/04/30 03:36:19 UTC

[s2] Collection based form tag question

I'm trying to use a mix of a dynamic list a static option for a select list
and checkbox list but I need some OGNL help.

In s1 I would have the following:

<html:select property="icon">
   <html:option value="0">Default image</html:option>
   <html:option value="-1">No image</html:option>
   <html:optionsCollection name="iconList" label="fileName"
value="fileName"/>
</html:select>

This way I get my collection from the server (db, directory, etc) and I can
add a couple of default values that I don't want to add in the service
layer. 

If somebody could could just point out the s2 way, I'll happily slink away.

Z.



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [s2] Collection based form tag question

Posted by Dave Newton <ne...@yahoo.com>.
--- Zoran Avtarovski <zo...@sparecreative.com> wrote:
> I'm trying to use a mix of a dynamic list a static
> option for a select list and checkbox list but I
need
> some OGNL help.

IIRC there are attributes for a single additional
value; I don't think that extends to multiple options,
though.

The simplest way would be to manually iterate over the
collection and create options, but obviously you'd
have to deal with select options yourself.

d.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org