No Page found for component in AjaxRequestTarget.detach()
---------------------------------------------------------

                 Key: WICKET-1073
                 URL: https://issues.apache.org/jira/browse/WICKET-1073
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.3.0-beta4
            Reporter: Matt Clark


Please see the scenario below, entered per Matej's request.  I'm not 100% sure 
I'm not doing something invalid by having a component add its ancestor to the 
AjaxRequestTarget, but in my scenario the child doesn't necessarily know the 
ancestor is eventually going to be added to the target.  If Wicket as able to 
handle the scenario where we can add components to the target without knowing 
whether component being added will later be removed from the page hierarchy, 
that would make it easier to have multiple components on a page tied to a 
common model updated via Ajax.

http://www.nabble.com/forum/ViewPost.jtp?post=13191716&framed=y

* Assume the following hierarchy:

Page
 - Panel
   - RefreshingView
     - ComponentA

* ComponentA receives an Ajax event (onClick(AjaxRequestTarget))
* ComponentA eventually adds Panel to the AjaxRequestTarget
* Refreshing view is re-rendered as a part of the ajax request cycle, 
generating a ComponentA(prime).  Original ComponentA is now no longer a part of 
the page hierarchy.
* During the detach phase, the following code in AjaxRequestTarget is called:
  // detach the page if it was updated
  if (markupIdToComponent.size() > 0)
  {
        final Component component = 
(Component)markupIdToComponent.values().iterator().next();
        component.getPage().detach();
  }
* The object which comes out of the list (iterator().next()) appears to be 
ComponentA, which is no longer in the page hierarchy.  Therefore 
component.getPage() fails with "No page found for component" 

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

Reply via email to