I already tried it but it is not working. I have to do following (which I don't want) to update the listView after I submit the form.
listView.setModel(new Model((Serializable) updatedList)); -----Original Message----- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 30, 2008 2:02 PM To: users@wicket.apache.org Subject: Re: ListView is not gettting updated listview.setreuseitems(true), read listview's javadoc -igor On Wed, Apr 30, 2008 at 10:59 AM, Patel, Sanjay <[EMAIL PROTECTED]> wrote: > > Hi, > > I am using ListView and and each item in the listview is RadioGroup. > Now the problem is, If radio1 is selected and I select radio2 and > submit the form the selection goes back to radio1. What is wrong with > following code? > > final ListView listView = new ListView("abc", myList) { > protected final void populateItem(final > ListItem > item) { > final MyObject object = (MyObject) > item.getModelObject(); > final RadioGroup radioGroup = new > RadioGroup("radio-group", new Model()); > > final Model radioModel1 = new > Model(myObject1); > final Model radioModel2 = new > Model(myObject2); > final Model radioModel3 = new > Model(myObject3); > > radioGroup.add(new Radio("radio1", > radioModel1)); > radioGroup.add(new Radio("radio2", > radioModel2)); > radioGroup.add(new Radio("radio2", > radioModel3)); > > // set default value for radio. > if (object.isTrue() != null && > object.isTrue()) { > > radioGroup.setModel(radioModel1); > } else if (object.isFalse() != null && > object.isFalse()) { > > radioGroup.setModel(radioModel2); > } else { > > radioGroup.setModel(radioModel3); > } > item.add(radioGroup); > } > }; > form.add(listView); > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]