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
Contributor
Wongadob
Posts: 40
Registered: ‎05-12-2012
My Device: 9800
My Carrier: Virgin mobile

Blackberry alerts/confirm style pop up questioons

I am writing a web app for blackberry smartphones using Webworks and I need to inform the user of various error messages and alerts. I have been trying to use standardAskAsync with absolutely no joy. I eventually read this post in the forum

 

http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Using-dialog-windows/m-p/1523219...

 

Which informed me that standardAskAsync is not supported for smart phones. The problem is that the former stanrdardAsk has been depreciated so if I call that I also get an error.

 

Any ideas the correct 'blackberry' way to show the error messages. Any help much appreciated

 

Wongadob

 

 

Please use plain text.
Developer
rorybarnes
Posts: 214
Registered: ‎01-07-2011
My Device: Bold 9900
My Carrier: Rogers

Re: Blackberry alerts/confirm style pop up questioons

standardAskAsync and customAskAsync should now work on smartphones. What error are you getting when you try to use them?

--
Rory (@roryboy)
Click "Accept as Solution" if post solved your original issue. Give like/thumbs up if you feel post is helpful
Please use plain text.
Administrator
astanley
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Blackberry alerts/confirm style pop up questioons

Correct, standardAskAsyc is supported on J2ME and Tablet OS platforms.  See the "View Supported Platform Table" on the following page:

https://bdsc.webapps.blackberry.com/html5/apis/blackberry.ui.dialog.html

 

You can find full details for the standardAskAsync method here:

 

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

 

<script type="text/javascript">

function dialogCallBack(index){
  alert(index);
}

function standardDialog() {
  try {
    blackberry.ui.dialog.standardAskAsync("Save?", blackberry.ui.dialog.D_SAVE, dialogCallBack, {title : "Save Dialog", size: blackberry.ui.dialog.SIZE_MEDIUM, position : blackberry.ui.dialog.BOTTOM});
  }catch (e) {
    alert("Exception in standardDialog: " + e);
  }
}

</script>

 

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Please use plain text.
Contributor
Wongadob
Posts: 40
Registered: ‎05-12-2012
My Device: 9800
My Carrier: Virgin mobile

Re: Blackberry alerts/confirm style pop up questioons

The error I am getting is - Uncaught TypeError: Object [object Object] has no method 'standardAskAsync'

 

This is via Ripple - The latest Chrome extension version

 

I inlcude the following webworks JS files

 

<script type = "text/javascript" src="/inc/html5_init.js" ></script>
<script type = "text/javascript" src="/inc/html5_worker.js" ></script>
<script type = "text/javascript" src="/inc/navmode.js" ></script>

 

They are all dated feb 9th.

 

When I console.out the blackberry.ui.dialog I get the following

 

console.log(blackberry.ui.dialog)

 

  1. customAskfunction (a,b,c,d){throw"not implemented"}
  2. get C_CANCELfunction (){return-1}
  3. get C_DELETEfunction (){return 3}
  4. get C_DISCARDfunction (){return 2}
  5. get C_NOfunction (){return-1}
  6. get C_OKfunction (){return 0}
  7. get C_SAVEfunction (){return 1}
  8. get C_YESfunction (){return 4}
  9. get D_DELETEfunction (){return 2}
  10. get D_OKfunction (){return 0}
  11. get D_OK_CANCELfunction (){return 4}
  12. get D_SAVEfunction (){return 1}
  13. get D_YES_NOfunction (){return 3}
  14. standardAskfunction (a,b,c,d){throw"not implemented"}
  15. __proto__Object

This looks like an old version to me! but just not sure how to get it updated to latest! I have downloaded and installed the latest 2.3.1

 

Any ideas where I am going wrong?


Please use plain text.
Administrator
astanley
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Blackberry alerts/confirm style pop up questioons

Oh wow, yeah that does look like "old" code.   

 

 

Did you uninstall the older version of the WebWorks SDK, or install the latest (v2.3.1) on top of it?  I wonder if the latter, whether the /ext folder got messed up.

 

 

Can you open this folder C:\Program Files\Research In Motion\BlackBerry WebWorks SDK 2.3.1.5\ext\blackberry.dialog\blackberry\ui\dialog

 

Do you see the CustomAskAsyncFunction.java and StandardAskAsyncFunction.java files?

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Please use plain text.
Contributor
Wongadob
Posts: 40
Registered: ‎05-12-2012
My Device: 9800
My Carrier: Virgin mobile

Re: Blackberry alerts/confirm style pop up questioons

Yes those functions are there but located here-

 

C:\Program Files (x86)\Research In Motion\BlackBerry WebWorks SDK 2.3.1.5\ext\blackberry.dialog\blackberry\ui\dialog

 

note X86 rather than just Program Files. I do have a Program Files Directory too (I guess for 64 bit apps - I am running Windows 7 64 bit)

 

I completely uninstalled everything before installing the chrome extension. I did this on Saturday (only a few days ago) and I did it for exactly the same problem. I was using the old standalone version. I checked 'programs & features' and there are no Research in Motion installations on my system. Aside from the chrome plugin but that does not show up in Programs & Features.

 

Scratching head!

Please use plain text.
Contributor
Wongadob
Posts: 40
Registered: ‎05-12-2012
My Device: 9800
My Carrier: Virgin mobile

Re: Blackberry alerts/confirm style pop up questioons

Actually I did install 2.3.1 after installing the chrome pluggin (via Chrome) could that be the issue. Should I not install 2.3.1 at all? Does the chrome plugin work without the actual API installation. I needed that so I could get access to the .js files for including in the software.

Please use plain text.
Administrator
astanley
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Blackberry alerts/confirm style pop up questioons

Okay I'm getting the exact same results in the Ripple emulator.  I think this is a bug with Ripple - it is still emulating the "old" API interface.  I expect this happened as the WebWorks API changed, but the Ripple team did not update their side of things.

 

This should not be an issue on a live device, or simulator. I expect those environments will recognize the correct properties and methods.

 

Would you like to submit this as a bug here?

 

https://github.com/blackberry/Ripple-UI/issues

 

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Please use plain text.