class Category { String name; List choices }
and provide List<Category> as the model? so that the name of categories become optgroup tags?
right now - no.
what i am working on is very general and it will be trivial to build the above using a panel. maybe if i have time. or maybe someone will build it and contribute it back.
i want to finish this first and see how it turns out
-Igor
On 11/22/05, Mark Derricutt <[EMAIL PROTECTED]> wrote:
Do you also have a solution for the scenario when you don't want the HTML to explicitly define group1, group2 etc. as shown in the sample code I see mentioned previously in the thread?
I don't know the code currently works (I've only started looking at wicket) so not entirely sure what instances I'll find in "mylistofchoices" but assuming theres a Choice object, how about a new ChoiceGroup object that takes choices?
Select select=new Select("sel");
List mylistofchoices = new ArrayList();
mylistofchoices.add(new Choice("name", "value");
List mygroupofchoices = new ChoiceGroup("groupname");
mygroupofchoices.add(new Choice("anothername, "value");
mylistofchoices.add(mygroupofchoices);
Choices nogroup=new Choices("nogroup", mylistofchoices, choicerenderer);
select.add(nogroup);
Or something similar?
On 11/23/05, Igor Vaynberg <[EMAIL PROTECTED] > wrote:working on it right now :) how did you know?
