You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2009/01/13 01:29:54 UTC

svn commit: r733971 - /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/BeanEditForm.java

Author: hlship
Date: Mon Jan 12 16:29:54 2009
New Revision: 733971

URL: http://svn.apache.org/viewvc?rev=733971&view=rev
Log:
TAP5-364: BeanEditForm should include the same autofocus parameter that Form has

Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/BeanEditForm.java

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/BeanEditForm.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/BeanEditForm.java?rev=733971&r1=733970&r2=733971&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/BeanEditForm.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/BeanEditForm.java Mon Jan 12 16:29:54 2009
@@ -1,4 +1,4 @@
-// Copyright 2007, 2008 The Apache Software Foundation
+// Copyright 2007, 2008, 2009 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -46,6 +46,15 @@
 public class BeanEditForm implements ClientElement, FormValidationControl
 {
     /**
+     * If true (the default), then the JavaScript will be added to position the cursor into the form. The field to
+     * receive focus is the first rendered field that is in error, or required, or present (in that order of priority).
+     *
+     * @see org.apache.tapestry5.corelib.components.Form#autofocus
+     */
+    @Parameter
+    private boolean autofocus;
+
+    /**
      * The text label for the submit button of the form, by default "Create/Update".
      */
     @Parameter(value = "message:submit-label", defaultPrefix = BindingConstants.LITERAL)
@@ -107,9 +116,10 @@
     @Parameter(defaultPrefix = BindingConstants.LITERAL)
     private String zone;
 
-    @Component(parameters = {"clientValidation=inherit:clientValidation",
+    @Component(parameters = { "clientValidation=inherit:clientValidation",
             "validationId=componentResources.id",
-            "zone=inherit:zone"})
+            "autofocus=inherit:autofocus",
+            "zone=inherit:zone" })
     private Form form;
 
     /**