Revision history [back]

click to hide/show revision 1
initial version

answered 2013-01-22 10:09:02 +0800

neillee gravatar image neillee flag of Taiwan

https://plus.google.com/u...

Please refer to Client-side Reference about responding to client-side activity. onShow is called after the widget becomes visible.

Below is a simple example that will alert each time the window becomes visible again.

<zk xmlns:w="client">
    <script defer="true">
        var oldShow = zul.wnd.Window.prototype.onShow;
        zul.wnd.Window.prototype.onShow = function() {
            oldShow.apply(this, arguments);
            alert('Window becomes visible');
        }
    </script>
    <tabbox>
        <tabs>
            <tab>Tab 1</tab>
            <tab>Tab 2</tab>
        </tabs>
        <tabpanels>
            <tabpanel>
                <window title="test" border="normal">
                    Main Window
                </window>
            </tabpanel>
            <tabpanel>
            </tabpanel>
        </tabpanels>
    </tabbox>
</zk>

Please refer to Client-side Reference about responding to client-side activity. onShow is called after the widget becomes visible.

Below is a simple example that will alert each time the window becomes visible again.

<zk xmlns:w="client">
<zk>
    <script defer="true">
        var oldShow oldWindow = zul.wnd.Window.prototype.onShow;
        zul.wnd.Window.prototype.onShow = function() zul.wnd.Window.prototype;
        zk.override(zul.wnd.Window.prototype, oldWindow, {
            oldShow.apply(this, arguments);
onShow: function(ctl) {
                alert('Window becomes visible');
         }
        });
    </script>
    <tabbox>
        <tabs>
            <tab>Tab 1</tab>
            <tab>Tab 2</tab>
        </tabs>
        <tabpanels>
            <tabpanel>
                <window title="test" border="normal">
                    Main Window
                </window>
            </tabpanel>
            <tabpanel>
            </tabpanel>
        </tabpanels>
    </tabbox>
</zk>
Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More