Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Developer
Developer
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

PlayBook - blackberry.ui.dialog - customAskAsync/standardAskAsync issue

Hi everone,

 

I worked on an app for BB10 and tried it right now on the PlayBook and it seems working from the beginning, but there is one issue (next to other already reported to bbUI.js repo) with the blackberry.ui.dialog API on PlayBook. From time to time I get an issue reported in the Web Inspector like this one:

 

TypeError: 'null' is not an object (evaluating 'response.Response')            index.htm:187

 and in this line, after searching the line since it isn't in my default index.htm I found it in another index.htm from the "Scripts" tab in Web Inspector and in the line 187 there is following source code:

 

responseCallback(response.Response); //call the client code with the parsed response

And something I didn't understand, almost all content of this index.htm isn't my original index.htm source.

 

I already read that only the Ripple Emulator can do the customAskAsync or standardAskAsync, but I got it on the PlayBook one time the app was running and now it seems gone away.

 

Somebody aware of this issue? Thx.

 

 

 


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: PlayBook - blackberry.ui.dialog - customAskAsync/standardAskAsync issue

I've seen that error before as well, although never clearly understood it myself.

 

The comment in the docs indicated that this API is supported in Ripple, however only for the PlayBook platform.  It should be supported on all the hardware.

 

Can you provide a code snippet of how you are using the async dialogs in your app? It should match or be similar to the following:

https://developer.blackberry.com/html5/apis/blackberry.ui.dialog.html#.standardAskAsync

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Highlighted
Developer
Developer
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: PlayBook - blackberry.ui.dialog - customAskAsync/standardAskAsync issue

Hi Adam, nice to see you again.

 

My app is running really well on BB10 with the dialogs (except the issue with text content output I already mentioned here) but on PlayBook some times the dialog is shown, sometimes not. I tried to figure it out and used the standardAskAsync in that way to exit the app on users choice:

 

blackberry.ui.dialog.standardAskAsync("Want to quit? ...", blackberry.ui.dialog.D_YES_NO, function(e) {
	if(parseInt(e, 10) === 0) {
		blackberry.app.exit();
	}
}, {title: "Close App", size: blackberry.ui.dialog.SIZE_SMALL, position : blackberry.ui.dialog.CENTER});

Then I also used the customAskAsync for some other action, just to give it a try if this one is working:

 

var buttons = ["OK"];
var options = {title: "Title-Txt", size: blackberry.ui.dialog.SIZE_SMALL, position : blackberry.ui.dialog.CENTER};

blackberry.ui.dialog.customAskAsync("Content-Text", buttons, function() {/* Do something. */}, options);

To be mentioned, some times after deploying+launching the app it is working on PlayBook, but other times when launching the app directly it doesn't work to open the dialogs.


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.