2

I know by adding WL.SimpleDialog.show i can show a native style dialog/alert box with buttons. But is it possible to show the same with a textbox and yes and no buttons.

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
sansid1983
  • 239
  • 1
  • 4
  • 14

1 Answers1

3

You cannot achieve that with WL.SimpleDialog. However, if by "textbox" you mean a dialog with an input field in it, better known as a Prompt, then you could follow my example in the following question: IBM Worklight 6.1 - How to display a prompt dialog?

The code in your case could be like this:

navigator.notification.prompt(
        'Replace me',  // message
        onPrompt,                  // callback to invoke
        'myPrompt',            // title
        ['Yes','No'],             // buttonLabels
        'My default text'                 // defaultText
    );
}

function onPrompt() {
    alert("prompted");
}
Community
  • 1
  • 1
Idan Adar
  • 44,156
  • 13
  • 50
  • 89