[interchange-docs] [SCM] Interchange XML documentation branch, master, updated. e264952dc171a6649b8a3fbb54f1ca9c56028368

Stefan Hornburg interchange-cvs at icdevgroup.org
Thu Jul 15 10:31:41 UTC 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Interchange XML documentation".

The branch, master has been updated
       via  e264952dc171a6649b8a3fbb54f1ca9c56028368 (commit)
       via  ea287e2fb4c03ba9fc4e92f5f342bdbb0733f550 (commit)
       via  897029ad8ad3269d2d62641a01d981375f9026b2 (commit)
      from  bde87411818ccdcc4dfd537fe98b0dc79127f1cf (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit e264952dc171a6649b8a3fbb54f1ca9c56028368
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date:   Thu Jul 15 11:48:20 2010 +0200

    Add 2010 to copyright years of WellWell guide.

commit ea287e2fb4c03ba9fc4e92f5f342bdbb0733f550
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date:   Thu Jul 15 11:46:40 2010 +0200

    Move documentation on form load resp. save hooks into their own sections.

commit 897029ad8ad3269d2d62641a01d981375f9026b2
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date:   Thu Jul 15 11:38:27 2010 +0200

    Add example for form attributes generated by the load hook to WellWell guide.

-----------------------------------------------------------------------

Summary of changes and diff:
 guides/wellwell.xml |   40 ++++++++++++++++++++++++++++++++--------
 1 files changed, 32 insertions(+), 8 deletions(-)

diff --git a/guides/wellwell.xml b/guides/wellwell.xml
index 17bcd6d..8845bef 100644
--- a/guides/wellwell.xml
+++ b/guides/wellwell.xml
@@ -11,7 +11,7 @@
 	<titleabbrev>wellwell</titleabbrev>
 
 	<copyright>
-		<year>2008</year><year>2009</year>
+		<year>2008</year><year>2009</year><year>2010</year>
 		<holder>Interchange Development Group</holder>
 	</copyright>
 
@@ -642,9 +642,28 @@ wellwell=> select * from form_attributes where component = 'content_edit';
    30 | uri  | content_edit | width     | 200
    31 | body | content_edit | height    | 400
 </screen>
-	<para>
-	&nbsp;
-	</para>
+<para>
+	The <olink targetptr="form_load_hook">form load hook</olink> can also be used to provide form atttributes:
+</para>
+<programlisting><![CDATA[
+Sub form_address_edit_load <<EOS
+sub {
+	my %attributes;
+
+	# load shipping address
+	$Tag->address({function => 'load',
+				type => 'shipping'});
+
+	# setup dropdown for country
+	$attributes{country}->{lookup_query} = q{SELECT code,name FROM country ORDER BY priority DESC, name};
+
+	return {attributes => \%attributes};
+}
+EOS
+]]></programlisting>
+<para>
+&nbsp;
+</para>
 </section>
 
 	<section>
@@ -660,8 +679,10 @@ wellwell=> select * from form_attributes where component = 'content_edit';
 			<para>
 		The first parameter for both hook subs is the part name.
 			</para>
-			<para>
-		<emphasis role='bold'>The load hook</emphasis> is called for the setup of
+		<section id="form_load_hook">
+			<title>Load hook</title>
+		<para>
+		The load hook is called for the setup of
 		a form part. It is not
 		called if the profile check for the form part has failed.
 		The return value of the load hook is either a false value or
@@ -676,9 +697,11 @@ wellwell=> select * from form_attributes where component = 'content_edit';
 				attributes  &mdash; hash reference providing defaults for form attributes
 			</para></listitem>
 		</itemizedlist>
-
+		</section>
+	  	<section id="form_save_hook">
+			<title>Save hook</title>
 			<para>
-		<emphasis role='bold'>The save hook</emphasis> is called if the form part has
+		The save hook is called if the form part has
 		been successfully submitted (e.g. profile check successful). The return value of the load hook is either a false value or
 		a hash reference where the following members are recognized:
 			</para>
@@ -691,6 +714,7 @@ wellwell=> select * from form_attributes where component = 'content_edit';
 				redirect &mdash; redirects to the specified page if true
 			</para></listitem>
 		</itemizedlist>
+		</section>
 		</section>	
 
 		<section>


hooks/post-receive
-- 
Interchange XML documentation



More information about the docs mailing list