Revision history [back]

click to hide/show revision 1
initial version

asked 2019-07-01 16:01:38 +0800

JustinFrost gravatar image JustinFrost

Does component.getChildren().clear() remove event listenters

I am creating a bunch of components dynamically in java - add manually creating event listeners for them as follows:

Idspace linkWrapper = new Idspace();
linkWrapper.setSclass("link-wrapper");

Button linkButton = new Button();
linkButton.addEventListener(Events.ON_CLICK, new org.zkoss.zk.ui.event.EventListener() {
    @Override
    public void onEvent(Event event) throws Exception {
    ...
    }
});
linkWrapper.appendChild(linkButton);

Do I have to remove all of the event listeners for these buttons manually or will

linkWapper.getChildren().clear()

remove all of the event listeners for me ?

Does component.getChildren().clear() remove event listenterslisteners

I am creating a bunch of components dynamically in java - add manually creating event listeners for them as follows:

Idspace linkWrapper = new Idspace();
linkWrapper.setSclass("link-wrapper");

Button linkButton = new Button();
linkButton.addEventListener(Events.ON_CLICK, new org.zkoss.zk.ui.event.EventListener() {
    @Override
    public void onEvent(Event event) throws Exception {
    ...
    }
});
linkWrapper.appendChild(linkButton);

Do I have to remove all of the event listeners for these buttons manually or will

linkWapper.getChildren().clear()

remove all of the event listeners for me ?

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More