System.out.println("nat model: " + radioGroup.getModelObject()); //this //outputs null everytime - that's my problem
why wouldnt it output null? you havent set the model on the RadioGroup so it is null unless there is a compound model somewhere higher that has a getMyValue()
-Igor
On 8/4/06, Alex Parvulescu <[EMAIL PROTECTED]> wrote:
hello,
the code is like this :
//------------------------------------------------------------
final RadioGroup radioGroup = new RadioGroup("myValue");
System.out.println("nat model: " + radioGroup.getModelObject()); //this //outputs null everytime - that's my problem
final List<String> optLabelList = Arrays.asList(new String[] {
"Opt1", "Opt2" });
//
ListView radioList = new ListView("myOpts", optLabelList) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem item) {
int number = item.getIndex();
//
final Radio radio = new Radio("radio", new Model(new Integer(number)));
radio.add(new AjaxEventBehavior("onchange") {
protected void onEvent(AjaxRequestTarget target) {
//some ajax event
}
});
item.add(radio);
item.add(new Label("label", optLabelList.get(number)));
}
};
radioList.setReuseItems(true);
radioGroup.add(radioList);
add(radioGroup);
//------------------------------------------------------------
this is part of a panel,in a form,onsubmit it updates the pojo,but if i return to this panel,the radiogroup model is null.
i tried to set the initial value of "myValue" to 1 and the correct radio gets selected.but the model of the radiogroup is still null
thanks,Alex
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user