0

How do I run command in view end ?

asked 2015-01-24 13:22:18 +0800

unitcell gravatar image unitcell
28 4

updated 2015-01-26 01:02:58 +0800

cor3000 gravatar image cor3000
6280 2 7

Hi all,

How do I run command in view end ?

in view end,part below,

<zscript>
  void delete() {
    Messagebox.show("Delete it ?", "confirm", Messagebox.NO|Messagebox.YES, Messagebox.QUESTION,
      new org.zkoss.zk.ui.event.EventListener(){
        public void onEvent(Event e) throws Exception {
          if(e.getName().equals("onYes")) {
            //onCreate="@command('deletePro')";  // <--- My Question here.
          }
        }
      });
    }
</zscript>

in vm,

  @Command
  public void deletePro() {
    ...
  }

Thanx.

delete flag offensive retag edit

3 Answers

Sort by ยป oldest newest most voted
1

answered 2015-01-24 14:09:53 +0800

chillworld gravatar image chillworld flag of Belgium
5367 4 9
https://github.com/chillw...

Please do not use zscript in your applications. This is for fast prototyping or testing purpose.
Another reason is that Zscript is interpreted by the beanshell and this will result in slower execution than a normal java class.
This should be in your viewmodel under the command delete.
From there you can acces your other method very easy.

Greetz chill.

link publish delete flag offensive edit
1

answered 2015-01-25 18:34:15 +0800

Darksu gravatar image Darksu
1991 1 4

Hello unitcell,

At the following post you can find an alternative solution to your problem:

http://forum.zkoss.org/question/77757/how-to-include-a-modal-confirmation-message-box-before-calling-mvvm-command/

Best Regards,

Darksu

link publish delete flag offensive edit
0

answered 2015-01-26 10:38:43 +0800

liunnek gravatar image liunnek
1

that is really helping!

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
1 follower

RSS

Stats

Asked: 2015-01-24 13:22:18 +0800

Seen: 27 times

Last updated: Jan 26 '15

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