You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by dr...@apache.org on 2011/06/20 21:45:37 UTC
svn commit: r1137756 - in /tapestry/tapestry5/trunk/tapestry-core/src:
main/java/org/apache/tapestry5/corelib/components/
test/java/org/apache/tapestry5/integration/app1/
test/java/org/apache/tapestry5/integration/app1/pages/
test/resources/org/apache/...
Author: drobiazko
Date: Mon Jun 20 19:45:37 2011
New Revision: 1137756
URL: http://svn.apache.org/viewvc?rev=1137756&view=rev
Log:
TAP5-1527: BeanEditForm's prepare event handler aborts Form's prepare event when re-triggering it.
Added:
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/BeanEditFormPrepareBubbling.java (with props)
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/BeanEditFormPrepareBubbling.tml
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/BeanEditForm.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/BeanEditorTests.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.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=1137756&r1=1137755&r2=1137756&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 Jun 20 19:45:37 2011
@@ -151,7 +151,7 @@ public class BeanEditForm implements Cli
@Environmental
private TrackableComponentEventCallback eventCallback;
- void onPrepareFromForm()
+ boolean onPrepareFromForm()
{
resources.triggerEvent(EventConstants.PREPARE, null, null);
@@ -163,6 +163,8 @@ public class BeanEditForm implements Cli
BeanModelUtils.modify(model, add, include, exclude, reorder);
}
+
+ return true;
}
/**
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/BeanEditorTests.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/BeanEditorTests.java?rev=1137756&r1=1137755&r2=1137756&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/BeanEditorTests.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/BeanEditorTests.java Mon Jun 20 19:45:37 2011
@@ -206,4 +206,17 @@ public class BeanEditorTests extends Tap
assertText("//dd[2]", "Ultra Important");
}
+
+ /** TAP5-1527 */
+ public void bean_editor_prepare_bubbling()
+ {
+ openLinks("BeanEditor Prepare Bubbling Demo");
+
+ type("name", "abcdef");
+ type("age", "10");
+
+ clickAndWait(SUBMIT);
+
+ assertTextPresent("Name: abcdef", "Age: 10");
+ }
}
Added: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/BeanEditFormPrepareBubbling.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/BeanEditFormPrepareBubbling.java?rev=1137756&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/BeanEditFormPrepareBubbling.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/BeanEditFormPrepareBubbling.java Mon Jun 20 19:45:37 2011
@@ -0,0 +1,22 @@
+package org.apache.tapestry5.integration.app1.pages;
+
+import org.apache.tapestry5.annotations.Persist;
+import org.apache.tapestry5.annotations.Property;
+import org.apache.tapestry5.integration.app1.data.Person;
+
+public class BeanEditFormPrepareBubbling
+{
+ @Property
+ @Persist
+ private Person person;
+
+ private boolean eventHandled;
+
+ void onPrepare()
+ {
+ if(eventHandled)
+ throw new IllegalStateException("Illegal event handler invocation. The 'prepare' event has been already handled");
+
+ eventHandled = true;
+ }
+}
Propchange: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/BeanEditFormPrepareBubbling.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java?rev=1137756&r1=1137755&r2=1137756&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java Mon Jun 20 19:45:37 2011
@@ -474,8 +474,9 @@ public class Index
new Item("LinkQueryParameters", "Link Query Parameters Demo",
"Providing Query Parameters directly to link components as a map of key=parameter name, value=parameter values") ,
- new Item("ChecklistDemo", "Checklist Demo",
- "Use Checklist component")
+ new Item("ChecklistDemo", "Checklist Demo", "Use Checklist component") ,
+
+ new Item("BeanEditFormPrepareBubbling", "BeanEditor Prepare Bubbling Demo", "Prepare event bubbling")
);
Added: tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/BeanEditFormPrepareBubbling.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/BeanEditFormPrepareBubbling.tml?rev=1137756&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/BeanEditFormPrepareBubbling.tml (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/BeanEditFormPrepareBubbling.tml Mon Jun 20 19:45:37 2011
@@ -0,0 +1,6 @@
+<html t:type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
+ <form t:id="foo" t:type="beaneditform" object="person"/>
+
+ <p>Name: ${person.name}</p>
+ <p>Age: ${person.age}</p>
+</html>