oh, and a form part like this: private static final class TextFieldDefinitionEditor extends Panel implements IFormEditor {
public TextFieldDefinitionEditor(String id, IModel fieldDefinitionModel) { super(id, new CompoundPropertyModel(fieldDefinitionModel)); add(new CheckBox("required")); add(new TextField("maxLength")); } public void onSubmit() { ... } } On 6/23/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote: > Looks like this: > > /** > * Parts of form. > */ > private static interface IFormEditor { > /** called by parent form on submitting. */ > void onSubmit(); > } > > and the actual form: > > protected void onSubmit() { > ... > visitChildren(IFormEditor.class, new IVisitor() { > > public Object component(Component component) { > IFormEditor editor = (IFormEditor) component; > editor.onSubmit(); > return IVisitor.CONTINUE_TRAVERSAL; > } > }); > ... > > > Eelco > > > On 6/23/06, Martijn Dashorst <[EMAIL PROTECTED]> wrote: > > The problem with using multiple forms is that only the data of one > > form is submitted. So if your user has entered data in 2-3 forms, only > > the form that is submitted retains its data. > > > > So what we typically do is have one form on a page, and create panels > > that contain form components, and add those to the form. This way you > > can have custom panels for custom entry fields, but have them work in > > any variety of forms. > > > > I'm still thinking about working on a FormPanel component, that > > receives onsubmit events, so you can embed the submit behavior for > > that specific custom panel inside the panel. > > > > This is something you can do yourself easily. Make your panels > > implement your own SubmitAware interface, containing an onsubmit > > method, and use a visitor in the form's submit event to propagate the > > submit event to each submit aware panel. > > > > Martijn > > > > On 6/23/06, Nino Wael <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > > > > Hi > > > > > > > > > > > > I've been creating some different components with wicket, so that I can > > > reuse them. On some of my pages there is stuff which does not encourage > > > reuse. All my components have their own form, none of them have regular > > > submit buttons. This is handled in another component, which also handles > > > what is next and previous page. > > > > > > > > > > > > So I wanted to hear what you have to say about this approach? > > > > > > > > > > > > Some of the pros are: > > > > > > > > > > > > Don't have to worry about placing the component tags within a form since > > > they bring their own. > > > > > > > > > > > > Might have some advantage in case of sub updating the page(ajax?)? > > > > > > > > > > > > > > > > > > Cons: > > > > > > > > > > > > How does this affect updating the model of separate forms when one forms > > > submit button are clicked. > > > > > > > > > > > > Not sure how multiple forms perform versus single form. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Regards Nino > > > Using Tomcat but need to do more? Need to support web services, security? > > > Get stuff done quickly with pre-integrated technology to make your job > > > easier > > > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > > > > > > > > _______________________________________________ > > > Wicket-user mailing list > > > Wicket-user@lists.sourceforge.net > > > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > > > > > > > > > > > > > -- > > Download Wicket 1.2 now! Write Ajax applications without touching > > JavaScript! > > -- http://wicketframework.org > > > > Using Tomcat but need to do more? Need to support web services, security? > > Get stuff done quickly with pre-integrated technology to make your job > > easier > > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > _______________________________________________ > > Wicket-user mailing list > > Wicket-user@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user