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

Combobox / Wired behaviour of dropdown / popup box

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 7.0.5
    • Components
    • An application that has non-displayed / lazy initialized and displayed comboboxes

      Hi,

      i've tracked down an issue with a wired behaviour on comboboxes. The comboboxes are loaded with ListSubModel's that are initially empty and filled with results as soon as the user starts typing.

      Here we boserved that the dropdown always keeps on a sub-line hight even if we had many results.

      After some investigation we found out this only happened if there are also hidden, lazy initialized comboboxes on the same desktop (e.g. in a listbox with disabled columns).

      Detailed description what happens:
      For the 'hidden / lazy initialized combobx' it seems that ComboWidget.js:getPopupNode_() returns null because the popup is not initialized yet. But this 'hidden' combobox is already registered to zWatch.listen('onResponse'...) and receives onResponse updates, but trows an TypeError in ComboWidget.js:_checkPopupPosition() with these exception details:
      TypeError: this.jq[0] is undefined - Stacktrace: zjq.prototype.dimension@https://localhost:8443/zkau/web/ab032470/js/zk.wpd:11878:7
      zul.inp.ComboWidget<._checkPopupPosition@https://localhost:8443/zkau/web/_zv2015032410/js/zul.inp.wpd:1881:12
      zul.inp.Combobox<.onResponse@https://localhost:8443/zkau/web/_zv2015032410/js/zul.inp.wpd:2201:4
      _invoke@https://localhost:8443/zkau/web/ab032470/js/zk.wpd:12628:5
      _Gun<.fire@https://localhost:8443/zkau/web/ab032470/js/zk.wpd:12608:8
      _fire/<@https://localhost:8443/zkau/web/ab032470/js/zk.wpd:12749:6

      The TypeError is a result of pp being null in https://github.com/zkoss/zk/blob/7.0-Stable/zul/src/archive/web/js/zul/inp/ComboWidget.js#L222.

      I added the attached patch that checks if pp is null and returns false if so to prevent the exception from be thrown and so any further event processing been stopped. The Jira-Entry ZK-2733 is also related to this issue, because the exception was dropped silently there...

      Hope the details are clear and the patch is OK to integrate, because i was not able to prepare a testcase easily.

      Thanks & Bye,
      Chris

            Unassigned Unassigned
            christian christian
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: