You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Vjeran Marcinko (JIRA)" <de...@tapestry.apache.org> on 2008/07/11 07:53:32 UTC

[jira] Created: (TAPESTRY-2513) ValidationTracker input values should not be cleared before "succes" event

ValidationTracker input values should not be cleared before "succes" event
--------------------------------------------------------------------------

                 Key: TAPESTRY-2513
                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2513
             Project: Tapestry
          Issue Type: Improvement
          Components: tapestry-core
    Affects Versions: 5.0.13
            Reporter: Vjeran Marcinko


As far as I understand, "success" handler is used to call business method after all input values have been successfuly validated. Unfortunately, ValidationTracker's input values are cleared prior to this "success" event, and two cases come to my mind when this is undesirable, both of which are rendering same form page after submit.

1. Some validation cannot be executed prior to calling business method and checked exceptions are thrown when action fails. These failures have to be caught inside "success" handler and user should stay on same form page displaying error message. Naturally, all input values should be displayed.

2. Input validation passed successfuly, but user wants to stay on same page -  eg. displaying search results below search form. It is usually needed to see all those input values still there to let user know what search criteria he just entered.

My suggestion is to not clear input values ever. If user leaves the form page, input values will get lost then, since ValidationTracker has "flash" persistance strategy, so it's all good in that case. In some rare cases where user wants to stay on same form page, but clear those input values, he should do it explicitly by calling some ValidationTracker.clear() method or such.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAP5-182) ValidationTracker input values should not be cleared before "success" event

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12658726#action_12658726 ] 

Howard M. Lewis Ship commented on TAP5-182:
-------------------------------------------


Workaround; implement your logic inside the validateForm event handler.  Returning a navigational result (page class, page instance, etc.) will bypass the success, failure and submit event handlers (including the logic which clears the ValidationTracker).

> ValidationTracker input values should not be cleared before "success" event
> ---------------------------------------------------------------------------
>
>                 Key: TAP5-182
>                 URL: https://issues.apache.org/jira/browse/TAP5-182
>             Project: Tapestry 5
>          Issue Type: Improvement
>    Affects Versions: 5.0.15
>            Reporter: Vjeran Marcinko
>            Assignee: Howard M. Lewis Ship
>
> As far as I understand, "success" handler is used to call business method after all input values have been successfuly validated. Unfortunately, ValidationTracker's input values are cleared prior to this "success" event, and two cases come to my mind when this is undesirable, both of which are rendering same form page after submit.
> 1. Some validation cannot be executed prior to calling business method and checked exceptions are thrown when action fails. These failures have to be caught inside "success" handler and user should stay on same form page displaying error message. Naturally, all input values should be displayed.
> 2. Input validation passed successfuly, but user wants to stay on same page -  eg. displaying search results below search form. It is usually needed to see all those input values still there to let user know what search criteria he just entered.
> My suggestion is to not clear input values ever. If user leaves the form page, input values will get lost then, since ValidationTracker has "flash" persistance strategy, so it's all good in that case. In some rare cases where user wants to stay on same form page, but clear those input values, he should do it explicitly by calling some ValidationTracker.clear() method or such.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAPESTRY-2513) ValidationTracker input values should not be cleared before "succes" event

Posted by "Filip S. Adamsen (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-2513?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12612845#action_12612845 ] 

Filip S. Adamsen commented on TAPESTRY-2513:
--------------------------------------------

I'll second that.

I frequently have to persist my objects in my application because of this - would be nice if I didn't have to.

> ValidationTracker input values should not be cleared before "succes" event
> --------------------------------------------------------------------------
>
>                 Key: TAPESTRY-2513
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2513
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.0.13
>            Reporter: Vjeran Marcinko
>
> As far as I understand, "success" handler is used to call business method after all input values have been successfuly validated. Unfortunately, ValidationTracker's input values are cleared prior to this "success" event, and two cases come to my mind when this is undesirable, both of which are rendering same form page after submit.
> 1. Some validation cannot be executed prior to calling business method and checked exceptions are thrown when action fails. These failures have to be caught inside "success" handler and user should stay on same form page displaying error message. Naturally, all input values should be displayed.
> 2. Input validation passed successfuly, but user wants to stay on same page -  eg. displaying search results below search form. It is usually needed to see all those input values still there to let user know what search criteria he just entered.
> My suggestion is to not clear input values ever. If user leaves the form page, input values will get lost then, since ValidationTracker has "flash" persistance strategy, so it's all good in that case. In some rare cases where user wants to stay on same form page, but clear those input values, he should do it explicitly by calling some ValidationTracker.clear() method or such.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAP5-182) ValidationTracker input values should not be cleared before "success" event

Posted by "Vjeran Marcinko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12658753#action_12658753 ] 

Vjeran Marcinko commented on TAP5-182:
--------------------------------------

Yes, I'm currently using "validateForm" event handler, but it really feels as workaround. 

If implementation of this issue is problematic for some reason (eg. back-compatibility or somethig internal), I would suggest that this workaround be documented in T5 docs, something like -

"After form submits, use 'success' event handler to call business method when all input validation passed successfully, but if for some reason you need to stay on same page with form input fields shown (eg when business checked exception is handled), then use 'validateForm' and return navigational result to bypass input field clearing."

This would help T5 newbies to handle this frequent situation, though I guess it would lead to "this isn't the simpliest solution" feeling.


