0

notify event in different zul page

asked 2013-10-10 12:51:13 +0800

LF gravatar image LF
1

how can have event from one *.zul page to another *.zul page

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-10-10 13:44:12 +0800

rickcr gravatar image rickcr
704 7

Maybe there is a way to do it from the zul itself (not sure about that), but I broadcast global notifications from the event handler in my zul's backing ViewModel...

eg.. Your zul

<button label="Submit" onClick="@command('doSomething')"/>

Your backing VM

@Command
public void doSomething() {
    //do stuff, then broadcast notification
    BindUtils.postGlobalCommand(null, null, "somethingHappened", null);
}

Some other VM backing a different zul

@GlobalCommand("somethingHappened")
public void handleSomethingHappened() {
    //
}

note, I like to store my global Commands in a constants file so the string names are defined in one place, so I do something like BindUtils.postGlobalCommand(null, null, MyGlobalCommands.SOMETHING_HAPPENED, null); You can also pass args through the global commands as well.

link publish delete flag offensive edit
Your answer
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
2 followers

RSS

Stats

Asked: 2013-10-10 12:51:13 +0800

Seen: 16 times

Last updated: Oct 10 '13

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