Yung A
Yung A

Reputation: 239

How do i bind action to a dialog "OK" button in Codename

This is my code to create the default dialog in Codename one. When the user clicks ok it must proceed/call a function and when they cancel the dialog should just close.

Dialog.show("Confirm", "Do you want to proceed?", "OK", "Cancel");

Upvotes: 4

Views: 690

Answers (1)

Diamond
Diamond

Reputation: 7483

The solution is pretty simple:

if (Dialog.show("Confirm", "Do you want to proceed?", "OK", "Cancel")) {
    //Ok action goes here
}

If you want to handle cancel, just add the else part.

Upvotes: 3

Related Questions