Github user svenmeier commented on a diff in the pull request:
https://github.com/apache/wicket/pull/151#discussion_r48427293
--- Diff:
wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/AjaxLazyLoadPanel.java
---
@@ -139,56 +182,176 @@ protected void handleCallbackScript(final
IHeaderResponse response,
@Override
protected void onBeforeRender()
{
- if (state == 0)
+ if (state == LoadingState.WAITING_FOR_LAZY_COMPONENT)
{
add(getLoadingComponent(LAZY_LOAD_COMPONENT_ID));
- setState((byte)1);
+ setState(LoadingState.REPLACING_LAZY_COMPONENT);
}
super.onBeforeRender();
}
+ @Override
+ public void onEvent(IEvent<?> event)
+ {
+ super.onEvent(event);
+
+ if (state == LoadingState.REPLACING_LAZY_COMPONENT)
--- End diff --
Shouldn't #onEvent() check for a specific event? If other events are sent
through the component hierarchy (e.g. when any other Ajax request is
processed), the lazy component might be replaced prematurely.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---