You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by ta...@jakarta.apache.org on 2004/10/28 21:12:41 UTC
[Jakarta Tapestry Wiki] Updated: Gotchas
Date: 2004-10-28T12:12:40
Editor: JamieOrchardHays <ja...@dang.com>
Wiki: Jakarta Tapestry Wiki
Page: Gotchas
URL: http://wiki.apache.org/jakarta-tapestry/Gotchas
no comment
Change Log:
------------------------------------------------------------------------------
@@ -10,7 +10,7 @@
users of the application.
As mentioned in the previous gotcha implement PageRenderListener and then initialize your properties in pageBeginRender() to any client-specific value.
-= form parameter direction =
+= Form Parameter Direction =
If the "form" direction is specified for a component parameter, that component must implement the IFormComponent interface, directly or indirectly (through inheritance).
If there is a component which wraps a form components and is, itself, embedded in a form but does not implement the IFormComponent interface, then the
parameter directions for any inherited-bindings should be of direction "in", rather than "form"
@@ -20,3 +20,15 @@
MyComponent, in turn, uses an inherited-binding to bind textFieldValue to the "value" parameter of the TextField component.
Even though the parameter "value" is direction "form", the "textFieldValue" parameter should
be direction "in".
+
+
+= Form and Submit Listeners: Order Matters =
+In 3.0, it matters ''where'' you place your Submit components in your html template. Why? Because
+components are processed in order during the rewind. This means that if you have a Submit button
+placed on a Form before some other component whose value is needed, the field's new value will not be included
+because the Submit listener is called first. If your listener is on the Submit component, then make sure the
+component is placed last in the Form. Also, it is important to remember that a listener placed on the Form
+component is ''always'' called. This can getcha (get you) when, for example, you have a Cancel button with a
+listener but put your default Form listener in the Form component. '''Both''' listeners will be called!
+Either use listeners on your Submit components only, or use them to set flags that are read by the Form
+listener.
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org