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
osus
Posts: 217
Registered: ‎04-26-2012
My Device: Z10
Accepted Solution

(BB10) TabActions crash app on Golden SDK

Hi!

 

With last Gold sdk update, TabActions added to an ActionBAr make app to crash and close without displaying any error.

This worked fine on previous beta sdk's, but same code breaks in golden one.

I've also tried a sample app that just adds an actionbar and breaks when clicking on tabs button.

 

                var actBar:ActionBar=new ActionBar();
                actBar.width=stage.stageWidth;
                actBar.showTabsFirstOnBar(false);
                actBar.addAction(new TabAction("TEST"));
                actBar.addAction(new TabAction("TEST2"));
                actBar.addAction(new Action("Test1"));
                actBar.addAction(new Action("Test2"));
                actBar.addAction(new Action("Test3"));
                addChild(actBar);

 

My apps for Playbook: PlayEpub Book Reader with epub and FB2 support, Google Reader, ReaditLater - Net Files Share Explorer Get access to your network shared files- FFSync Sync your Firefox bookmarks and passwords
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: (BB10) TabActions crash app on Golden SDK

I'm going to guess is that the stage is null. Try hard coding a width here (700). If that works, listen for the event when your panel has been added to the stage and then set the width of the action bar. You can also extend a QNX UIComponent and update the width of the action bar on updateDisplayList function (safer way).
Developer
osus
Posts: 217
Registered: ‎04-26-2012
My Device: Z10

Re: (BB10) TabActions crash app on Golden SDK

That's not the issue, actionbar is added after stage added. 

Action bar is displayed on app, Actions on actionbar and on reflow work fine.

Tabactions on left button is what crash app, when tap on the button on bar to show Tab actions app crashes without doing anything, just closes without any debug message.

 

This didn't happen until Gold sdk, and the same code worked fine on two of my aps.

My apps for Playbook: PlayEpub Book Reader with epub and FB2 support, Google Reader, ReaditLater - Net Files Share Explorer Get access to your network shared files- FFSync Sync your Firefox bookmarks and passwords
Developer
osus
Posts: 217
Registered: ‎04-26-2012
My Device: Z10

Re: (BB10) TabActions crash app on Golden SDK

Forgot to say that this happens both on last simulator and alpha device with last OS release (yesterday)
My apps for Playbook: PlayEpub Book Reader with epub and FB2 support, Google Reader, ReaditLater - Net Files Share Explorer Get access to your network shared files- FFSync Sync your Firefox bookmarks and passwords
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: (BB10) TabActions crash app on Golden SDK

If they are normal Actions, it works fine?
Developer
osus
Posts: 217
Registered: ‎04-26-2012
My Device: Z10

Re: (BB10) TabActions crash app on Golden SDK

Yes! normal actions work fine, the issue is only with TabActions.

My apps for Playbook: PlayEpub Book Reader with epub and FB2 support, Google Reader, ReaditLater - Net Files Share Explorer Get access to your network shared files- FFSync Sync your Firefox bookmarks and passwords
BlackBerry Development Advisor
jdolce
Posts: 172
Registered: ‎10-25-2010
My Device: Not Specified

Re: (BB10) TabActions crash app on Golden SDK

Hey osus,

 

Thanks for bringing this up. We are actually looking into this issue. Apologies for now seeing it sooner.

 

The workaround, which is actually a better UX experience, would be to set a tabOverflowParent and adding it under your content. 

 

Check out my code example I posted to this thread for and example on how to do this.

 

http://supportforums.blackberry.com/t5/Adobe-AIR-Development/BB10-Beta4-ActionBar-issues/td-p/201530...

Developer
osus
Posts: 217
Registered: ‎04-26-2012
My Device: Z10

Re: (BB10) TabActions crash app on Golden SDK

Thank you dude!

 

It seems to work altough I have to make some changes!

Please, don't forget to fix it anyway :smileyhappy:

My apps for Playbook: PlayEpub Book Reader with epub and FB2 support, Google Reader, ReaditLater - Net Files Share Explorer Get access to your network shared files- FFSync Sync your Firefox bookmarks and passwords
Developer
osus
Posts: 217
Registered: ‎04-26-2012
My Device: Z10

Re: (BB10) TabActions crash app on Golden SDK

jdolce,

 

This works on most situations but has problems whtn you have a LIST, it seems as if mouse events mess between them and you can't select nor hide Tabs.

 

Look at this code and run. It seems to work, Tab reflow is displayer, but try to select or hide something. You are always touching LIST, not reflow.

 

package
{
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	
	import qnx.fuse.ui.actionbar.ActionBar;
	import qnx.fuse.ui.core.Action;
	import qnx.fuse.ui.core.TabAction;
	import qnx.fuse.ui.events.DragEvent;
	import qnx.fuse.ui.listClasses.List;
	import qnx.ui.data.DataProvider;
	
	public class TestPush extends Sprite
	{
		private var actionBarOverflow:Sprite;
		private var content:Sprite = new Sprite();
		
		public function TestPush()
		{
			super();
			
			// support autoOrients
			stage.align = StageAlign.TOP_LEFT;
			stage.scaleMode = StageScaleMode.NO_SCALE;
			
			var dp:DataProvider=new DataProvider();
			dp.addItem({"label":"item1"});
			dp.addItem({"label":"item2"});
			dp.addItem({"label":"item3"});
			dp.addItem({"label":"item4"});
			dp.addItem({"label":"item5"});
			dp.addItem({"label":"item6"});
			dp.addItem({"label":"item7"});
			dp.addItem({"label":"item8"});
			dp.addItem({"label":"item9"});
			dp.addItem({"label":"item10"});
			var list:List=new List();
			list.dataProvider=dp;
			
			actionBarOverflow = new Sprite();
			
			var actBar:ActionBar=new ActionBar();
			actBar.showTabsFirstOnBar(false);
			actBar.reserveActionSpace(true);
			actBar.backButton = null; 
			
			actBar.tabOverflowParent = actionBarOverflow;
			actBar.width=stage.stageWidth;
			actBar.showTabsFirstOnBar(false);
			actBar.addAction(new TabAction("TEST"));
			actBar.addAction(new TabAction("TEST2"));
			actBar.addAction(new Action("Test1"));
			actBar.addAction(new Action("Test2"));
			actBar.addAction(new Action("Test3"));
			content.addChild(actBar);
			
			addChild( content );
			content.addChild(list);
			content.addChild(actionBarOverflow);
			
			list.width=stage.stageWidth;
			list.x=0;list.y=0;
			actBar.x=0;
			actBar.y=stage.stageHeight-actBar.height;
			list.height=stage.stageHeight-actBar.height;
		}
	}
}

 

My apps for Playbook: PlayEpub Book Reader with epub and FB2 support, Google Reader, ReaditLater - Net Files Share Explorer Get access to your network shared files- FFSync Sync your Firefox bookmarks and passwords
BlackBerry Development Advisor
pgarcia
Posts: 52
Registered: ‎04-01-2011
My Device: Torch, Playbook

Re: (BB10) TabActions crash app on Golden SDK

Hi,

 

I could have your code working after adding the actionBarOverflow sprite to the main class, instead to content sprite. Also I had to add it first, then container. Could you please try to change your code to something like this:

 

(...)
addChild(actionBarOverflow);
addChild( content );
content.addChild(list);
(...)

 

Cheers

---
Paulo Garcia