💡
Our Forums Have Moved
For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub
- This topic has 4 replies, 3 voices, and was last updated 12 years, 3 months ago by
Brandon.
Viewing 5 posts - 1 through 5 (of 5 total)
-
AuthorPosts
-
TorbenKjeldgaardMemberHi,
I’m vondering if there is a alert box / dialog where you can ask the user to confirm. Eg. “Delete account” (Yes/No) I’ve been searching on this page, but cant find anything… But it must be a very common wish – so I guess it’s just me who cant find it?
And where can I find a description of the parameters avaliable for phoneui.alert/phoneui.showDialog ect.
Cheers
TorbenDecember 17, 2013 at 5:52 am #345304
KariSolamakiMemberHello Torben,
these are the JavaScript options you can use:
//window.alert or just alert ... When an alert box pops up, the user will have to click "OK" to proceed. window.alert("I am just an alert box!"); //window.confirm or just confirm ... If the user clicks "OK", the box returns true. //If the user clicks "Cancel", the box returns false. var r=window.confirm("Press a button"); if (r==true) { x="You pressed OK!"; } else { x="You pressed Cancel!"; } alert(x); //window.prompt or just prompt ... If the user clicks "OK" the box returns the input value. //If the user clicks "Cancel" the box returns null. var person=window.prompt("Enter your name","Your Name"); if (person!=null) { x="Goood Mooorning " + person + "!"; alert(x); }December 17, 2013 at 6:50 am #345306
TorbenKjeldgaardMemberThanks, but I know the Ordinary java window ect. I was interesting in knowing if ther is a “phoneui” version, because using the one you mention, will show the page name in the alert…
December 17, 2013 at 7:50 am #345310
KariSolamakiMemberDecember 17, 2013 at 8:17 am #345312
BrandonMemberTry these:
/** * shows alert and calls fnContinue then. Note: works in different * ways in iOS and TC. For TC it returns immediately, while for iOS * it returns only when user pressed OK * * @param message Text message * @param fnContinue function that called when user selected button. * @param optionalTitle optional, title for dialog * @param optionalButtonLabel optional, button label */ phoneui.alert(message, fnContinue, optionalTitle, optionalButtonLabel) /** * shows confirmation dialog. result comes to fnContinue. Blocks in web app, doesn't block in * phonegap apps * * @param message Text message * @param fnContinue function that called when user selected button. Takes 1-based index of selected button * @param optionalTitle optional, title for dialog * @param optionalButtonLabel optional, string with comma-separated button labels */ phoneui.confirm(message, fnContinue, optionalTitle, optionalButtonLabel) { -
AuthorPosts
Viewing 5 posts - 1 through 5 (of 5 total)
