Hi Andy,

I find the easiest way to populate a select list is just to pass it a Map of
values. Something like the following:

        public Map<Integer,String> getMonthsModel()
        {               
                Map<Integer,String> model = new LinkedHashMap<Integer,String>();
                
                model.put(1, "Jan");
                model.put(2, "Feb");
                model.put(3, "Mar");
                
                return model;
                
        }


<select t:type="Select" t:model="monthsModel" />

Andrew





Andy Pahne-7 wrote:
> 
> 
> I feel a little dumb, because for years I have been using Tapestry.
> 
> Is there an _easy_ way og creating a SelectModel like this one (not so 
> uncommon one):
> 
>     value    label
> ---------------------
>       1         Jan
>       2         Feb
>       ...
> 
> 
> I had a look at the documentation. But I cannot believe I have to deal 
> with SelectModel, OptionModel, OptionGroupModel and whatelse for this 
> simple usecase.
> 
> I also had a look at the Wiki. I found four pages about selects. I 
> cannot believe that I have to use such bloat for my usecase.
> 
> I surely must be missing something, or not?
> 
> Andy
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Easy-Way-to-create-a-select-model--tp27356514p27379053.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to