You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "James Flagg (JIRA)" <ji...@apache.org> on 2014/04/09 17:52:14 UTC

[jira] [Comment Edited] (WICKET-5553) When using an Ajax request to display initially hidden components inside inline enclosures, only the first one appears.

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

James Flagg edited comment on WICKET-5553 at 4/9/14 3:50 PM:
-------------------------------------------------------------

Commit fa01402233fb56abc0709bcdc6f6a6c008a1abc7 adds the call to visit.stop on line 87 of AjaxEnclosureListener.  This stops visitation of any additional InlineEnclosure after the first match is found.  Thus, when multiple initially hidden components are inside inline enclosures, and more than one of these components becomes visible during a single Ajax Request, only one will actually become visible in the browser, and others will generate errors in the Ajax console.



was (Author: jamesflagg):
Commit fa01402233fb56abc0709bcdc6f6a6c008a1abc7 adds the call to visit.stop on line 87.  This stops visitation of any additional InlineEnclosure after the first match is found.  Thus, when multiple initially hidden components are inside inline enclosures, and more than one of these components becomes visible during a single Ajax Request, only one will actually become visible in the browser, and others will generate errors in the Ajax console.


> When using an Ajax request to display initially hidden components inside inline enclosures, only the first one appears.
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-5553
>                 URL: https://issues.apache.org/jira/browse/WICKET-5553
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 6.14.0
>         Environment: Windows, Java 7
>            Reporter: James Flagg
>         Attachments: TestAjaxWithMultipleInlineEnclosures.html, TestAjaxWithMultipleInlineEnclosures.java, wicket5553.zip
>
>
> Consider a simple page with an Ajax link and two initially hidden labels, each of which is inside its own inline enclosure.  Clicking the link makes the labels visible and adds each to the AjaxRequestTarget. 
> Here is the behavior I see:  Upon initial page render, each of the two labels is rendered as a hidden inline enclosure div.  This is correct.  But upon clicking the Ajax link, only the first label appears, and I get an AJAX DEBUG error indicating that the second label couldn't be found.
> I've isolated the issue.  In the class org.apache.wicket.protocol.http.AjaxEnclosureListener, there is a call to "visit.stop(key)".  This halts the entire visitation, and therefore only the first inline enclosure is added to the AjaxRequestTarget.
> The fix, IMO, would be to simply remove the current key from the map once an enclosure is added to the target.  Don't call stop, and get rid of the local variable "key" which limits the logic of AjaxEnclosureListener to a single enclosure.
> It was working for multiple enclosures prior to the checkin of 2013-08-06.



--
This message was sent by Atlassian JIRA
(v6.2#6252)