0

Issue with message box

asked 2017-01-12 04:34:02 +0800

KartikBandri gravatar image KartikBandri
3 2

Hi All,

We are facing issue with Messagebox Confirmation when delete button (We are using image) is pressed we are taking a confirmation from the user like "are you sure to delete?" and if user clicks on yes then only the data is deleted else not. For this we are using Messagebox confirmation but the control will check the if condition before we click on yes button so we are unable to find the problem.

Please help us on this, thanks in advance.. Please find below pseudo code

Image img= new Image("/path"); image.setTooltiptext("delete"); image.setId(id); image.addEventListner(Events.ON_CLICK, new EventListner(){

 public void onEvent(Event e)
 {
 int ret = ZkMessagebox.warning("String","String2",ZkMessagebox.Yes | ZkMessagebox.No);
 if(ret== ZkMessagebox.YES)
 {
 delete();
 }
 }
 });

public static int warning(String message,String title,int buttons) { Messagebox.setTemplate("template");

try{ return Messagebox.show(message,title,buttons,Messagebox.Exclamation); } catch(Exception e) { syso(); } return 0; }

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-01-12 09:07:59 +0800

Darksu gravatar image Darksu
1991 1 4

Hello KartikBandri,

As a fast alternative you could create a modal window with two buttons.

There it is much easier to add the logic you want in the onClick event.

Best Regards,

Darksu

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: 2017-01-12 04:34:02 +0800

Seen: 15 times

Last updated: Jan 12 '17

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