facebook

phoneui.dialog / phoneui.alert

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #345301 Reply

    Hi,

    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
    Torben

    #345304

    KariSolamaki
    Member

    Hello 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);
        }
    #345306

    Thanks, 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…

    #345310

    KariSolamaki
    Member
    #345312

    Brandon
    Member

    Try 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) {
    
Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: phoneui.dialog / phoneui.alert

You must be logged in to post in the forum log in