Wicket: Radiogroup with radio's in different panel
I have a RadioGroup (searchChoice) in my Primarypanel, I have another panel (ResultPanel) which hold DataTable with radio as one of its column. I have added this ResultPanel to searchChoice RadioGroup, hence radio's in ResultPanel comes under searchChoice RadioGroup.
From primary panel i am adding another Radio to the searchChoice RadioGroup, which has an ajax behavior to enable and disable buttons on the PrimaryPanel.
My Probelm is how to get the selected object.
In ResultPanel.java i have the radio column added as follows:
Button submitButton = new Button("submitButton", new Model<String>("Submit")
public void onSumbit()
Object obj = searchChoice.getDetaultModelObject(); //--> i am getting nothing, its null.
//Also tried like,
Object obj = currentObjectModel; // --> this also am getting null
i am not able to get the selected object from the RadioGroup.
Can someone please help me on this.
Re: Wicket: Radiogroup with radio's in different panel
I have found the solution (or Work-around) for the problem i had. i am not sure why my previous code not worked. But i made the changes like, i have moved the searchChoice radiogroup (i removed the property model binded to it) to my ResultPanel.java and made it a instance variable in ResultPanel.java. Then from PrimaryPanel.java when ever the search button is clicked, based on the search criteria, i retrieve the searchChoice radiogroup and inturn get the Default object set it in.