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

Native Development

Reply
Developer
d3v3l0p3r
Posts: 168
Registered: ‎07-19-2012
My Device: Q5, Q10, Z10, Z30, PlayBook
Accepted Solution

How to add contextActions to a custom ListItemComponent in ListView?

ContextActions can be added to a StandardListItem. However when I do not use StandardListItem  and instead have my own Containers and other elements in ListItemComponent i am not able to specify any ContextActions since this is a property of StandardListItem which is not used.

 

How can I add contextActions in this case?

 

Take a look at WeatherGuesser app. The WeatherPage.qml has a ListView which includes WeatherItem (which is a custom component) in ListItemComponent of "item" type  and is not using StandardListItem.

 

How would one go and add contextActions to this page so that each day can be selected and performed some actions on?

---
If you find my post helpful please "like" it and "accept as a solution"
Developer
Developer
lew
Posts: 174
Registered: ‎03-05-2009
My Device: Dev Alpha

Re: How to add contextActions to a custom ListItemComponent in ListView?

contextActions for custom list item works fine for me....maybe post some code so that we can help you out?

 

and also contextActions can be added to any container, not just list item components.

Developer
d3v3l0p3r
Posts: 168
Registered: ‎07-19-2012
My Device: Q5, Q10, Z10, Z30, PlayBook

Re: How to add contextActions to a custom ListItemComponent in ListView?

Ouch - I feel stupid. I've been trying to add contextActions property to ListItemComponent rather than Container within it which is so obvious. Thanks! BTW - Need more Red Bull....
---
If you find my post helpful please "like" it and "accept as a solution"