root/trunk/examples/templates/example_parser_pattemplate.ftmpl

Revision 320, 2.8 kB (checked in by schst, 3 years ago)

Parser now uses the element's id for the placeholder. Parser_patTemplateRenderer and Parser_SimpleRenderer now use the matching renderers as delegates (fixes bug #184 and #185). This commit may break some scripts, but the parser was labelled alpha before.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 <pattemplate:tmpl name="form">
2
3 <patForms:Form name="foo">
4
5 <!--
6     Form errors template - the formErrorsEntry template is the
7     one you have to set as "errorTemplate" parameter in the
8     renderForm() call. It is rendered automatically by the
9     Parser's patTemplate renderer.
10    
11     You can access the entire attribute collection of each
12     element that has errors via the {FIELD_XXX} variables, and
13     the error variables via the {ERROR_XXX} variables.
14    
15     Available error variables:
16     - code
17     - field (the fieldname)
18     - message
19     - type (the fieldtype, e.g. "String")
20 -->
21 <pattemplate:tmpl name="formErrors" visibility="hidden">
22 <div class="piErrors">
23     <div class="piErrorsTitle">Validation failed</div>
24     <div class="piErrorsContent">
25         Sorry, but the credentials you provided are not entirely correct. You're not going to get past this easily!<br/><br/>
26    
27         <pattemplate:tmpl name="formErrorsEntry">
28         <div class="piError">
29             <b>{FIELD_LABEL}:</b> {ERROR_MESSAGE} (Error #{ERROR_CODE})<br/>
30         </div>
31         </pattemplate:tmpl>
32     </div>
33 </div>
34 </pattemplate:tmpl>
35
36 <pattemplate:tmpl name="formSuccess" visibility="hidden">
37 <div class="piHint">
38     <b>Success!</b> Very well done, you've successfully provided a valid set of credentials for your login.
39     Unfortunately, this is only a dummy login... there's nothing to log into. But you
40     would have had there been :)
41 </div>
42 </pattemplate:tmpl>
43
44 <div class="piFrame">
45     <div class="piTitle">Login</div>
46     <div class="piContent">
47        
48         <div class="piAbstract">
49             Please provide your credentials here to log into your personal patForms example
50             collection.
51         </div>
52        
53         <table border="0" cellpadding="2" cellspacing="0">
54             <tr>
55                 <td>{ELEMENT_USERNAME_LABEL}</td>
56                 <td>
57                     <table cellpadding="0" cellspacing="0" border="0">
58                         <tr>
59                             <td><patForms:String name="username" label="Username" required="yes" description="Please enter your username here" size="8" maxlength="8" title="Enter your username. Max. length [ELEMENT_MAXLENGTH]" accesskey="U" /></td>
60                             <td>&nbsp;{ELEMENT_PASSWORD_LABEL}&nbsp;</td>
61                             <td><patForms:String name="password" label="Password" type="password" required="yes" size="8" maxlength="8" minlength="6" title="Enter your password. Max. length [ELEMENT_MAXLENGTH] / Min. length [ELEMENT_MINLENGTH]" accesskey="P" /></td>
62                             <td>&nbsp;{ELEMENT_AGE_LABEL}&nbsp;</td>
63                             <td><patForms:Number name="age" label="Age" required="yes" size="2" max="30" min="12" default="" title="Enter your age. Max [ELEMENT_MAX] / Min [ELEMENT_MIN]" accesskey="A" /></td>
64                         </tr>
65                     </table>
66                 </td>
67             </tr>
68             <tr>
69                 <td>{ELEMENT_COMMENTS_LABEL}</td>
70                 <td colspan="7"><patForms:Text name="comments" label="Comments" required="no" cols="68" rows="3" title="Enter any comments here" accesskey="C" /></td>
71             </tr>
72         </table>
73        
74     </div>
75 </div>
76
77 <input type="submit" name="save" value="Save" accesskey="S" />
78
79 </patForms:Form>
80
81 </pattemplate:tmpl>
Note: See TracBrowser for help on using the browser.