topright gamedev
topright gamedev

Reputation: 2665

Wicket Panel destructor (Java)

Does Wicket notifies a Panel when this Panel is removed/replaced in the Page?

I add JavaScript (initialization code) in Panel's constructor and need to release some resources when Panel is removed.

Upvotes: 1

Views: 211

Answers (2)

martin-g
martin-g

Reputation: 17533

There is also PubSub system at the client side where you can do what you need. See https://cwiki.apache.org/confluence/display/WICKET/Wicket+Ajax#WicketAjax-GlobalAjaxcalllisteners and event '/dom/node/removing'.

Upvotes: 1

Artem Shafranov
Artem Shafranov

Reputation: 2673

Later versions of Wicket (1.4.0+) have Component#onRemove() method, which is needed to notify the component that it's being removed from the component hierarchy.

Upvotes: 2

Related Questions