0

MVVM: problem Messagebox.show on modal window

asked 2013-08-20 16:23:20 +0800

andresmq gravatar image andresmq
12 3

updated 2013-08-20 21:02:01 +0800

Hello list,

I have created a modal window: Executions.createComponents ("/ ventanaDlg.zul", null, map);

Then in the ViewModel "VentanaDlgVM.java" i have the following code:

@Command
@NotifyChange("listaComite")
public void OnEliminar(@BindingParam("comite") ComiteElectoral comite){

    if (  Messagebox.show("Delete the item: "+comite.getVotante(),
        "Confirmación", Messagebox.OK | Messagebox.CANCEL,  Messagebox.QUESTION)== Messagebox.OK  ){
        listaComite.remove(listaComite.indexOf(comite));
    }
}

But when I run the command, I then display the dialog via "MessageBox.Show" but the execution does not stop , but unlike performs the action that goes on and removes the data from the list of "listaComite.remove"

What's the problem?

I am using ZK CE 6.5.2

Thank you very much,

Atte. Andres Mamani.

I can not send a reply, so I edit.

thanks @ sjoshi yet "view" or "null" is equal in this case

I do not remember why, but I read some time ago that I had to set the zk.xml

<system-config>
  <ui-factory-class>
    org.zkoss.spring.bean.ZkSpringUiFactory
  </ui-factory-class>
  <disable-event-thread> false </disable-event-thread>
</system-config>

I had it set in a previous project :) and still is valid for MVVM. This will solve the problem with a modal window or MessageBox.Show

Also use zkspring

Thank you.

delete flag offensive retag edit

1 Answer

Sort by » oldest newest most voted
0

answered 2013-08-20 17:03:46 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

updated 2013-08-20 17:08:02 +0800

I am not sure but may be issue to pass Null Value .Why you are passing Null Here?

Executions.createComponents ("/ ventanaDlg.zul", null, map);

You should pass the object of Component class rather than Null

For more Information you can check my answer Here. May be it will help you.

See below code for more information

    @Command
    public void openModal(@ContextParam(ContextType.VIEW) Component view){
        Executions.getCurrent().createComponents("/modalWindow.zul",
                view, "Your Parameter Value");
    }
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: 2013-08-20 16:23:20 +0800

Seen: 42 times

Last updated: Aug 20 '13

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