use repeatingview instead of listview, or call setreuseitems on the listview. there is javadoc on the listview that warns you about this.
-igor On Sun, Mar 29, 2009 at 11:55 PM, Marieke Vandamme <[email protected]> wrote: > > Hello, > > Can't anyone help me with this? > Or do I just report a jira bug for this? > THANKS! > > > Marieke Vandamme wrote: >> >> Hello, >> >> consider example underneath. >> Form with DateTextField and RadioGroup. When an incorrect date is entered >> in the TextField, the value choosen in radiogroup is lost. When correct >> date is entered, the value is shown correct in radiogroup. >> Is this an error in my code? Or a bug? >> I'm using wicket 1.4-rc2. >> Thanks for any help !! >> >> ==TestPage.java== >> public class TestPage extends WebPage { >> private String color; >> private Date date; >> public TestPage(){ >> Form myform = new Form("myform"); >> myform.add(new FeedbackPanel("feedback")); >> myform.add(new DateTextField("date", new PropertyModel(this, >> "date"))); >> List<String> colors = Arrays.asList(new String[]{"green", "red", >> "yellow"}); >> myform.add(new RadioGroup("colors", new PropertyModel(this, >> "color")) >> .add(new ListView<String>("color", colors) { >> @Override >> protected void populateItem(ListItem<String> item) { >> item.add(new Radio("radio", item.getModel())) >> .add(new Label("value", item.getModelObject())); >> } >> })); >> add(myform); >> } >> >> public String getColor() { >> return color; >> } >> public void setColor(String color) { >> this.color = color; >> } >> public Date getDate() { >> return date; >> } >> public void setDate(Date date) { >> this.date = date; >> } >> } >> >> ==TestPage.html== >> <html> >> <head> >> <title></title> >> </head> >> <body> >> <form wicket:id="myform"> >> <input type="submit"/> >> <wicket:container wicket:id="feedback"/> >> <input type="text" wicket:id="date"/><br/> >> <wicket:container wicket:id="colors"> >> <table> >> <tr wicket:id="color"> >> <td><input type="radio" wicket:id="radio"/></td> >> <td wicket:id="value"></td> >> </tr> >> </table> >> </wicket:container> >> </form> >> </body> >> </html> >> >> > > -- > View this message in context: > http://www.nabble.com/RadioGroup-lost-value-after-onError-form-tp22718553p22777319.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > 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]
