-
Bug
-
Resolution: Fixed
-
Major
-
8.5.1.2
-
None
-
Security Level: Jimmy
-
None
-
ZK 8.6.0 S1
-
None
Steps to Reproduce
http://zkfiddle.org/sample/1pgc3tp/5-zk-listmodel-listdataListener-not-cleaned-on-destroy
run fiddle
add radiogroup (click on toggle button)
select radio A
toggle the element attached and detached twice (4 clicks on toggle button)
select radio B
toggle the element attached and detached once (2 clicks on toggle button)
Current Result
A is selected
Expected Result
B is selected
Debug Info
Not related to component (happen on any listmodel based comp)
most likely caused by AbstractListModel _listeners not beeing destroyed when the shadow element content is removed from UI
When selection happen, selection is synced with all previous Radiogroup instances already removed from UI, which cause sync issues.
on ZK 8.5.0 - listeners are not cleaned up, but the model selection is not affected by old listeners
on ZK 8.5.1.2 - listeners are not cleaned up, selection is affected
Root Cause
org.zkoss.zul.AbstractListModel._listeners still contain listeners for selection states for Radiogroups already removed from page tree.
Workaround
- relates to
-
ZK-2603 unlisten model listener when the component has detached, and listen it again when attached.
- Closed