-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Is there any event to catch the hide/detach from the test-window, when the user clicks outside this window (i.e. to the dummybutton) - and the test (mode popup) makes an auot-hide?
<window title="My First Window" border="normal" width="200px">
Events
<label id="name"/>
<window title="test" id="popup" mode="popup" closable="true"
onZIndex="name.value+=event.name"
onClose="name.value+=event.name"
onMinimize="name.value+=event.name">
<label value="content"/>
</window>
<button label="dummy"/>
</window>
/Robert
Hi,
It seems ZK doesn't support such events as API.
please use client side action.
Thanks, here is my workaround:
<window title="My First Window" border="normal" width="200px"> <script type="text/JavaScript"> <![CDATA[ function test(tx, popup) { var sssval = "Off"; tx.value = sssval; anima.fade(popup); if (document.createEvent) { var evt = document.createEvent('HTMLEvents'); evt.initEvent( 'blur', false, false); tx.dispatchEvent(evt); var evt2 = document.createEvent('HTMLEvents'); evt2.initEvent( 'change', false, false); tx.dispatchEvent(evt2); } else if (document.createEventObject) { tx.fireEvent('onblur'); tx.fireEvent('onchange'); } } ]]> </script> <vbox> Events <textbox id="dummy" onChange="name.value += event.value" visible="false"/> <label id="name"/> <window title="test" id="popup" mode="popup" closable="true" position="center" action="onhide:test(#{dummy}, #{popup})"> <label value="content"/> </window> <button label="dummy"/> </vbox> </window>
I don't really know what I do (in Javascript) - but it works...
/Robert
Robert
have you tried onOpen and check isOpen() of event?
<window title="My First Window" border="normal" width="200px"> Events <label id="name"/> <window title="test" id="popup" closable="true" border="normal" onClose="name.value+=event.name" onOpen="name.value+=event.name+','+event.open" onMinimize="name.value+=event.name"> <label value="content"/> </window> <button label="popup" onClick="popup.doPopup()"/> <button label="click" /> </window>
>> have you tried onOpen and check isOpen() of event?
Damn! No!
It's so easy, thanks dennis.
/Robert
Asked: 2009-04-08 01:25:14 +0800
Seen: 254 times
Last updated: Apr 09 '09