[Wicket-user] ListViews dynamic Forms
Hi! After I had some chit-chat ;-) with Almaw today already on IRC I still am looking for a solution fot the following problem: Consider the following Form: form input name=description type=text value= / (required=true) --- ListView: n times input name=images type=text value=xy/ input type=submit value=add image/ --- input type=submit value=save/ /form The 'add image'-button allows the user to add more input-fields of 'images' to be added to the ListView. Everything works fine on this Form as long as the Form validates and the Model gets updated on 'add image' - the ListView-input-fields are saved before adding another entry. But this doesn't work out in the above case, when description isn't yet filled out (because it's a required field). Then the new images-input-field has to be added within an 'onError'-Event. Since I change the ListViews's Model, I have to call listview.removeAll() so the ListView is recreated from the Model (which isn't updated because of validation errors). So any input the user entered to the ListView-fields before pressing 'add image' are lost. Inner Forms aren't an option either, because the images-input-field might also not validate (I have quite an complex test case set up). So, my question is: can I save the posted values to the model without actually verify all fields? I tried to override validate() and only call super.validate() when the 'save'-button is entered, but that didn't work out. Any help is appreciated. Best regards, --- Jan. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] ListViews dynamic Forms
Hi, update on this topic: I've found a workaround to update the ListViews childrens Models by walking the Components below ListView with an IVisitor and do a updateModel() on all FormComponents. The question remains, if there's a way to do this without updating the Model? Best regards, --- Jan. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] ListViews dynamic Forms
if you enable listview.reuseitems(true) your values should stick. make addbutton.defaultformprocessing(false). the idea here is that reuseitems will cause the comeponentpath of textfields not change - which will cause their name attribute not to change also - which will cause them to pick up the submitted value from last request. make sure that all addbutton.submit does is add a value to the ened of the listview's model. -igor On 7/11/07, Jan Kriesten [EMAIL PROTECTED] wrote: Hi, update on this topic: I've found a workaround to update the ListViews childrens Models by walking the Components below ListView with an IVisitor and do a updateModel() on all FormComponents. The question remains, if there's a way to do this without updating the Model? Best regards, --- Jan. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user