Raible's Wiki

Raible Designs
Wiki Home
News
Recent Changes

AppFuse

Homepage
  - Korean
  - Chinese
  - Italian
  - Japanese

QuickStart Guide
  - Chinese
  - French
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish
  - Japanese

User Guide
  - Korean
  - Chinese

Tutorials
  - Chinese
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish

FAQ
  - Korean

Latest Downloads

Other Applications

Struts Resume
Security Example
Struts Menu

Set your name in
UserPreferences


Referenced by
Articles
Articles_cn
Articles_de
Articles_pt
Articles_zh
TapestryPages




JSPWiki v2.2.33

[RSS]


Hide Menu

ValidationAndListTapestry


Difference between version 20 and version 15:

At line 21 changed 1 line.
Implementing validation with Tapestry is quite simple. All you need to do is configure a "validators" property on your [TextField|http://jakarta.apache.org/tapestry/doc/ComponentReference/TextField.html] components. The validation integration for the personForm.html page is already done by AppGen in the personForm.page. If you open web/pages/personForm.page, you should see the following XML. I've highlighted the portions that are relevant to validation.
Implementing validation with Tapestry is quite simple. All you need to do is configure a "validators" property on your [TextField|http://jakarta.apache.org/tapestry/doc/ComponentReference/TextField.html] components. The validation integration for the personForm.html page is already done by AppGen in the personForm.page. If you open web/pages/personForm.page, you should see the following XML.
At line 23 changed 3 lines.
<pre>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE page-specification PUBLIC
{{{<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE page-specification PUBLIC
At line 27 changed 1 line.
"http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd"&gt;
"http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
At line 29 changed 5 lines.
&lt;page-specification class="org.appfuse.webapp.action.PersonForm"&gt;
&lt;inject property="engineService" object="engine-service:page"/&gt;
&lt;inject property="request" object="service:tapestry.globals.HttpServletRequest"/&gt;
&lt;inject property="response" object="service:tapestry.globals.HttpServletResponse"/&gt;
&lt;inject property="personManager" type="spring" object="personManager"/&gt;
<page-specification class="org.appfuse.webapp.action.PersonForm">
<inject property="engineService" object="engine-service:page"/>
<inject property="request" object="service:tapestry.globals.HttpServletRequest"/>
<inject property="response" object="service:tapestry.globals.HttpServletResponse"/>
<inject property="personManager" type="spring" object="personManager"/>
At line 35 changed 2 lines.
<span style="background-color: yellow">&lt;bean name="delegate" class="org.appfuse.webapp.action.Validator"/&gt;</span>
&lt;property name="message" persist="flash"/&gt;
<bean name="delegate" class="org.appfuse.webapp.action.Validator"/>
<property name="message" persist="flash"/>
At line 38 changed 4 lines.
&lt;component id="personForm" type="Form"&gt;
<span style="background-color: yellow">&lt;binding name="delegate" value="ognl:beans.delegate"/&gt;
&lt;binding name="clientValidationEnabled" value="true"/&gt;</span>
&lt;/component&gt;
<component id="personForm" type="Form">
<binding name="delegate" value="ognl:beans.delegate"/>
<binding name="clientValidationEnabled" value="true"/>
</component>
At line 43 changed 10 lines.
&lt;component id="firstNameField" type="TextField"&gt;
&lt;binding name="value" value="person.firstName"/&gt;
<span style="background-color: yellow">&lt;binding name="validators" value="validators:required"/&gt;</span>
&lt;binding name="displayName" value="message:person.firstName"/&gt;
&lt;/component&gt;
&lt;component id="lastNameField" type="TextField"&gt;
&lt;binding name="value" value="person.lastName"/&gt;
<span style="background-color: yellow">&lt;binding name="validators" value="validators:required"/&gt;</span>
&lt;binding name="displayName" value="message:person.lastName"/&gt;
&lt;/component&gt;
<component id="firstNameField" type="TextField">
<binding name="value" value="person.firstName"/>
<binding name="validators" value="validators:required"/>
<binding name="displayName" value="message:person.firstName"/>
</component>
<component id="lastNameField" type="TextField">
<binding name="value" value="person.lastName"/>
<binding name="validators" value="validators:required"/>
<binding name="displayName" value="message:person.lastName"/>
</component>
At line 54 changed 1 line.
&lt;/page-specification&gt;</pre>
</page-specification>}}}
At line 211 changed 2 lines.
protected void onSetUp() throws Exception {
super.onSetUp();
protected void onSetUpBeforeTransaction() throws Exception {
super.onSetUpBeforeTransaction();
At line 220 changed 1 line.
super.onTearDown();
super.onTearDownAfterTransaction();
At line 378 changed 1 line.
<Menu name="PeopleMenu" title="menu.viewPeople" forward="viewPeople"/>
<Menu name="PeopleMenu" title="menu.viewPeople" page="/people.html"/>

Back to ValidationAndListTapestry, or to the Page History.