[ 
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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to