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 CesarLesc:
http://wiki.apache.org/tapestry/Tapestry5HowToUseForms

The comment on the change is:
how to use context parameter

------------------------------------------------------------------------------
   *failure -> calls onFailure()
   *submit -> calls onSubmit()
  
+ 
+ ==== Context Information ====
+ 
+ Sometimes you need to store additional data in a form (like the primary key 
of an entity in a edit page)
+ in such cases use the context parameter of the form, and retrieve this 
parameter with the onPrepare event.
+ 
+ for example the template:
+ {{{
+   <t:form t:id="form" t:context:"id">
+    
+   ...
+ 
+   </t:form>
+ 
+ }}}
+ 
+ and the page object:
+ 
+ {{{
+   private long id;
+ 
+   long getId(){
+     return id;
+   }
+ 
+   void onPrepare(long id){
+      this.id = id;
+   }
+ 
+ }}}
  
  ==== Dealing with multiple forms ====
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to