-
FEATURED COMPONENTS
First time here? Check out the FAQ!
how can have event from one *.zul page to another *.zul page
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.
Asked: 2013-10-10 12:51:13 +0800
Seen: 16 times
Last updated: Oct 10 '13