You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Daniele Dellafiore <il...@gmail.com> on 2011/10/10 17:35:34 UTC

SelectOption and DropDownChoice

Hi.

I need to add an attribute to an <option> inside a dropdown. I'd
rather have a DropDownChoice and the ability to add an
AttributeModifier to every option but I can't find a way to acccess
the single options of the drop down.

Instead I've read about solutions that involve SelectOption but I
can't get how SelectOptions and DropDownChoice are related, it seems
in no way. I do not clearly understand SelectOption.
I'd rather keep using a DropDownChoice which have a clear interface to
add options (just pass a list of elements in the constructor) and in
the selection model, which I do not find at all in the SelectOptions.

-- 
Daniele Dellafiore
http://danieledellafiore.net

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: SelectOption and DropDownChoice

Posted by Andrea Del Bene <an...@gmail.com>.
Hi,

you can take a look at method AbstractChoice.appendOptionHtml. You can 
manipulate HTML overriding it. But I think there's no way to access to 
single options. I solved a similar problem using some JavaScript...
> Hi.
>
> I need to add an attribute to an<option>  inside a dropdown. I'd
> rather have a DropDownChoice and the ability to add an
> AttributeModifier to every option but I can't find a way to acccess
> the single options of the drop down.
>
> Instead I've read about solutions that involve SelectOption but I
> can't get how SelectOptions and DropDownChoice are related, it seems
> in no way. I do not clearly understand SelectOption.
> I'd rather keep using a DropDownChoice which have a clear interface to
> add options (just pass a list of elements in the constructor) and in
> the selection model, which I do not find at all in the SelectOptions.
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org