-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi all,
I have been trying to use the Bookmark event to capture user pressing browser back button, unsuccessfully. How can I capture the event of user pressing the back button? My page structure is that I have a zul file called desktop.zul that contains the entire application. desktop.zul has a GenericForwardComposer and I am trying to catch the bookmark event by doing the below code.
I would appreciate some pointers.
public void onCreate(Event event) {
final Desktop desktop = Executions.getCurrent().getDesktop();
desktop.setBookmark("mainDesktop");
desktopPage = desktop.getPage("desktopPage");
desktopPage.addEventListener("onBookmarkChange", new EventListener() {
public void onEvent(Event event) throws UiException {
System.out.println(">>>>>>>>>>>>>>>event=" + event);
BookmarkEvent bme = (BookmarkEvent)event;
String bookmark = bme.getBookmark();
System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>Bookmark=" + bookmark);
}
});
Its not possible to disable browser back button rather than you can remove current document from the browser like some secure site did that see banks site .
You could try this :
http://www.htmlgoodies.com/tutorials/buttons/article.php/3478911
As @Sjoshi said, It's impossible to disable it but there are some tricks you could apply.
Greetz chill.
Thanks for the responses, disabling might be the wrong work how do I capture the "history.back()" event?
@chillworld: How do I incorporate those javascript in the link in my Zkoss desktop page?
Appreciate all the pointers.
Asked: 2014-10-16 22:47:57 +0800
Seen: 49 times
Last updated: Oct 21 '14
wrong valueException come in front of modal popup [closed]
Use parameters in a conditional @command
Problems with multiple press and onCtrlKey
MVVM @save on the fly [closed]
Unable to activate destroyed desktop
org.zkoss.zk.ui.UiException: java.lang.ClassNotFoundException
How to put a image or Letter over image on a specific XY Coordinate
Thanks for this. It was usefull for me to :)
czoki ( 2014-10-21 10:53:21 +0800 )editworks here ;D :D thanks a lot for that :D
hardstro ( 2014-10-21 11:57:45 +0800 )edit