-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi *,
It's possible to trigger more than one command for the same event?
I'm looking for something like:
<button onClick="@command('save') @command('showDetail')" />
But it gives the error that only one command is available.
Thanks,
Madruga
Anyone????
Hi ashishd,
Thanks for the reply, but the javadocs states the Annotation for the Java part.
// Java @Command({"save", "forceSave"}) void saveObject() { .. logic .. } // zul <button onClick="@command('save')"/> <button onClick-"@command('forceSave')/>
So two different buttons will trigger two different commands, but their end point will be the same method on the java backend.
But what I'm looking for is one button on the zul part trigger two (or more) different commands that each will have it's on method on the backend. Something like
// JAVA @Command('save') void save() { ... logic ...} @Command('showDetail') { .. logic .. } // zul <button id="btnSaveAndShowDetail" onClick="@command('save') @command('showDetail')" />
"But why don't you just call the showDetail method on the save method?"
Well that's because this is a simplification to show what I'm looking for =]
@Madruga,
Currently, We don't allow trigger multiple command in zul in zkbind2 layer (it is relative to the validation lifecycle, which might/might not stop commands)
However, from the app controller, it could do this by call Binder.postCommand or Binder.sendCommand.
Hi Dennis,
Thanks for the tip, but we re-organized our app so now we have a normal command and a global command.
Works great.
Thanks for the help.
Regards - Madruga
Asked: 2012-03-14 20:40:13 +0800
Seen: 406 times
Last updated: Apr 11 '12