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

tabbox accordion mold -> inaccessible tabs

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 9.0.0, 9.0.1.2
    • Fix Version/s: 9.5.0
    • Component/s: Components
    • Security Level: Jimmy
    • Labels:

      Description

      Steps to Reproduce

      <zk>
          <button onClick="tabA.setSelected(true)" label="Select Tab A"/>
          <button onClick="tabB.setSelected(true)" label="Select Tab B"/>
          <button onClick="tabC.setSelected(true)" label="Select Tab C"/>
          <tabbox id="tabbox" mold="accordion" height="400px">
              <tabs>
                  <tab label="A" id="tabA"/>
                  <tab label="B" id="tabB"/>
                  <tab label="C" id="tabC"/>
              </tabs>
              <tabpanels>
                  <tabpanel>A</tabpanel>
                  <tabpanel>B</tabpanel>
                  <tabpanel>C</tabpanel>
              </tabpanels>
          </tabbox>
      </zk>
      
      1. click button 'Select Tab B' or 'Select Tab C'

      Current Result

      'Tab A' remains selected
      further attempts to select Tab B or C directly (not via button) are ignored (the tab seems frozen/disabled/closed)

      Expected Result

      possible to select an arbitrary tab directly and programmatically

      Debug Information

      side effect of ZK-4344

      Workaround

      disable the fix of ZK-4344 for accordion mold

          zk.afterLoad('zul.tab', function() {
          	var xTabbox = {};
          	zk.override(zul.tab.Tabbox.prototype, xTabbox, {
                  setSelectedTab: function (tab) {
                      var selTab = this._selTab;
                      if (selTab != tab) {
                          if(this._mold !== 'accordion') {
                              this._selTab = null; // it will be set in Tab._selTab
                              if (selTab)
                                  selTab.setSelected(false);
                          }
                          if (tab)
                              tab.setSelected(true);
                      }
                  }
          	});//zk.override
          });//zk.afterLoad
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              rudyhuang rudyhuang
              Reporter:
              cor3000 cor3000
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 1 day Original Estimate - 1 day
                  1d
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 4 hours
                  1d 4h