Dear Wiki user, You have subscribed to a wiki page or wiki category on "Tapestry Wiki" for change notification.
The following page has been changed by DanielJue: http://wiki.apache.org/tapestry/Tapestry5HowToUseForms The comment on the change is: minor stuff ------------------------------------------------------------------------------ ==== Form Events ==== - *prepare -> calls OnPrepare() + *prepare -> calls !OnPrepare() - *validate -> calls OnValidate() + *validate -> calls !OnValidate() - *success -> calls OnSuccess() + *success -> calls !OnSuccess() - *failure -> calls OnFailure() + *failure -> calls !OnFailure() - *submit -> calls OnSubmit() + *submit -> calls !OnSubmit() ==== Dealing with multiple forms ==== @@ -23, +23 @@ It's a good idea to give an id to your forms, either in a component annotation in your code, or in the html template. Here's how it looks using annotations: {{{ - @Component(id = "runsocmpform") + @Component(id = "foo") private Form form; }}} @@ -37, +37 @@ Now when you have ids for your forms, you probably want a specific method to get called when a particular form is acted on. Lets say we have forms with ids "foo" and "bar". - If you have a method called OnSubmit() or OnSuccess(), etc, they will get called for either form. This happens even if the forms are nested in subcomponents on the page! + If you have a method called OnSubmit() or OnSuccess(), etc, they will get called for either form. This happens even if the forms are inside subcomponents on the page! + + * This is just a friendly reminder that forms themselves cannot be nested. + {{{ + <!--You can't do this! --> + <form> + <form> + </form> + </form> + + <!--You CAN do this! --> + <form> + </form> + <form> + </form> + }}} To make form "foo" call a specific method, suffix the On_____() with On_____FromFoo() --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
