[jira] [Closed] (TAP5-1527) BeanEditForm loses object found by onPrepare() during render

2011-06-20 Thread Igor Drobiazko (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-1527?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Igor Drobiazko closed TAP5-1527.


   Resolution: Fixed
Fix Version/s: 5.3.0

 BeanEditForm loses object found by onPrepare() during render
 

 Key: TAP5-1527
 URL: https://issues.apache.org/jira/browse/TAP5-1527
 Project: Tapestry 5
  Issue Type: Bug
  Components: tapestry-core
Affects Versions: 5.2.5
Reporter: Geoff Callender
Assignee: Igor Drobiazko
Priority: Critical
 Fix For: 5.3.0


 Was fine in 5.1.0.5, discovered when upgrading to 5.2.5.
 Using a BeanEditForm to edit an object: onPrepare() is being called twice (!) 
 during the render phase, and then the object found in onPrepare() disappears!
   http://jumpstart.doublenegative.com.au/jumpstart/examples/input/edit1/1
 Yet, when you replace BeanEditForm with a Form around a BeanEditor, 
 everything works correctly: onPrepare() is called once during the render 
 phase and the object doesn't disappear:
   
 http://jumpstart.doublenegative.com.au/jumpstart/examples/input/morecontroledit1/1
 You can see the java code is almost identical in the two examples but the 
 result is different.
 For more discussion see 
 http://tapestry.1045711.n5.nabble.com/BeanEditForm-What-s-happening-to-my-object-parameter-tt4257173.html#none
  .

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira




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/tapestry

2011-06-20 Thread drobiazko
Author: drobiazko
Date: Mon Jun 20 19:45:37 2011
New Revision: 1137756

URL: http://svn.apache.org/viewvc?rev=1137756view=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=1137756r1=1137755r2=1137756view=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=1137756r1=1137755r2=1137756view=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=1137756view=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=1137756r1=1137755r2=1137756view=diff

[jira] [Assigned] (TAP5-71) Add a Tree component in corelib

2011-06-20 Thread Igor Drobiazko (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-71?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Igor Drobiazko reassigned TAP5-71:
--

Assignee: Howard M. Lewis Ship

 Add a Tree component in corelib
 ---

 Key: TAP5-71
 URL: https://issues.apache.org/jira/browse/TAP5-71
 Project: Tapestry 5
  Issue Type: New Feature
Affects Versions: 5.0.15
Reporter: Francois Armand
Assignee: Howard M. Lewis Ship
 Fix For: 5.3.0


 There is no recursion available for template, and one of the most common use 
 case of recursion is tree structure traversal.
 it would be _great_ if the core component library include a Tree component.
 I have an example tree component here :
 http://svn.forge.objectweb.org/cgi-bin/viewcvs.cgi/interldap/interldap-wui-t5/trunk/src/main/java/org/interldap/wui/tapestry/components/Tree.java?view=markuprev=97
 And an example of use :
 http://svn.forge.objectweb.org/cgi-bin/viewcvs.cgi/interldap/interldap-wui-t5/trunk/src/t5-test/resources/org/interldap/wui/tapestry/pages/TestTree.html?view=markuprev=139
 Basically, the component take a DefaultMutableTreeNode as parameter and print 
 it in a preorder traversal, and one can specify a (unique) html element as a 
 level separator. But this component remains really simple and limited.
 Moreover, as I'm a beginner with Tapestry, it could be totally not idiomatic 
 of the framework use (I try to base my implementation on loop component).
 But it handles the most important functional requirement I want to see for 
 this component.
 So, that is my (very basic) wish list for a tree component :
 - the component traverse a Tree given in parameter
   * DefaultMutableTreeNode may be used for the Java representation for the 
 tree ;
   * let the possibility to configure the traversal order, preorder is a good 
 default ;
 - each iteration gives access to the current node ;
 - the body render for each ieration is free (as in loop) ;
 - level can be decorated (a tag or list of tag open before the level, 
 closed after) ;
 There is surely others things to add ;)
 hope it will gives you other ideas !
 Francois

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Closed] (TAP5-71) Add a Tree component in corelib

2011-06-20 Thread Igor Drobiazko (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-71?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Igor Drobiazko closed TAP5-71.
--

   Resolution: Fixed
Fix Version/s: 5.3.0

 Add a Tree component in corelib
 ---

 Key: TAP5-71
 URL: https://issues.apache.org/jira/browse/TAP5-71
 Project: Tapestry 5
  Issue Type: New Feature
Affects Versions: 5.0.15
Reporter: Francois Armand
Assignee: Howard M. Lewis Ship
 Fix For: 5.3.0


 There is no recursion available for template, and one of the most common use 
 case of recursion is tree structure traversal.
 it would be _great_ if the core component library include a Tree component.
 I have an example tree component here :
 http://svn.forge.objectweb.org/cgi-bin/viewcvs.cgi/interldap/interldap-wui-t5/trunk/src/main/java/org/interldap/wui/tapestry/components/Tree.java?view=markuprev=97
 And an example of use :
 http://svn.forge.objectweb.org/cgi-bin/viewcvs.cgi/interldap/interldap-wui-t5/trunk/src/t5-test/resources/org/interldap/wui/tapestry/pages/TestTree.html?view=markuprev=139
 Basically, the component take a DefaultMutableTreeNode as parameter and print 
 it in a preorder traversal, and one can specify a (unique) html element as a 
 level separator. But this component remains really simple and limited.
 Moreover, as I'm a beginner with Tapestry, it could be totally not idiomatic 
 of the framework use (I try to base my implementation on loop component).
 But it handles the most important functional requirement I want to see for 
 this component.
 So, that is my (very basic) wish list for a tree component :
 - the component traverse a Tree given in parameter
   * DefaultMutableTreeNode may be used for the Java representation for the 
 tree ;
   * let the possibility to configure the traversal order, preorder is a good 
 default ;
 - each iteration gives access to the current node ;
 - the body render for each ieration is free (as in loop) ;
 - level can be decorated (a tag or list of tag open before the level, 
 closed after) ;
 There is surely others things to add ;)
 hope it will gives you other ideas !
 Francois

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Assigned] (TAP5-1451) Form component should indicate that a form submission was canceled on the client side

2011-06-20 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-1451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship reassigned TAP5-1451:
--

Assignee: Howard M. Lewis Ship

 Form component should indicate that a form submission was canceled on the 
 client side
 -

 Key: TAP5-1451
 URL: https://issues.apache.org/jira/browse/TAP5-1451
 Project: Tapestry 5
  Issue Type: Improvement
  Components: tapestry-core
Affects Versions: 5.2.4
Reporter: Howard M. Lewis Ship
Assignee: Howard M. Lewis Ship

 Although it is possible to determine that a form has been cancelled by 
 providing a listener to the appropriate Submit/LinkSubmit component, that 
 will often occur after other parts of the form have resulted in updates to 
 server-side properties. That may be valid is some circumstances, but it would 
 be nice if there was an early event notification from the Form that indicated 
 a client-side cancel so that the processing of the form's data could be 
 avoided entirely. That is the more general case: no updates to anything on 
 the server side when a client-side form is canceled ... but there is not 
 currently a simple way to determine this.
 What's needed is a special parameter included in the form submission to 
 indicate that the form was cancelled.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira