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

Native Development

Regular Contributor
Posts: 56
Registered: ‎08-21-2012
My Device: BB10
My Carrier: RIM

Place Action Item on Bar when any event occur

[ Edited ]


I want an ActionItem to be added to actions on ActionBar when some event occur. I don't see any property to remove it initially and then add it on some event.


Presently I'm keeping that ActionItem disabled & I enable it on event capture. But this (disabled item) looks very ugly on ActionBar..! I just dont want it to be on bar when not needed. However, If I get a way to place it in Overflow when not needed, is fine. 


I tried following snippet for this work around: 



title = "item"

actionBar.placement = ActionBarPlacement.InOverflow




text: "onBar"


actionItem.ActionBar.placement = ActionBarPlacement.OnBar





actionItem.ActionBar.placement = ActionBarPlacement.InOverflow



But I think OS does not support it fully. I see the same item repeated multiple times onBar and in overflow both. Moreover my app gets crashed.


Has anybuddy any solution or work around?

Thanks in advance.

Posts: 252
Registered: ‎08-17-2012
My Device: BlackBerry Z10 and Q10
My Carrier: Bell

Re: Place Action Item on Bar when any event occur

[ Edited ]

hi Megha_9_dec, this seems to be a Cascades bug. As a workaround this issue until it is fixed, you have to refrain from changing the ActionItem.placment after the page is created.


Also, from a design point of view, it is not recommended that the application switches where the ActionItems are placed after the page is created. You can enable/disable ActionItems if desired, but changing the ActionItems placement will likely cause confusion to the user and affect the user experience.  


Did this answer your question? Please accept post as solution.
Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker