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

Adobe AIR Development

Reply
Contributor
Posts: 12
Registered: ‎01-05-2011
My Device: TORCH
Accepted Solution

BB10 AIR qnx.dialog box or any Alert Message??

Hey Guys,

 

Im having the hardest time with something extremely simple...dialog boxes! Theres something Im not getting and I hope someone out here knows what Im doing wrong!!!! Ive searched the internet, api docs, forums and still nothings working! The below code is from the BlackBerry AIR resource site and does not display anything when I reference it from a view. From the playbook tablet development the old mx.Alert dialog does not show up either?

 

Any ideas? Thanks ahead of time!

 

 

 

     private function showAlertDialog():void
     {
        alert = new AlertDialog();
        alert.title = "Warning";
        alert.message = "This operation may harm your computer. Do you still want to proceed?";
        alert.addButton("OK");
        alert.addButton("CANCEL");
        alert.dialogSize= DialogSize.SIZE_MEDIUM;
        alert.addEventListener(Event.SELECT, alertButtonClicked); 
        alert.show(IowWindow.getAirWindow().group);
     }
     
     private function alertButtonClicked(event:Event):void
     {
          trace("Button Clicked Index: " + event.target.selectedIndex);
          trace("Button properties Object"+event.target.getItemAt(event.target.selectedIndex);
     }
Contributor
Posts: 12
Registered: ‎01-05-2011
My Device: TORCH

Re: BB10 AIR qnx.dialog box or any Alert Message??

Does anybody have working dialog boxes in their air applications?

Contributor
Posts: 12
Registered: ‎01-05-2011
My Device: TORCH

Re: BB10 AIR qnx.dialog box or any Alert Message??

Solved It. Awsome Thanks!

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: BB10 AIR qnx.dialog box or any Alert Message??

What was the resolution?
Contributor
Posts: 12
Registered: ‎01-05-2011
My Device: TORCH

Re: BB10 AIR qnx.dialog box or any Alert Message??

Hey jtegen,  Instead of fighting with the current components to get working I just created my own dialog custom component.

Contributor
Posts: 11
Registered: ‎04-24-2010
My Device: 9550

Re: BB10 AIR qnx.dialog box or any Alert Message??

Stupid RIM i have to say. From AIR 1.0 till 3.0, I never make app work straighway after update SDK.

 

Anyway here is solution for this AlertDialog

 

import qnx.fuse.ui.dialog.AlertDialog;

 

var winner11:AlertDialog;

winner11 = new AlertDialog();

winner11.title = "Warning";

winner11.message = message;

winner11.addButton("OK");

winner11.show();

winner11.addEventListener(Event.SELECT, alertButtonClicked);

return winner11;

 

Developer
Posts: 133
Registered: ‎12-02-2010
My Device: Z10 & Dev Alpha C

Re: BB10 AIR qnx.dialog box or any Alert Message??

This still is not working for me anything else I need to do for the Dialog Box to appear? 

---------------------------------------------------------------------
Developer of Stocks for Blackberry 10
Developer
Developer
Posts: 226
Registered: ‎01-17-2012
My Device: PB

Re: BB10 AIR qnx.dialog box or any Alert Message??

If you are running on PB OS 2.1, dialogs don't work:

 

ReferenceError: Error #1056: Cannot create property deviceOrientation on qnx.display.IowWindow.
	at IowWindowImpl/set deviceOrientation()[E:\hudson\workspace\BB10_0_09-AIR_SDK_API\src\qnxui\src\qnx\fuse\ui\window\IowWindowImpl.as:365]
	at QNXWindow/set deviceOrientation()[E:\hudson\workspace\BB10_0_09-AIR_SDK_API\src\qnxui\src\qnx\fuse\ui\window\QNXWindow.as:260]
	at qnx.fuse.ui.managers::WindowManager/_onShow()[E:\hudson\workspace\BB10_0_09-AIR_SDK_API\src\qnxui\src\qnx\fuse\ui\managers\WindowManager.as:439]
	at qnx.fuse.ui.managers::WindowManager/show()[E:\hudson\workspace\BB10_0_09-AIR_SDK_API\src\qnxui\src\qnx\fuse\ui\managers\WindowManager.as:413]
	at qnx.fuse.ui.dialog::DialogBase/show()[E:\hudson\workspace\BB10_0_09-AIR_SDK_API\src\qnxui\src\qnx\fuse\ui\dialog\DialogBase.as:587]

 If you are running on Dev Alpha simulator, they work (to a degree).

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: BB10 AIR qnx.dialog box or any Alert Message??

BB10 SDK is not suppose to run on the PlayBook. That will come later in the spring.
Developer
Developer
Posts: 226
Registered: ‎01-17-2012
My Device: PB

Re: BB10 AIR qnx.dialog box or any Alert Message??

exactly, but (as discussed in another thread) it does (mostly) work.

 

Regards,