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

Doesn't listen to w:onShow


    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Later Later
    • 8.0.1
    • 6.5.1
    • Components
    • None

      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">
                  <tab w:onSelect='alert("select 1")'>Tab 1</tab>
                  <tab w:onSelect='alert("select 2")'>Tab 2</tab>
                  <tabpanel >
                      <window title="test" border="normal" w:onShow='alert("show 1")' w:onClick='alert("click 1")'>
                          Main Window
                      <window title="test" border="normal" w:onShow='alert("show 2")' w:onClick='alert("click 2")'>
                          Main Window 2

      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"
              <attribute w:name="onShow">
                  alert("listened to onShow");
              <attribute w:name="bind_">
                  function () { this.$bind_(); zWatch.listen({onShow: this});}

            jumperchen jumperchen
            dennis dennis
            1 Vote for this issue
            1 Start watching this issue