0

onBookmarkChange event never fire

asked 2011-03-25 05:26:10 +0800

cahu gravatar image cahu
45

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

delete flag offensive retag edit

6 Replies

Sort by » oldest newest

answered 2011-03-25 08:03:54 +0800

robertpic71 gravatar image robertpic71
1275 1

updated 2011-03-25 08:04:03 +0800

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

link publish delete flag offensive edit

answered 2011-03-25 08:32:17 +0800

cahu gravatar image cahu
45

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)
	{
               [...]
	}
        [...]
[...]

link publish delete flag offensive edit

answered 2011-03-25 08:40:11 +0800

robertpic71 gravatar image robertpic71
1275 1

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"
..

link publish delete flag offensive edit

answered 2011-03-25 08:46:33 +0800

cahu gravatar image cahu
45

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

link publish delete flag offensive edit

answered 2011-03-25 08:48:41 +0800

cahu gravatar image cahu
45

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>

link publish delete flag offensive edit

answered 2011-03-25 10:14:35 +0800

cahu gravatar image cahu
45

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 !

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2011-03-25 05:26:10 +0800

Seen: 407 times

Last updated: Mar 25 '11

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More