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

listitem.setParent loses selected flag

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 7.0.5
    • 7.0.4
    • Components
    • Security Level: Jimmy

      the fiddle example shows that adding a selected item to a listbox, works for appendChild and insertBefore but not when using listitem.setParent()
      http://zkfiddle.org/sample/ij4ufp/1-listbox-add-selected-listitem (need to clear the selection before each insert, to see that setParent has no effect)

      enabling multiple selections makes this more apparent. no need to clear the selection here, just append/insert/setParent items and see that setParent "initally" has no effect and only updates when another item is added.
      http://zkfiddle.org/sample/ij4ufp/2-listbox-add-selected-listitem

      Workaround

      use appendChild() and insertBefore()

            ChunfuChang ChunfuChang
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: