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
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Community Library Update Revision 5

Yes, that is needed to place the dialogs onto the stage. If it is not set and you show a dialog, it should be throwing an exception.
Developer
Posts: 439
Registered: ‎10-25-2010
My Device: Not Specified

Re: Community Library Update Revision 5


NormanF wrote:

It is starting to look like the library is using some sort of dialog manager.  The documentation says at the start of the program to add

DialogBase.showOn = this.stage;

 


So can't you just say:
DialogBase.showOn = mainContextView;

?



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

Re: Community Library Update Revision 5

Has to be the stage. There is only one stage for the entire application and it allows the dialog to be placed on top of everythings, since they are modal.
New Developer
Posts: 120
Registered: ‎11-24-2010
My Device: 9700

Re: Community Library Update Revision 5

On the off chance that someone else has this problem, here is how I got robotlegs working with the buttons on my dialog.  I used eventMap.mapListener() in my main conext.  I have stripped the code below down to just the basics.

 

"MainView" is the main application sprite.

"_accountdialog" is the instance of my custom dialog in MainView.

 

package mediators
{
	import flash.events.MouseEvent;
	
	import org.robotlegs.mvcs.Mediator;
	
	public class MainViewMediator extends Mediator
	{
		[Inject]
		public var view:MainView;
		
		override public function onRegister():void
		{
			eventMap.mapListener(view._accountDialog, MouseEvent.CLICK, accountOkClicked);
		}
		
		private function accountOkClicked(event:MouseEvent):void
		{
			trace("OK!");
		}
	}
}

 It still needs work though.  Right now it fires if I click anywhere on the screen while the dialog is being shown.  But that should be a simple fix.

Highlighted
Developer
Developer
Posts: 1,123
Registered: ‎02-10-2009
My Device: 8130 / 8350 / 9530 / 9550 / 9850 / PlayBook
My Carrier: Verizon

Re: Community Library Update Revision 5

There is an error in the TimePicker class for setSelectionDate. Your code does not adjust for the 1 based array in that 0 is midnight but 12 is in position 11 in your array. Here is modified code that will fix it:

 

public function setSelectionDate( tm : Date ) : void
{
   var hrs : int = (tm.getHours()+11)%12;         
   var ampm : String = AM_SUFFIX;
   //if( hrs > 12 )
   if( tm.getHours() >= 12 )
   {
      //hrs -= 12;
      ampm = PM_SUFFIX;
   }
   this.setSelection( hrs, tm.getMinutes(), ampm );
}