-
FEATURED COMPONENTS
First time here? Check out the FAQ!
hi all,
I want to take a close button in my login page and after clicking on this close button browser should be closed. How to achieve this please reply.
Thanks All
What about listening to the onClick event of the button and then using Clients.confirmClose(String message) to ask for confirmation?
http://books.zkoss.org/wiki/ZK_Developer%27s_Reference/UI_Patterns/Browser_Information_and_Control
This is usually done to prevent closing, but could help the other way round.
Hope it helps,
Stefano
Thank you Stefano !
I tried Clients.confirmClose(String) method with Mozila,Crome and intenate Explorer but it is not working the option is coming for preventing to close the browser but after clicking ok it is not closing browser it is just refreshing the web browser....any way thaks for your suggestions....if there is any other way to do this please reply.............I just called on method closeBrowser() in which i have the following code:-
<zul:button id="close" label="${c:l('common.button.close')}" mold="os" onClick="java:closeBrowser()">
<zul:zscript language="java">
void closeBrowser(){
Clients.confirmClose("Are you sure want to close the application?");
}
</zul:zscript>
</zul:button>
i tried with <zul:attribute> also...the code is as follows:-
<zul:button id="close" label="${c:l('common.button.close')}" mold="os">
<zul:attribute language="java" name="onClick">
Clients.confirmClose("Are you sure want to close the application?");
</zul:attribute>
</zul:attribute>
thanks all
I see... maybe the Clients.confirmClose is meant only to listen to the close event on the browser and let it go if the user confirms, but it does not work on its own...
No further suggestions unfortunately... BTW you can try some javascript but that means to fight against each single browser...
Asked: 2011-03-18 07:21:46 +0800
Seen: 1,077 times
Last updated: Mar 29 '11