root/trunk/examples/templates/example_parser_pattemplate_group.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 <!--
4     Form errors template - the formErrorsEntry template is the
5     one you have to set as "errorTemplate" parameter in the
6     renderForm() call. It is rendered automatically by the
7     Parser's patTemplate renderer.
8    
9     You can access the entire attribute collection of each
10     element that has errors via the {FIELD_XXX} variables, and
11     the error variables via the {ERROR_XXX} variables.
12    
13     Available error variables:
14     - code
15     - field (the fieldname)
16     - message
17     - type (the fieldtype, e.g. "String")
18 -->
19 <pattemplate:tmpl name="formErrors" visibility="hidden">
20 <div class="piErrors">
21     <div class="piErrorsTitle">Validation failed</div>
22     <div class="piErrorsContent">
23         Sorry, but the credentials you provided are not entirely correct. You're not going to get past this easily!<br/><br/>
24    
25         <pattemplate:tmpl name="formErrorsEntry">
26         <div class="piError">
27             <b>{FIELD_LABEL}:</b> {ERROR_MESSAGE} (Error #{ERROR_CODE})<br/>
28         </div>
29         </pattemplate:tmpl>
30     </div>
31 </div>
32 </pattemplate:tmpl>
33
34 <pattemplate:tmpl name="formSuccess" visibility="hidden">
35 <div class="piHint">
36     <b>Success!</b> Very well done, you've successfully provided a valid set of credentials for your login.
37     Unfortunately, this is only a dummy login... there's nothing to log into. But you
38     would have had there been :)
39 </div>
40 </pattemplate:tmpl>
41
42 <patForms:Form name="login">       
43 <div class="piFrame">
44     <div class="piTitle">Login</div>
45     <div class="piContent">
46        
47         <div class="piAbstract">
48             Please provide your credentials here to log into your personal patForms example
49             collection.
50         </div>
51        
52         <table border="0" cellpadding="2" cellspacing="0">
53             <tr>
54                 <td>{ELEMENT_USERNAME_LABEL}</td>
55                 <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>
56             </tr>
57             <tr>
58                 <td>{ELEMENT_REALNAME_LABEL}</td>
59                 <td>
60                     <patForms:Group name="realname" label="Realname">
61                         <table>
62                             <tr>
63                                 <td><patForms:String name="name" label="Name" required="yes" description="Please enter your name here" size="8" maxlength="50" accesskey="U" /></td>
64                                 <td><patForms:String name="surname" label="Surname" required="yes" description="Please enter your surname here" size="8" maxlength="50" accesskey="U" /></td>
65                             </tr>
66                         </table>
67                         <patForms:RadioGroup name="foo">
68                             <table>
69                                 <tr>
70                                     <td><patForms:Option label="Foo" value="foo"/></td>
71                                     <td>&nbsp;Foo</td>
72                                     <td><patForms:Option label="Bar" value="bar"/></td>
73                                     <td>&nbsp;Bar</td>
74                                 <tr>
75                             </table>
76                         </patForms:RadioGroup>
77                     </patForms:Group>
78                 </td>
79             </tr>
80         </table>
81     </div>
82 </div>
83 <input type="submit" name="save1" value="Save" accesskey="S" />
84 </patForms:Form>       
85 </pattemplate:tmpl>
Note: See TracBrowser for help on using the browser.