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

selected tabpanel remains visible once corresponding tab gets disabled or hidden

    Details

    • Type: Bug
    • Status: Open
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: 8.5.2.1
    • Fix Version/s: None
    • Component/s: Components
    • Labels:
      None

      Description

      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); }

      }
      });}}

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            fse fse
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: