Team,
I've been trying to debug deeper into this problem but I have to admit my
knowledge of wicket in this area is simply not deep enough yet
and I'm stuck at it.
Is someone else familiar enough with the PopupCloseLink feature?
The pagemap manipulation it tries to do is clearly broken, even with the
default REDIRECT_TO_BUFFER although it isn't noticed then.
I'd like to see this fixed to be able to support popup windows in a
portlet too for which I depend on REDIRECT_TO_RENDER.
Just to make this very clear: this is *not* a portlet environment problem,
it is broken in a "normal" servlet environment too.
So and idea's or help is very much appreciated.
Regards,
Ate
Ate Douma (JIRA) wrote:
PopupCloseLink broken with REDIRECT_TO_RENDER strategy
------------------------------------------------------
Key: WICKET-913
URL: https://issues.apache.org/jira/browse/WICKET-913
Project: Wicket
Issue Type: Bug
Components: wicket
Affects Versions: 1.3.0-beta3, 1.3.0-beta2
Reporter: Ate Douma
Priority: Critical
For portlet-support, the only usable render strategy is
REDIRECT_TO_RENDER until JSR-286 containers are available.
So, I'm testing wicket-examples with REDIRECT_TO_RENDER and I noticed
the PopupCloseLink in the linkomatic.Popup page example is broken then.
Note: this also doesn't work in a plain servlet environment either!
As far as I have been able to discover so far (but I'm not much of an
expert in this area), the PopupCloseLink#ClosePopupPage isn't properly
recorded in the PageMap when it is set as the responsePage in
PopupCloseLink.onClick().
The request url history from opening the PopupPage to after clicking the
close link is as follows:
- open popup :
/wicket-examples/linkomatic/wicket:bookmarkablePage=popuppagemap%3Aorg.apache.wicket.examples.linkomatic.Popup
- click close:
/wicket-examples/linkomatic/wicket:interface=popuppagemap:0:close::ILinkListener::
- redirect to:
/wicket-examples/linkomatic/wicket:interface=popuppagemap:0::::
==> Popup is rendered again
Somehow, removing the current page (Popup) in PopupCloseLink.onClick()
from its pagemap doesn't seem to work correctly and/or the #ClosePopupPage
isn't properly recorded in the pagemap when it is set as the response page.
With the default REDIRECT_TO_BUFFER, this problem doesn't surface as the
#ClosePopupPage is rendered (to buffer) immediately so it doesn't need to be
looked up in the pagemap after the subsequent redirect.
The weird thing is that if you close the the Popup page directly (not
through the "close" link) and thereafter open another instance of the Popup
page, everything works fine from then on.
Maybe this is an indication where the real problem might be, as these
subsequent Popup page instances now have a version > 0:
- click close:
/wicket-examples/linkomatic/wicket:interface=popuppagemap:1:close::ILinkListener::
- redirect to:
/wicket-examples/linkomatic/wicket:interface=popuppagemap:0::::
==> PopupCloseLink#ClosePopupPage is rendered (which contains <body
onLoad="javascript:self.close()">)
I also checked if this is a new problem since beta2, but it was broken
already then too.