Hi,

Try it this way.

<html
xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.3-strict.dtd";
>
    <head>  
        <title>Wicket Quickstart Archetype Homepage</title>
    </head>
    <body>
        <form wicket:id="form">
            
            <input type="submit" value="submit"/>
        </form>
        <div wicket:id="listview">
            item
        </div>
    </body>
</html>



public class HomePage extends WebPage {

    private static final long serialVersionUID = 3555903561445555986L;
    //this lists holds selected items
    ArrayList<String> chosen = new ArrayList<String>();
    //this list provides available choices
    List<String> choices = Arrays.asList(new String[]{"One", "Two",
"Three"});

    public HomePage(final PageParameters parameters) {

        Form form = new Form("form");
        //add a checkbox group
        form.add(new CheckBoxMultipleChoice("choices", new Model(chosen),
choices));
        add(form);
        //render selected items in a listview
        add(new ListView<String>("listview", chosen) {

            @Override
            protected void populateItem(ListItem<String> item) {
                item.add(new Label("item", item.getModelObject()));
            }
        });
    }
}

cheers
Marcin
-- 
View this message in context: 
http://www.nabble.com/CheckBoxMultipleChoice-Construtor-Nigthmare...-tp24505133p24505999.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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

Reply via email to