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

selected tabpanel remains visible once corresponding tab gets disabled or hidden

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 8.5.2.1
    • Components
    • None

      reproduce

      • define tabbox with 2 available tabs
      • 2nd tab can be disabled or hidden via databinding, e.g. disabled="@load(vm.disabled[tab])"
      • select 2nd tab (still available at that moment)
      • send command, which disables 2nd tab via databinding
      • tab gets disabled but tabbox is still visible

      same with "visible" state. This is a bug, because disabled/invisible tabs should not be selectable!

      A client-side workaround could look as following - but server-side handling would be probably better:
      {{zk.afterLoad('zul.tab', function () {
      new zul.tab.Tab(); // force init

      var orgFunc = zul.tab.Tab.prototype.setDisabled;
      zul.tab.Tab.prototype.setDisabled = function() {
      orgFunc.apply(this, arguments);
      if (this.isDisabled() && this.isSelected())

      { this.getTabbox().setSelectedIndex(0); }

      }
      });}}

            Unassigned Unassigned
            fse fse
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: