With Select  you have more control over the markup between the <select> tag
and its children <option> tags

>From Select javadoc: Component that represents a <select> box. Elements are
provided by one or more SelectChoice or SelectOptions components in the
hierarchy below the Select component. Advantages to the standard choice
components is that the user has a lot more control over the markup between
the <select> tag and its children <option> tags: allowing for such things as
<optgroup> tags.

On Wed, Sep 16, 2009 at 4:14 PM, Troy Cauble <[email protected]> wrote:

> I'm having some trouble changing a DropDownChoice
> to a Select + SelectOptions.  Do these look equivalent?
>
> Thanks,
> -troy
>
>               // new DropDownChoice(id, rackListModel,
>                //                              new ChoiceRenderer("name"));
>
>                Select select = new Select(id);
>                IOptionRenderer rend = new IOptionRenderer() {
>                        public String getDisplayValue(Object o)
>                        {
>                                return ((Rack)o).getName();
>                        }
>                        public IModel getModel(Object value)
>                        {
>                                return new Model((Serializable)value);
>                        }
>                };
>                SelectOptions options = new SelectOptions("options",
>                                                rackListModel,
>                                                rend);
>                select.add(options);
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to