Permalink
Browse files

Add example for form attributes generated by the load hook to WellWel…

…l guide.
  • Loading branch information...
1 parent bde8741 commit 897029ad8ad3269d2d62641a01d981375f9026b2 @racke racke committed Jul 15, 2010
Showing with 22 additions and 3 deletions.
  1. +22 −3 guides/wellwell.xml
View
25 guides/wellwell.xml
@@ -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 form load hook 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>

0 comments on commit 897029a

Please sign in to comment.