Author: jkuhnert
Date: Wed Nov 29 10:24:25 2006
New Revision: 480667

URL: http://svn.apache.org/viewvc?view=rev&rev=480667
Log:
Improved MaskEdit component by not making it write a hidden form field. (no 
idea why it was doing that). 

Also added small example to documentation.

Modified:
    
tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/form/MaskEdit.html
    
tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/form/MaskEdit.js
    
tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/form/MaskEdit.jwc
    
tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/form/MaskEdit.script
    
tapestry/tapestry4/trunk/tapestry-contrib/src/site/xdoc/componentreference/maskedit.xml
    tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/context/Fields.html
    
tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/context/FieldsResults.html
    
tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/context/WEB-INF/Fields.page

Modified: 
tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/form/MaskEdit.html
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/form/MaskEdit.html?view=diff&rev=480667&r1=480666&r2=480667
==============================================================================
--- 
tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/form/MaskEdit.html
 (original)
+++ 
tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/form/MaskEdit.html
 Wed Nov 29 10:24:25 2006
@@ -1,5 +1,2 @@
 <input jwcid="maskEdit" type="text"/>
-<input jwcid="maskValue" type="hidden"/>
 <span jwcid="maskEditScript"/>
-
-

Modified: 
tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/form/MaskEdit.js
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/form/MaskEdit.js?view=diff&rev=480667&r1=480666&r2=480667
==============================================================================
Binary files - no diff available.

Modified: 
tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/form/MaskEdit.jwc
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/form/MaskEdit.jwc?view=diff&rev=480667&r1=480666&r2=480667
==============================================================================
--- 
tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/form/MaskEdit.jwc
 (original)
+++ 
tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/form/MaskEdit.jwc
 Wed Nov 29 10:24:25 2006
@@ -21,7 +21,7 @@
 
 <component-specification class="org.apache.tapestry.contrib.form.MaskEdit" 
allow-informal-parameters="no">
 
-  <parameter name="mask"/>
+  <parameter name="mask" required="yes" />
   <parameter name="value" required="yes"/>
   <parameter name="disabled"/>
   
@@ -32,15 +32,10 @@
     <binding name="disabled" value="ognl:disabled"/>
   </component>
 
-  <component id="maskValue" type="Hidden">
-    <binding name="value" value="ognl:mask"/>
-    <binding name="encode" value="false"/>
-  </component>
-
   <component id="maskEditScript" type="Script">
     <binding name="maskEdit" value="ognl:components.maskEdit"/>
-    <binding name="maskValue" value="ognl:components.maskValue"/>
+    <binding name="maskValue" value="mask"/>
     <binding name="script" value="literal:MaskEdit.script"/>
   </component>
-        
+  
 </component-specification>

Modified: 
tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/form/MaskEdit.script
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/form/MaskEdit.script?view=diff&rev=480667&r1=480666&r2=480667
==============================================================================
Binary files - no diff available.

Modified: 
tapestry/tapestry4/trunk/tapestry-contrib/src/site/xdoc/componentreference/maskedit.xml
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-contrib/src/site/xdoc/componentreference/maskedit.xml?view=diff&rev=480667&r1=480666&r2=480667
==============================================================================
--- 
tapestry/tapestry4/trunk/tapestry-contrib/src/site/xdoc/componentreference/maskedit.xml
 (original)
+++ 
tapestry/tapestry4/trunk/tapestry-contrib/src/site/xdoc/componentreference/maskedit.xml
 Wed Nov 29 10:24:25 2006
@@ -84,8 +84,8 @@
                     <tr>
                         <td>mask</td>
                         <td>string</td>
-                        <td>no</td>
-                        <td> </td>
+                        <td>yes</td>
+                        <td></td>
                         <td>See above.</td>
                     </tr>
                     <tr>
@@ -125,7 +125,22 @@
                 </p>
 
             </subsection>
+            
+            
+            <subsection name="Example">
+                
+                <p>Example of a masked US phone number input field:</p>
+
+<source><![CDATA[
+
+<label for="phone" accessKey="p">Phone</label>
+<input jwcid="[EMAIL PROTECTED]:MaskEdit" value="ognl:phoneInput" 
+    mask="literal:(###) ###-####" />
 
+]]></source>
+                
+            </subsection>
+            
         </section>
 
     </body>

Modified: 
tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/context/Fields.html
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/context/Fields.html?view=diff&rev=480667&r1=480666&r2=480667
==============================================================================
--- 
tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/context/Fields.html 
(original)
+++ 
tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/context/Fields.html 
Wed Nov 29 10:24:25 2006
@@ -69,8 +69,7 @@
 
   <tr>
        <td></td>
-       <td><input jwcid="[EMAIL PROTECTED]" async="true" 
listener="listener:testSubmi"
-                       image="asset:continue"/></td>
+       <td><input jwcid="[EMAIL PROTECTED]" image="asset:continue"/></td>
   </tr>
 
   <tr>

Modified: 
tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/context/FieldsResults.html
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/context/FieldsResults.html?view=diff&rev=480667&r1=480666&r2=480667
==============================================================================
--- 
tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/context/FieldsResults.html
 (original)
+++ 
tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/context/FieldsResults.html
 Wed Nov 29 10:24:25 2006
@@ -40,12 +40,17 @@
                <th>Email Value</th>
                <td><span jwcid="@Insert" value="ognl:visit.emailValue"/></td>
        </tr>
-
+       
   <tr>
     <th>Zip Code</th>
     <td><span jwcid="@Insert" value="ognl:visit.zipCode"/></td>
   </tr>
-  
+       
+       <tr>
+               <th>Phone Value</th>
+               <td><span jwcid="@Insert" value="ognl:visit.phone"/></td>
+       </tr>
+       
        <tr>
                <th>Text Value</th>
                <td><span jwcid="@Insert" value="ognl:visit.textValue"/></td>

Modified: 
tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/context/WEB-INF/Fields.page
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/context/WEB-INF/Fields.page?view=diff&rev=480667&r1=480666&r2=480667
==============================================================================
--- 
tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/context/WEB-INF/Fields.page
 (original)
+++ 
tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/context/WEB-INF/Fields.page
 Wed Nov 29 10:24:25 2006
@@ -102,7 +102,7 @@
   
   <component id="phone" type="contrib:MaskEdit">
     <binding name="value" value="visit.phone"/>
-    <binding name="mask" value="ognl:mask"/>
+    <binding name="mask" value="literal:(###) ###-####"/>
   </component>
   
   <component id="textArea" type="TextArea">


Reply via email to