Hi.

I create Form and RadioGroup.

MyPage class
Form form = new Form("form");
add(form);
final RadioGroup radioGroup = new RadioGroup("radioGroup", new Model());
form.add(radioGroup);
radioGroup.add(new MyDataView(new MyDataProvider()));
form.add(new Button("button") {
        protected void onSubmit() {
                Book book = (Book) radioGroup.getModelObject();
                String title = book.getTitle();
        }
});

MyDataView class
protected void populateItem(final Item item) {
        Book book = (Book) item.getModelObject();
        item.add(new Radio("radio", item.getModel()));
        item.add(new Label("title", book.getTitle());
}

RadioGroup and its radio items(radio and title) output normally.
But when submit button is clicked, NullPointerException occur.
Book book = (Book) radioGroup.getModelObject();
This "book" object is null.

When adding ListView (not DataView) on RadioGroup, work fine.
What's wrong?

I use Wicket 1.2.

Regards,
R.A
--
View this message in context: 
http://www.nabble.com/RadioGroup-and-DataView-t1810187.html#a4933188
Sent from the Wicket - User forum at Nabble.com.



_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to