Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-5551

Shadow Component ForEach adds fullfil listeners everytime the syncModel method is called, doesn't clear them if component is removed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 10.1.0
    • 10.0.0, 9.6.4
    • None
    • Security Level: Jimmy

      Steps to Reproduce

      1. Run attached fullfil.zul
      2. Click "add dynamic item" 3 times
      3. click "clear model" once
      4. click "render all"

      Current Result

      onFullfill events trigger on the removed components.

      each component onFullfil is triggered (1 + number of syncModel called after being added) timesĀ 

      Expected Result

      onFullfill doesn't trigger for removed components

      onFullfill is called once per component which hold the listener

      Debug Information

      • org.zkoss.zk.ui.impl.UiEngineImpl.TemplateImpl.create(Component, Component, VariableResolver, Composer) is called on each of the items currently in the model everytime org.zkoss.zuti.zul.ForEachListDataListener.onChange(ListDataEvent) is triggered by adding new elements in the model.
      • This triggers org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(CreateInfo, NodeInfo, Component, Component) which adds new Fullfill listeners for every existing component, even those who already have a fullfill listener.
      • Both issues should be solved by clearing fullfill listeners when the content of the shadow templates are destroyed and recreated during modelSync

            jumperchen jumperchen
            MDuchemin MDuchemin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: