You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by jk...@apache.org on 2006/07/23 06:32:04 UTC
svn commit: r424671 - in /tapestry/tapestry4/trunk: src/site/apt/UsersGuide/
src/site/xdoc/UsersGuide/
tapestry-framework/src/java/org/apache/tapestry/asset/
tapestry-framework/src/js/tapestry/
Author: jkuhnert
Date: Sat Jul 22 21:32:02 2006
New Revision: 424671
URL: http://svn.apache.org/viewvc?rev=424671&view=rev
Log:
Started adding new validation documentation, fix for TAPESTRY-1020
Added:
tapestry/tapestry4/trunk/src/site/apt/UsersGuide/
tapestry/tapestry4/trunk/src/site/apt/UsersGuide/validation.apt
tapestry/tapestry4/trunk/src/site/xdoc/UsersGuide/validation-old.xml
- copied unchanged from r424663, tapestry/tapestry4/trunk/src/site/xdoc/UsersGuide/validation.xml
Removed:
tapestry/tapestry4/trunk/src/site/xdoc/UsersGuide/validation.xml
Modified:
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/asset/AssetService.java
tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/core.js
Added: tapestry/tapestry4/trunk/src/site/apt/UsersGuide/validation.apt
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/src/site/apt/UsersGuide/validation.apt?rev=424671&view=auto
==============================================================================
--- tapestry/tapestry4/trunk/src/site/apt/UsersGuide/validation.apt (added)
+++ tapestry/tapestry4/trunk/src/site/apt/UsersGuide/validation.apt Sat Jul 22 21:32:02 2006
@@ -0,0 +1,40 @@
+ ------
+Input Validation
+ ------
+Jesse Kuhnert
+ ------
+22 July 2006
+ ------
+
+Input Validation
+
+ The tapestry validation system provides a very powerful means of validating data
+ intuitively on most of the form element components, such as {{{../components/TextField.html}TextField}},
+ {{{../components/TextArea.html}TextArea}}, {{{../components/Checkbox.html}Checkbox}}, and so forth. All of these
+ components implement the interface {{{../tapestry-framework/apidocs/org/apache/tapestry/form/IFormComponent.html}IFormComponent}}
+ , and include the necessary hooks to fit into the overall validation framework.
+
+ Localization, server-side, and client side validation are handled by the framework,
+ as well as the ability to extend or override most of the built in functionality to
+ suit your purposes as you see fit.
+
+ Validation has evolved over time (the first attempt at proper validation using
+ Tapestry occured back in 2001). Through Tapestry 3, validation was limited to the
+ <<ValidField>> component (which is now deprecated). For Tapestry 4, the APIs related to
+ validation were effectively rewritten, resulting in a more powerful, more extensible approach
+ that can be used with all kinds of form element components.
+
+* FieldLabel component
+
+ Generally speaking, every form input component ({{{../components/TextField.html}TextField}}, etc.) will
+ be paired with a {{{../components/FieldLabel.html}FieldLabel}} component. The FieldLabel is responsible
+ for generating the HTML \<label\> element, which is extremely effective for accessible user
+ interfaces (user interfaces that work for people with visual disabilities). Typical usage:
+
++------------------------------------------
+<tr>
+ <td><label jwcid="@FieldLabel" field="component:userName">User Name</label></td>
+ <td><input jwcid="userName@TextField" value="ognl:userName" validators="validators:required"
+ displayName="User Name" size="30"/>
+</tr>
++------------------------------------------
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/asset/AssetService.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/asset/AssetService.java?rev=424671&r1=424670&r2=424671&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/asset/AssetService.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/asset/AssetService.java Sat Jul 22 21:32:02 2006
@@ -31,6 +31,7 @@
import javax.servlet.http.HttpServletResponse;
+import org.apache.commons.io.FilenameUtils;
import org.apache.hivemind.ApplicationRuntimeException;
import org.apache.hivemind.ClassResolver;
import org.apache.hivemind.util.Defense;
@@ -241,7 +242,7 @@
return;
}
- URL resourceURL = _classResolver.getResource(translateCssPath(path));
+ URL resourceURL = _classResolver.getResource(FilenameUtils.normalize(translateCssPath(path)));
if (resourceURL == null)
throw new ApplicationRuntimeException(AssetMessages.noSuchResource(path));
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/core.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/core.js?rev=424671&r1=424670&r2=424671&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/core.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/core.js Sat Jul 22 21:32:02 2006
@@ -9,6 +9,8 @@
dojo.require("dojo.widget.Dialog");
dojo.require("dojo.html");
+dojo.require("tapestry.html");
+
tapestry={
version:"4.1", // tapestry script version
@@ -225,4 +227,4 @@
}
}
-dojo.require("tapestry.html");
\ No newline at end of file
+// dojo.require("tapestry.html");