Author: mlusetti
Date: Fri Dec 9 08:39:36 2011
New Revision: 1212281
URL: http://svn.apache.org/viewvc?rev=1212281&view=rev
Log:
TAP5-1773 Add a new OverrideFieldFocus mixin which supersed and deprecate the
old one FormFieldFocus (merged from trunk)
Added:
tapestry/tapestry5/branches/5.3/tapestry-core/src/main/java/org/apache/tapestry5/corelib/mixins/OverrideFieldFocus.java
- copied unchanged from r1212270,
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/mixins/OverrideFieldFocus.java
tapestry/tapestry5/branches/5.3/tapestry-core/src/test/app1/OverrideFieldFocusDemo.tml
- copied unchanged from r1212270,
tapestry/tapestry5/trunk/tapestry-core/src/test/app1/OverrideFieldFocusDemo.tml
tapestry/tapestry5/branches/5.3/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/OverrideFieldFocusDemo.java
- copied unchanged from r1212270,
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/OverrideFieldFocusDemo.java
Modified:
tapestry/tapestry5/branches/5.3/ (props changed)
tapestry/tapestry5/branches/5.3/tapestry-core/src/main/java/org/apache/tapestry5/corelib/mixins/FormFieldFocus.java
tapestry/tapestry5/branches/5.3/tapestry-core/src/main/java/org/apache/tapestry5/services/DelegatingRequest.java
(props changed)
tapestry/tapestry5/branches/5.3/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/FormFieldFocusTest.groovy
tapestry/tapestry5/branches/5.3/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
Propchange: tapestry/tapestry5/branches/5.3/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 9 08:39:36 2011
@@ -2,3 +2,4 @@
/tapestry/tapestry5/branches/hlship-5.0-perf:726734-728728
/tapestry/tapestry5/tags/releases/5.0.17:719745
/tapestry/tapestry5/tags/releases/hlship-5.0-perf:726733
+/tapestry/tapestry5/trunk:1211947-1212270
Modified:
tapestry/tapestry5/branches/5.3/tapestry-core/src/main/java/org/apache/tapestry5/corelib/mixins/FormFieldFocus.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/main/java/org/apache/tapestry5/corelib/mixins/FormFieldFocus.java?rev=1212281&r1=1212280&r2=1212281&view=diff
==============================================================================
---
tapestry/tapestry5/branches/5.3/tapestry-core/src/main/java/org/apache/tapestry5/corelib/mixins/FormFieldFocus.java
(original)
+++
tapestry/tapestry5/branches/5.3/tapestry-core/src/main/java/org/apache/tapestry5/corelib/mixins/FormFieldFocus.java
Fri Dec 9 08:39:36 2011
@@ -34,8 +34,10 @@ import org.slf4j.Logger;
* This is meant to be used only with {@link
org.apache.tapestry5.corelib.components.Form} component.
*
* @since 5.3
+ * @deprecated As of release 5.4, replaced by {@link
org.apache.tapestry5.corelib.mixins.OverrideFieldFocus}
* @tapestrydoc
*/
+@Deprecated
public class FormFieldFocus
{
@Inject
@@ -61,9 +63,9 @@ public class FormFieldFocus
@AfterRender
void focusField()
{
- javascriptSupport.autofocus(FieldFocusPriority.OVERRIDE,
focusField.getControlName());
+ javascriptSupport.autofocus(FieldFocusPriority.OVERRIDE,
focusField.getClientId());
- logger.trace("Focus OVERRIDE done on field {}",
focusField.getControlName());
+ logger.trace("Focus OVERRIDE done on field {}",
focusField.getClientId());
}
}
Propchange:
tapestry/tapestry5/branches/5.3/tapestry-core/src/main/java/org/apache/tapestry5/services/DelegatingRequest.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 9 08:39:36 2011
@@ -0,0 +1 @@
+/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/DelegatingRequest.java:1211947-1212270
Modified:
tapestry/tapestry5/branches/5.3/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/FormFieldFocusTest.groovy
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/FormFieldFocusTest.groovy?rev=1212281&r1=1212280&r2=1212281&view=diff
==============================================================================
---
tapestry/tapestry5/branches/5.3/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/FormFieldFocusTest.groovy
(original)
+++
tapestry/tapestry5/branches/5.3/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/FormFieldFocusTest.groovy
Fri Dec 9 08:39:36 2011
@@ -19,14 +19,24 @@ import org.apache.tapestry5.integration.
import org.testng.annotations.Test
/**
- * Integration test to veryfiy {@link FormFieldFocusTest} mixin.
+ * Integration test to veryfiy {@link
com.gargoylesoftware.htmlunit.javascript.host.FormField}
+ * and {@link org.apache.tapestry5.corelib.mixins.OverrideFieldfocus} mixin.
*/
class FormFieldFocusTest extends TapestryCoreTestCase
{
@Test
void form_field_focus_mixin()
{
- openLinks "FormFieldFocus Demo"
+ openLinks "FormFieldFocus (DEPRECATED) Demo"
+
+ assertEquals getEval("window.document.activeElement.value"), "But I
got the focus!"
+
+ }
+
+ @Test
+ void override_field_focus_mixin()
+ {
+ openLinks "OverrideFieldFocus Demo"
assertEquals getEval("window.document.activeElement.value"), "But I
got the focus!"
Modified:
tapestry/tapestry5/branches/5.3/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java?rev=1212281&r1=1212280&r2=1212281&view=diff
==============================================================================
---
tapestry/tapestry5/branches/5.3/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
(original)
+++
tapestry/tapestry5/branches/5.3/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
Fri Dec 9 08:39:36 2011
@@ -508,9 +508,11 @@ public class Index
new Item("ExpressionInJsFunction", "Expressions in JS
Functions Demo", "Expressions can be used inside javascript functions"),
- new Item("FormFieldFocusDemo", "FormFieldFocus Demo",
"Setting the Form focus on a specific field"),
+ new Item("FormFieldFocusDemo", "FormFieldFocus
(DEPRECATED) Demo", "Setting the Form focus on a specific field"),
- new Item("FormFragmentExplicitVisibleBoundsDemo", "Form
Fragment Explicit Visible Bounds Demo", "Check for form fragment parent
visibility can be bounded to")
+ new Item("FormFragmentExplicitVisibleBoundsDemo", "Form
Fragment Explicit Visible Bounds Demo", "Check for form fragment parent
visibility can be bounded to"),
+
+ new Item("OverrideFieldFocusDemo", "OverrideFieldFocus
Demo", "Setting the focus in a form to a specific field")
);