-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello,
I don't anderstand why the history management don't work with my application. The onBookmarkChange events nevers fires.
I add the bookmark in the browserhistory by invoke the methode : desktop.setBookmark("step2")
And a added the event listener :
public void onBookmarkChange(BookmarkEvent event){...}
but it never fires !!
is that zk.xml configuration could be a problem ?
<system-config>
<disable-event-thread>false</disable-event-thread>
</system-config>
Please, help me.
Thanks
Regards
Dahu Chao
please note docs:
broadcasting the onBookmarkChange event (an instance of the BookmarkEvent class) to all root components in the desktop.
The event is only fired to the root-Components.
zk.xml --> should be no problem
/Robert
Thanks a lot for your post.
By all root-component, it means all window elements or page element, isn't it ?
In my program, the listener is a window
index.zul :
[...] <window id="fenetrePrincipale" apply="fr.laposte.intra.rh.saisie.FenetrePrincipale"> [...]
FenetrePrincipale.java
[...] public class FenetrePrincipale extends GenericForwardComposer { [...] public void onBookmarkChange(BookmarkEvent event) { [...] } [...] [...]
Your code looks good, but the window has to be the first UI-Element in the zul-file.
NOT
i.e. index.zul
<Borderlayout>
..
<window id="fenetrePrincipale"
..
It comes like this :
<?page title="Saisie RH" contentType="text/html;charset=UTF-8"?> <zk> <?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?> <n:html xmlns:n="http://www.zkoss.org/2005/zk/native" xml:lang="fr" lang="fr"> <include src="pages/entete_http.zul" /> <n:body id="body"> <window id="fenetrePrincipale" apply="fr.laposte.intra.rh.saisie.FenetrePrincipale">
thanks
The entete_http.zul is made like this :
<zk> <n:html xmlns:n="http://www.zkoss.org/2005/zk/native" xml:lang="fr" lang="fr"> <n:head> <n:title>Accueil</n:title> <n:meta http-equiv="content-type" content="text/html; charset=utf-8" /> <n:meta name="description" content="La description du site" /> <n:meta name="keywords" lang="fr" content="les, mots, clé, à, utiliser" /> <n:meta name="language" content="fr" /> <n:link rel="stylesheet" type="text/css" media="screen" href="./style/css_1024.css" /> </n:head> </n:html> </zk>
Following your advice, i made a test like this :
<?page title="Saisie RH" contentType="text/html;charset=UTF-8"?> <zk> <window id="fenetreTest" apply="fr.laposte.intra.rh.saisie.FenetreTest"> <label>test</label> </window>
And the event fires !!!!
My problem is now about to be resolved.
Thank's you very much !
Asked: 2011-03-25 05:26:10 +0800
Seen: 412 times
Last updated: Mar 25 '11