You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "bernard (JIRA)" <ji...@apache.org> on 2013/08/20 11:31:52 UTC

[jira] [Commented] (WICKET-5068) PageParameters missing from re-created Page

    [ https://issues.apache.org/jira/browse/WICKET-5068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13744813#comment-13744813 ] 

bernard commented on WICKET-5068:
---------------------------------

I am proposing that the very useful concept of the setting org.apache.wicket.settings.IPageSettings#getRecreateMountedPagesAfterExpiry() is extended to a finer grained component level, covering PageParameters.

More specifically, the default on page level should be inherited from the global setting above to be effective. This should be overridable on component level. In the case of a boolean true value, this means that a stateful page, e.g. stateful because of some trivial AJAX behavior like an auto-complete field, can be recreated as required unless the page class overrides this default with false.

Then it gets more interesting:

Descending the component hierarchy below Page level the default for behavior invocation should be false, but each component should be able to choose whether to override this with true, whether it is stateless or not. Components below page level that are target of such parameters would by default not receive them unless they choose to do so.

I am proposing a method name

public boolean canBehaveAfterExpiry()

The return value is NOT propagated down the component hierarchy.

I think that this scheme simplifies things quite a bit. In the most trivial case, it would allow a logout link on a stateful page to execute its behavior. Which is currently prevented even for a stateless link in ListenerInterfaceRequestHandler#respond() because it makes a very expensive effort to search all components in the page to find stateful ones and if it does then it skips execution. This goes as far as invoking any of the page life cycle methods e.g. onBeforeRender() to detect stateful components added to the page late.

This scheme from my limited perspective seems to be logically clean because it works on component level.

I have had to code some messy page constructors that detect the expiry situation and do not add the AJAX components to the page at all just to get the link behaviors executed by fooling ListenerInterfaceRequestHandler#respond(). With this I want to say that sometimes Wicket tries to protect us from things that we know will never happen - in this case the page does not even need to be rendered.

                
> PageParameters missing from re-created Page
> -------------------------------------------
>
>                 Key: WICKET-5068
>                 URL: https://issues.apache.org/jira/browse/WICKET-5068
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 6.4.0
>         Environment: All
>            Reporter: bernard
>         Attachments: wicket-5068.patch
>
>
> WICKET-4594 removes existing PageParameters when re-creating an expired page.
> It does this under the assumption that the parameters are not needed for callback behavior that must not be executed after expiry.
> However PageParameters are needed even without execution of callback behavior.
> In trivial cases, a page cannot be re-constructed successfully without PageParameters e.g. a view page for a customer order needs the order ID from its PageParameters.
> There is a bit of an irony about this. To improve the recovery behavior, i.e. to avoid the dreaded PageExpiryException, one needs to create some client state which is then lost on re-creation after expiry.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira