Hi all, I am new at this so please be gentle.

I would like to use a RadioGroup to select one "element" among a list
of elements organized in groups.
I have two nested ListView, the outer looping over the groups, the
inner one looping over the elements of each group.
Each element of the inner listview has a Radio.

I have tried the following but I get the error:
WicketMessage: Component radio must be applied to a tag with 'type'
attribute matching 'radio', not 'null'
probably because the radio are in the items of the inner ListView
while the outer ListView is added to the RadioGroup.


Form form = new Form("form");
add(form);              
final RadioGroup radioGroup = new RadioGroup("radioGroup", new Model());

ListView listviewGroups = new ListView("listviewGroups", groups){

        @Override
        protected void populateItem(ListItem groupItem) {
                SubCategory group = (SubCategory) groupItem.getModelObject();
                groupItem.add(new Label("group", group.getName()));

                ListView listviewElements = new ListView("listviewElements",
                                 service.getElementsForGroup(group.getId())) {

                        @Override
                        protected void populateItem(ListItem elementItem) {
                                Element element = (Element) 
futureItem.getModelObject();
                                elementItem.add(
                                        new Label("element", 
element.getName()));
                                elementItem.add(
                                        new Radio("radio", 
elementItem.getModel());                     
                        }                       
                };
                groupItem.add(listviewElements);                
        }
};
radioGroup.add(listviewGroups);
form.add(radioGroup);

/*----- and this in the html -----------*/

<form wicket:id="form">
        <div wicket:id="radioGroup">
                <div wicket:id="listviewGroups" >
                        <span wicket:id="group"></span>
                        <table>
                                <tr wicket:id="listviewElements">
                                        <td>
                                                <input wicket:id="radio"/>
                                                <span 
wicket:id="element"></span>
                                        </td>
                                </tr>
                        </table>
                </div>
        </div>
</form>

Many thanks in advance for any help!

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

Reply via email to