You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by svenmeier <gi...@git.apache.org> on 2018/12/01 20:28:27 UTC

[GitHub] wicket pull request #342: Wicket 6616 always render new pages

GitHub user svenmeier opened a pull request:

    https://github.com/apache/wicket/pull/342

    Wicket 6616 always render new pages

    Question: Should Wicket always render new pages before any component in it is accessed?
    
      * until 8.1.0
        * components can be accessed **un-rendered** when already inside the page hierarchy
        * then the page is prepared for render
        * any component added in onInitialize() or onBeforeRender() can be accessed **rendered**
      * since 8.2.0 (WICKET-6608)
        * components can be accessed **un-rendered** when already inside the page hierarchy
        * then the page is initialized
        * any component added in onInitialize()  (e.g. through queueing) can be accessed **rendered**
        * then the page is prepared for render
        * any component added in onBeforeRender() can be accessed **rendered**
    
    IMHO all these cases should allow access to **rendered** component only.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/wicket WICKET-6616-render-new-pages

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/wicket/pull/342.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #342
    
----
commit 7b2bb1162dd80e6faab9fb9f0fc30c0d153a4bd2
Author: Sven Meier <sv...@...>
Date:   2018-11-30T15:10:18Z

    Revert "WICKET-6608 Stateless page, mix of queue and add can cause unforseen"
    
    This reverts commit 61c8709389cea30975814530f53dd0ae1f1ea592.

commit a446138852fe1748ff879d85bced1b19f8af444e
Author: Sven Meier <sv...@...>
Date:   2018-11-30T15:10:21Z

    Revert "WICKET-6608 added test case"
    
    This reverts commit 86f92fc8cfaf4ec15409908455d049f9466c542e.

commit 557115433e3485fc6ab50607ae930ff46c14c80a
Author: Sven Meier <sv...@...>
Date:   2018-12-01T20:14:40Z

    WICKET-6616 always render new pages

----


---

[GitHub] wicket issue #342: Wicket 6616 always render new pages

Posted by svenmeier <gi...@git.apache.org>.
Github user svenmeier commented on the issue:

    https://github.com/apache/wicket/pull/342
  
    This needs a thorough discussion of a solution for 9.x.


---

[GitHub] wicket issue #342: Wicket 6616 always render new pages

Posted by svenmeier <gi...@git.apache.org>.
Github user svenmeier commented on the issue:

    https://github.com/apache/wicket/pull/342
  
    >Components like FeddbackPanel can not work properly anymore.
    That's not the case - feedbackPanels are explicitly not prepared for render.
    
    I'm not sure using a new page instance is right either: the developer might want to keep some state during a single request. Your commit results int all feedback messages getting lost, doesn't it?


---

[GitHub] wicket issue #342: Wicket 6616 always render new pages

Posted by svenmeier <gi...@git.apache.org>.
Github user svenmeier commented on the issue:

    https://github.com/apache/wicket/pull/342
  
    Ok, you're right, that would be an improvement.
    IMHO this change is to big to introduce in a 8.x release though.
    
    I'd say we revert WICKET-6608 (which as is allows even more components to be accessed unprepared now) and try to find a better solution for 9.x.


---

[GitHub] wicket issue #342: Wicket 6616 always render new pages

Posted by bitstorm <gi...@git.apache.org>.
Github user bitstorm commented on the issue:

    https://github.com/apache/wicket/pull/342
  
    Sounds good to me


---

[GitHub] wicket pull request #342: Wicket 6616 always render new pages

Posted by svenmeier <gi...@git.apache.org>.
Github user svenmeier closed the pull request at:

    https://github.com/apache/wicket/pull/342


---

[GitHub] wicket issue #342: Wicket 6616 always render new pages

Posted by bitstorm <gi...@git.apache.org>.
Github user bitstorm commented on the issue:

    https://github.com/apache/wicket/pull/342
  
    @svenmeier sorry, what I said wasn't correct. By calling onDetach we don't discard the current page instance but we force configuration phase to be performed again before the actual rendering phase, so no information is lost. 
    I still think this can be an improvement because users expect onConfigure to be called before the actual rendering and after event/submission handling.


---

[GitHub] wicket issue #342: Wicket 6616 always render new pages

Posted by bitstorm <gi...@git.apache.org>.
Github user bitstorm commented on the issue:

    https://github.com/apache/wicket/pull/342
  
    @svenmeier  i agree with the overall goal of accessing to render components only. There is however a huge drawback with this solution as now onConfigure is executed before form validation or event handling. Components like FeddbackPanel can not work properly anymore. 
    To overcome this limit with stateless pages we can consider to use a brand new page instance for rendering phase. To achieve this result we can for example detach PageComponentProvider after we have invoked the required listener.
    I will commit this improvement as soon as possible.


---