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


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
Developer
Posts: 181
Registered: ‎07-19-2012
My Device: Q5, Q10, Z10, Z30, PlayBook
My Carrier: Carrier
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"
Highlighted
Developer
Developer
Posts: 174
Registered: ‎03-05-2009
My Device: Dev Alpha
My Carrier: -

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
Posts: 181
Registered: ‎07-19-2012
My Device: Q5, Q10, Z10, Z30, PlayBook
My Carrier: Carrier

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"