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

Posts: 614
Registered: ‎10-17-2010
My Device: (BlackBerry Z10)-> Q10/Passport Dual Use

ListItemComponent onSelected background temporary feedback

wat property do you change on an individual list item component to change it's background color when it is selected (aka touched) before an action is triggered by the selection?



New Contributor
Posts: 5
Registered: ‎11-06-2012
My Device: bb10
My Carrier: liveconnected.com.au

Re: ListItemComponent onSelected background temporary feedback

This must be a common problem, as I am facing this as well.


Either its a bug, or there is no clear documented way of using a ListItemComponent and having a nice selected background or font change to indicate user has selected or activated the item.

Senior Software Engineer QtSensor, QSensorGestures qt-project
llornkcor technologies
Posts: 526
Registered: ‎05-17-2009
My Device: 9900
My Carrier: ATT

Re: ListItemComponent onSelected background temporary feedback

ListItemComponent is nothing by itself. It needs content. So you would have to set the background on the content you supply. Using standardlistitem is probably different but listitemcomponent itself isnt really UI related, in a sense.
Like all of my posts
Posts: 111
Registered: ‎07-05-2012
My Device: none
My Carrier: MOvistar

Re: ListItemComponent onSelected background temporary feedback

[ Edited ]

Hi guys,


I just went through this. And I managed to solve it this way in QML:



              type: "simpleItem"
                  id: itemRoot

	                   if(event.touchType == TouchType.Down)
                                  // Item was touched
		                   itemRoot.background = Color.Red
                           else if (event.touchType == TouchType.Up ||
                                       event.touchType == TouchType.Cancel)
                                  // Item is not touched anymore
		                  itemRoot.background = Color.Black


Let me know if any doubt.