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

Doesn't listen to w:onShow

    Details

    • Type: Bug
    • Status: Open
    • Priority: Later
    • Resolution: Unresolved
    • Affects Version/s: 6.5.1
    • Fix Version/s: 8.0.1
    • Component/s: Components
    • Labels:
      None

      Description

      according to doc, http://books.zkoss.org/wiki/Small_Talks/2010/April/Client_Side_Programming#Watch:_ZK_Client_Engine_Event
      w:onShow should be fired after a widget becomes visible,
      however following case doesn't work

      <zk xmlns:w="client">
          <tabbox>
              <tabs>
                  <tab w:onSelect='alert("select 1")'>Tab 1</tab>
                  <tab w:onSelect='alert("select 2")'>Tab 2</tab>
              </tabs>
              <tabpanels>
                  <tabpanel >
                      <window title="test" border="normal" w:onShow='alert("show 1")' w:onClick='alert("click 1")'>
                          Main Window
                      </window>
                  </tabpanel>
                  <tabpanel>
                      <window title="test" border="normal" w:onShow='alert("show 2")' w:onClick='alert("click 2")'>
                          Main Window 2
                      </window>              
                  </tabpanel>
              </tabpanels>
          </tabbox>
      </zk>
      

      and following code in the doc gets zk red js error dialog after click hide and show

      <window xmlns:w="http://www.zkoss.org/2005/zk/client">
          <button label="show" onClick="b1.setVisible(true);" />
          <button label="hide" onClick="b1.setVisible(false);" />
          <!--
          onShow is not called when first time rendering.
          It is called while setVisible="false", and then setVisible="true"   
          -->
          <button label="if onShow" id="b1"
              style="position:relative;zoom:1">
              <attribute w:name="onShow">
                  alert("listened to onShow");
              </attribute>
              <attribute w:name="bind_">
                  function () { this.$bind_(); zWatch.listen({onShow: this});}
              </attribute>
          </button>
      </window>
      

        Attachments

          Activity

            People

            • Assignee:
              jumperchen jumperchen
              Reporter:
              dennis dennis
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: