06-28-2012 12:42 PM
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.select edIndex);
}
Solved! Go to Solution.
06-28-2012 01:38 PM
Does anybody have working dialog boxes in their air applications?
07-02-2012 04:34 PM
Solved It. Awsome Thanks!
07-03-2012 09:41 AM
07-03-2012 10:40 AM
Hey jtegen, Instead of fighting with the current components to get working I just created my own dialog custom component.
07-24-2012 07:09 AM
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;
11-26-2012 04:47 PM
This still is not working for me anything else I need to do for the Dialog Box to appear?
11-27-2012 08:24 AM
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\IowWi ndowImpl.as:365] at QNXWindow/set deviceOrientation()[E:\hudson\workspace\BB10_0_09- AIR_SDK_API\src\qnxui\src\qnx\fuse\ui\window\QNXWi ndow.as:260] at qnx.fuse.ui.managers::WindowManager/_onShow()[E:\h udson\workspace\BB10_0_09-AIR_SDK_API\src\qnxui\sr c\qnx\fuse\ui\managers\WindowManager.as:439] at qnx.fuse.ui.managers::WindowManager/show()[E:\huds on\workspace\BB10_0_09-AIR_SDK_API\src\qnxui\src\q nx\fuse\ui\managers\WindowManager.as:413] at qnx.fuse.ui.dialog::DialogBase/show()[E:\hudson\wo rkspace\BB10_0_09-AIR_SDK_API\src\qnxui\src\qnx\fu se\ui\dialog\DialogBase.as:587]
If you are running on Dev Alpha simulator, they work (to a degree).
11-27-2012 08:49 AM
11-27-2012 09:32 AM
exactly, but (as discussed in another thread) it does (mostly) work.
Regards,