> ValidationTracker input values should not be cleared before "success" event
> ---------------------------------------------------------------------------
>
>                 Key: TAP5-182
>                 URL: https://issues.apache.org/jira/browse/TAP5-182
>             Project: Tapestry 5
>          Issue Type: Improvement
>    Affects Versions: 5.0.15
>            Reporter: Vjeran Marcinko
>            Assignee: Howard M. Lewis Ship
>
> As far as I understand, "success" handler is used to call business method after all input values have been successfuly validated. Unfortunately, ValidationTracker's input values are cleared prior to this "success" event, and two cases come to my mind when this is undesirable, both of which are rendering same form page after submit.
> 1. Some validation cannot be executed prior to calling business method and checked exceptions are thrown when action fails. These failures have to be caught inside "success" handler and user should stay on same form page displaying error message. Naturally, all input values should be displayed.
> 2. Input validation passed successfuly, but user wants to stay on same page -  eg. displaying search results below search form. It is usually needed to see all those input values still there to let user know what search criteria he just entered.
> My suggestion is to not clear input values ever. If user leaves the form page, input values will get lost then, since ValidationTracker has "flash" persistance strategy, so it's all good in that case. In some rare cases where user wants to stay on same form page, but clear those input values, he should do it explicitly by calling some ValidationTracker.clear() method or such.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Assigned: (TAP5-182) ValidationTracker input values should not be cleared before "succes" event

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-182?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

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

    Assignee: Howard M. Lewis Ship

> ValidationTracker input values should not be cleared before "succes" event
> --------------------------------------------------------------------------
>
>                 Key: TAP5-182
>                 URL: https://issues.apache.org/jira/browse/TAP5-182
>             Project: Tapestry 5
>          Issue Type: Improvement
>    Affects Versions: 5.0.15
>            Reporter: Vjeran Marcinko
>            Assignee: Howard M. Lewis Ship
>
> As far as I understand, "success" handler is used to call business method after all input values have been successfuly validated. Unfortunately, ValidationTracker's input values are cleared prior to this "success" event, and two cases come to my mind when this is undesirable, both of which are rendering same form page after submit.
> 1. Some validation cannot be executed prior to calling business method and checked exceptions are thrown when action fails. These failures have to be caught inside "success" handler and user should stay on same form page displaying error message. Naturally, all input values should be displayed.
> 2. Input validation passed successfuly, but user wants to stay on same page -  eg. displaying search results below search form. It is usually needed to see all those input values still there to let user know what search criteria he just entered.
> My suggestion is to not clear input values ever. If user leaves the form page, input values will get lost then, since ValidationTracker has "flash" persistance strategy, so it's all good in that case. In some rare cases where user wants to stay on same form page, but clear those input values, he should do it explicitly by calling some ValidationTracker.clear() method or such.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAPESTRY-2513) ValidationTracker input values should not be cleared before "succes" event

Posted by "Vjeran Marcinko (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-2513?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12612850#action_12612850 ] 

Vjeran Marcinko commented on TAPESTRY-2513:
-------------------------------------------

Like I said on user list, this persisting of objects in HttpSession between requests can be very tricky if these are hibernate-managed entities. 
With exception of Seam which is focused on that from the very beginning, conversational transactions that span mutliple pages are quite problematic in all web frameworks when dealing with state-persistent libraries (Hibernate, JPA ...).


> ValidationTracker input values should not be cleared before "succes" event
> --------------------------------------------------------------------------
>
>                 Key: TAPESTRY-2513
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2513
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.0.13
>            Reporter: Vjeran Marcinko
>
> As far as I understand, "success" handler is used to call business method after all input values have been successfuly validated. Unfortunately, ValidationTracker's input values are cleared prior to this "success" event, and two cases come to my mind when this is undesirable, both of which are rendering same form page after submit.
> 1. Some validation cannot be executed prior to calling business method and checked exceptions are thrown when action fails. These failures have to be caught inside "success" handler and user should stay on same form page displaying error message. Naturally, all input values should be displayed.
> 2. Input validation passed successfuly, but user wants to stay on same page -  eg. displaying search results below search form. It is usually needed to see all those input values still there to let user know what search criteria he just entered.
> My suggestion is to not clear input values ever. If user leaves the form page, input values will get lost then, since ValidationTracker has "flash" persistance strategy, so it's all good in that case. In some rare cases where user wants to stay on same form page, but clear those input values, he should do it explicitly by calling some ValidationTracker.clear() method or such.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Updated: (TAP5-182) ValidationTracker input values should not be cleared before "success" event

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-182?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship updated TAP5-182:
--------------------------------------

    Summary: ValidationTracker input values should not be cleared before "success" event  (was: ValidationTracker input values should not be cleared before "succes" event)

> ValidationTracker input values should not be cleared before "success" event
> ---------------------------------------------------------------------------
>
>                 Key: TAP5-182
>                 URL: https://issues.apache.org/jira/browse/TAP5-182
>             Project: Tapestry 5
>          Issue Type: Improvement
>    Affects Versions: 5.0.15
>            Reporter: Vjeran Marcinko
>            Assignee: Howard M. Lewis Ship
>
> As far as I understand, "success" handler is used to call business method after all input values have been successfuly validated. Unfortunately, ValidationTracker's input values are cleared prior to this "success" event, and two cases come to my mind when this is undesirable, both of which are rendering same form page after submit.
> 1. Some validation cannot be executed prior to calling business method and checked exceptions are thrown when action fails. These failures have to be caught inside "success" handler and user should stay on same form page displaying error message. Naturally, all input values should be displayed.
> 2. Input validation passed successfuly, but user wants to stay on same page -  eg. displaying search results below search form. It is usually needed to see all those input values still there to let user know what search criteria he just entered.
> My suggestion is to not clear input values ever. If user leaves the form page, input values will get lost then, since ValidationTracker has "flash" persistance strategy, so it's all good in that case. In some rare cases where user wants to stay on same form page, but clear those input values, he should do it explicitly by calling some ValidationTracker.clear() method or such.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org