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
Contributor
Posts: 20
Registered: ‎06-12-2012
My Device: BlackBerry 10 Dev Alpha
My Carrier: TELE2 HR

Disable backButton in ActionBar

Hi how to disable backButton in ActionBar?

 

appActionBar.backButton = new Action( 'Back', null, {id:'back'} );
appActionBar.backButton.enabled = false;

 

This work when is called before 

 

ab.addChild(appActionBar);
this.addElement(ab);

 

 

But when I call afer this button stays enabled i even try this:

 

ab.removeChild(appActionBar);
this.removeElement(ab);
appActionBar.backButton.enabled = false;
ab.addChild(appActionBar);
this.addElement(ab);

 

 

But no luck.

 

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

Re: Disable backButton in ActionBar

What happens if you:

appActionBar.backButton = null;
?

My guess is that would remove the back button.
Contributor
Posts: 20
Registered: ‎06-12-2012
My Device: BlackBerry 10 Dev Alpha
My Carrier: TELE2 HR

Re: Disable backButton in ActionBar

Hi thanks, that worked, it's a workaround. 

 

null - removes button like you wrote, but I meed to disable button (action) maybe my code work but i need something to invalidate or render or update action bar Smiley Happy 

 

but this is solution for now Smiley Happy 

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

Re: Disable backButton in ActionBar

It would be nice to disable actions, but I found that I just removeAll() and then add back what is needed based on the current state of the page. Not great, but it works. It what use case do you want to prevent the user to go back to the previous page?
Developer
Developer
Posts: 227
Registered: ‎01-17-2012
My Device: PB
My Carrier: ATT

Re: Disable backButton in ActionBar

I'm having similar fun with ActionBar.

 

And I also add/remove the backButton - e.g. since my screen requires an explicit Save...

 

I chose to enable/disable Actions, rather than adding/removing: I think it would be too confusing to a user when menu items keep changing places.  That said, I cannot get the menu items to appear in a consistent order even though I always add them in the same order.

All Actions are explicityly designated as being on the bar or on the overload and I've also tried addActionAt, but the menu items are placed in seeminly random order from one invocation to the next.

 

Suggestions?

 

Regards,

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

Re: Disable backButton in ActionBar

If you can repeat this issue, please submit a bug report and then post the bug number here so other can vote on it.
Highlighted
Developer
Developer
Posts: 227
Registered: ‎01-17-2012
My Device: PB
My Carrier: ATT

Re: Disable backButton in ActionBar

my bad - was loading Actions from a Dictionary...

 

Regards,

Contributor
Posts: 20
Registered: ‎06-12-2012
My Device: BlackBerry 10 Dev Alpha
My Carrier: TELE2 HR

Re: Disable backButton in ActionBar

Just to confirm. This works now.

 

appActionBar.backButton.enabled = false;

 

BB10 Air Developer