0

ZK 6.5.1 Error [closed]

asked 2013-04-04 14:18:16 +0800

Senthilchettyin gravatar image Senthilchettyin flag of India
2615 3 8
http://emrpms.blogspot.in...

Hi

Using this link, the following code gives error in 6.5.1

Messagebox.show("Something is changed. Are you sure?", 
            "Question", Messagebox.OK | Messagebox.CANCEL,
            Messagebox.QUESTION,
                new org.zkoss.zk.ui.event.EventListener<ClickEvent>(){
                    public void onEvent(ClickEvent e){
                        switch (e.getButton()) {
                        case Messagebox.Button.OK: //OK is clicked
                        case Messagebox.Button.Cancel: //Cancel is clicked
                        default: //if the Close button is clicked, e.getButton() returns null
                        }
                    }
                }
            );

Error as follows

The method show(String, String, int, String, EventListener<event>) in the type Messagebox is not applicable for the arguments (String, String, int, String, new EventListener<messagebox.clickevent>() {})

The qualified case label Messagebox.Button.OK must be replaced with the unqualified enum constant OK

delete flag offensive retag edit

The question has been closed for the following reason "the question is answered, right answer was accepted" by Senthilchettyin
close date 2013-05-06 10:51:27

2 Answers

Sort by » oldest newest most voted
1

answered 2013-05-06 10:20:21 +0800

khcyt gravatar image khcyt
216 1

Hello Senthilchettyin, please change your code to

Messagebox.show("Something is changed. Are you sure?", "Question", Messagebox.OK | Messagebox.CANCEL,
                                Messagebox.QUESTION,
                                new org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>()
                                {
                                    public void onEvent(org.zkoss.zk.ui.event.Event e)
                                    {
                                        Integer btn_id= (Integer) e.getData();
                                        switch (btn_id.intValue()) 
                                        {
                                            case org.zkoss.zul.Messagebox.OK: //OK is clicked
                                            case org.zkoss.zul.Messagebox.CANCEL: //Cancel is clicked
                                            default: //if the Close button is clicked, e.getButton() returns null
                                        }
                                    }
                                }
                            );

Kai

link publish delete flag offensive edit

Comments

Thank you very much kai. But i changed my implementation as this post describes http://forum.zkoss.org/question/72249/solved-getting-confirm-dialog-messages/

Senthilchettyin ( 2013-05-06 10:26:50 +0800 )edit
0

answered 2013-05-02 20:32:28 +0800

Senthilchettyin gravatar image Senthilchettyin flag of India
2615 3 8
http://emrpms.blogspot.in...

updated 2013-05-02 20:32:55 +0800

Any help please.................Same problem in 6.5.2

link publish delete flag offensive edit

Question tools

Follow
1 follower

RSS

Stats

Asked: 2013-04-04 14:18:16 +0800

Seen: 36 times

Last updated: May 06 '13

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