cancel
Showing results for 
Search instead for 
Did you mean: 

HWC - showAlertDialog(), error in title

Former Member
0 Kudos

Hi everyone,

when calling the function

hwc.showAlertDialog("message", "title");

in the file custom.js a popup shows up as expected, containing the message. But there is an error displaying the title and I have no clue why. You can see it in the attachment of this post.

API.js contains the following:

/**

* @deprecated since version 2.2 - should now use hwc.showAlertDialog(...)

*/

function showAlertDialog (message, title) 

{

   return hwc.showAlertDialog (message, title);   

}

Is this a bug ?

Greetings

Alex

Accepted Solutions (0)

Answers (2)

Answers (2)

david_brandow
Contributor
0 Kudos

This is going to be a long, and possibly, boring story, but here it goes. On iOS, and iOS only, the dialog that the embedded browser control brings up for a Javascript alert() uses the html file as the title (for reasons I'm not personally fond of), this isn't configurable. In older versions of SUP, we had a customized API, showAlertDialog(), that would bring up a native dialog on iOS, with a customizable title, and the regular alert on the other platforms where the title wasn't an issue. Unfortunately, for various technical reasons, primarily multithreading, that solution caused more problems than it was worth, so we have reverted to the browser control-supplied alert() dialog on iOS.

In practice, I would not recommend using an alert() in situations where the user is likely to see it. I would recommend using a Dialog or a Popup instead, you can get a much better look-and-feel, using the appropriate jQueryMobile theme, that way.

Former Member
0 Kudos

Hi David,

     Thanks for your post, we have been facing this error for long time, now we can able to solve this.

Regards

Srinivas

midhun_vp
Active Contributor
0 Kudos

The title you are getting is a default title. It is not an error.

I am not sure whether it is possible to change the title of the alert in SUP 2.2.

Once I used confirm API in SUP 213 where similar title was coming. It is not possible to change that. Hence I used the alert of Phonegap. ex: navigator.notification.confirm

- Midhun VP