Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…l guide.
  • Loading branch information...
commit 897029ad8ad3269d2d62641a01d981375f9026b2 1 parent bde8741
@racke racke authored
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>
Please sign in to comment.
Something went wrong with that request. Please try again.