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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 409
Registered: ‎12-10-2010
My Device: PlayBook
My Carrier: N/A
Accepted Solution

DialogEvent Bug?

[ Edited ]

i'm attempting to use the DialogEvent class, which, as i assume, should return the text (label) of the clicked button from a dialog.  however, nothing is returned.

 

 

import flash.display.Sprite;
import qnx.ui.buttons.LabelButton;
import qnx.dialog.AlertDialog;
import qnx.dialog.DialogSize;
import qnx.events.DialogEvent;

[SWF(width="1024", height="600", framerate="60")]
public class DialogTest extends Sprite
{
public function Test()
	{
	var button:LabelButton = new LabelButton();
	button.label = "Show Alert";
	button.x = button.y = 200;
	button.addEventListener(MouseEvent.CLICK, mouseEventHandler);
	
	addChild(button);
	}

private function mouseEventHandler(evt:MouseEvent):void
	{
	var alert:AlertDialog = new AlertDialog();
	alert.title = "Alert Dialog Title";
	alert.message = "This is text for the alert dialog.";
	alert.addButton("Great!");
	alert.addButton("No Problem!");
	alert.dialogSize= DialogSize.SIZE_SMALL;
	alert.addEventListener(DialogEvent.DIALOG_BUTTON_CLICKED, alertButtonHandler); 
	alert.show();
	}

private function alertButtonHandler(evt:DialogEvent):void
	{
	trace(evt.responseBtnText);
	}
}

 

 

neither of the DialogEvent's properties (responseBtn, responseBtnContext, responseBtnText) are traced as the alertButtonHandler function isn't even called when one of the buttons in the alert dialog is clicked.

 

i realize that the documentation uses event.target.selectedIndex (though the event listener only works if it's Event.SELECT) for the dialog buttons, but what is the purpose of the DialogEvent class if it's not usable in this situation?

 

thoughts?

 

 

 


PlayBook Applications:
Drop Swatch
Developer
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: DialogEvent Bug?

hey,

 

yeah we preivously chocked this up as a bug but juat as you mentioned a user found that Event.SELECT can get the job done. Hopefully they can get this fixed in the next release. Here's the link to the previous page:

 

http://supportforums.blackberry.com/t5/Tablet-OS-SDK-for-Adobe-AIR/Strange-Dialog-Behaviour/td-p/668...

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman