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
SangramPatil
Posts: 271
Registered: ‎01-21-2013
My Device: BB10 Dev Aplha

Adding Action to base Action Bar

[ Edited ]

I am not able to place the Action on Action Bar, by default the action is added to overflow, but even after explicitly mentioning, it is not being added to action bar:

 

oActionBar.addAction(new Action("Search 1",null, null,ActionPlacement.ON_BAR));

 

 

What is wrong here?

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

Re: Adding Action to base Action Bar

oActionBar.showTabsFirstOnBar(false);
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: Adding Action to base Action Bar

No need for the ON_BAR parameter.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: Adding Action to base Action Bar

The 3rd argument should be something like {id:'search1'} so when you listen for the event you can do a simple switch on the action data. Best not to go by the label.
Developer
SangramPatil
Posts: 271
Registered: ‎01-21-2013
My Device: BB10 Dev Aplha

Re: Adding Action to base Action Bar

Thanks, it worked!

 

However is there some way by whcih I can have the Action-bar clean and add actions in overflow menu? The action-bar will have only 'Back' button.

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

Re: Adding Action to base Action Bar

You could probably have some actions added in between the back and overflow position and have no label, and no icon. Then disable those buttons.
Developer
SangramPatil
Posts: 271
Registered: ‎01-21-2013
My Device: BB10 Dev Aplha

Re: Adding Action to base Action Bar

That works, however I can not place two items which are equally spaced on Action bar. In case I have to add, single item, I add one before and after with disbaled state, but when placing two items, those are not evenly spaced.