You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2021/02/25 18:19:00 UTC
[jira] [Commented] (WICKET-6871) Exception with nested
AjaxLazyLoadPanel
[ https://issues.apache.org/jira/browse/WICKET-6871?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17291108#comment-17291108 ]
ASF subversion and git services commented on WICKET-6871:
---------------------------------------------------------
Commit c6f7afda7944be6482a67b84bf31502148b7a9e6 in wicket's branch refs/heads/wicket-8.x from Sven Meier
[ https://gitbox.apache.org/repos/asf?p=wicket.git;h=c6f7afd ]
WICKET-6871 isLoaded() might be called before rendering
on nested lazy panels
> Exception with nested AjaxLazyLoadPanel
> ---------------------------------------
>
> Key: WICKET-6871
> URL: https://issues.apache.org/jira/browse/WICKET-6871
> Project: Wicket
> Issue Type: Bug
> Components: wicket-extensions
> Affects Versions: 9.2.0
> Reporter: Sebastian Frömel
> Priority: Major
>
> Since our upgrade from wicket 6 to 9, we found the following bug:
> If you nest two (or more?) AjaxLazyLoadPanel you will get a
> {code:java}
> org.apache.wicket.WicketRuntimeException: Cannot replace a component which has not been added: id='content', component=[Component id = content]:
> [AjaxLazyLoadPanel [Component id = innerPanel2]]
> at org.apache.wicket.MarkupContainer.replace(MarkupContainer.java:849) ~[wicket-core-9.2.0.jar:9.2.0]
> at org.apache.wicket.extensions.ajax.markup.html.AjaxLazyLoadPanel.isLoaded(AjaxLazyLoadPanel.java:214) ~[wicket-extensions-9.2.0.jar:9.2.0]
> at org.apache.wicket.extensions.ajax.markup.html.AjaxLazyLoadPanel$AjaxLazyLoadTimer$1.component(AjaxLazyLoadPanel.java:260) ~[wicket-extensions-9.2.0.jar:9.2.0]
> at org.apache.wicket.extensions.ajax.markup.html.AjaxLazyLoadPanel$AjaxLazyLoadTimer$1.component(AjaxLazyLoadPanel.java:256) ~[wicket-extensions-9.2.0.jar:9.2.0]
> at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144) ~[wicket-util-9.2.0.jar:9.2.0
> {code}
>
> Here is portion of the code I used to verify the bug:
>
> {code:java}
> public class TestPage extends BasePage {
> public TestPage() {
> add(new AjaxLazyLoadPanel<Panel>("panel1") {
> @Override
> public Panel getLazyLoadComponent(String markupId) {
> return new InnerPanel(markupId);
> }
> });
> }
> }
> class InnerPanel extends Panel {
> /**
> * @param id
> */
> public InnerPanel(String id) {
> super(id);
> add(new AjaxLazyLoadPanel<Label>("innerPanel2") {
> @Override
> public Label getLazyLoadComponent(String markupId) {
> return new Label(markupId, "later load text");
> }
> });
> }
>
> }
> {code}
>
> TestPage -> AjaxLazyLoadPanel -> InnerPanel -> AjaxLazyLoadPanel -> Label
> After some investigation it looks like *onConfigure()* is not called on the inner AjaxLazyLoadPanel.
>
> I know that is maybe makes no sense for the most use-cases of AjaxLazyLoadPanel to have nested panels, and we were able to remove one layer, but this is maybe something to consider anyway.
> I could think of data which loaded within 2-5 seconds on the first panel and other data which could take 10 or more seconds on the more deeper panels.
> But anyway, thanks for reading, and maybe this will find its way into a bugfix :)
> Best,
> Sebastian
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)