-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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; }
Asked: 2017-01-12 04:34:02 +0800
Seen: 15 times
Last updated: Jan 12 '17