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
Posts: 304
Registered: ‎08-14-2012
My Device: PlayBook, Z10, Dev C
My Carrier: Rogers
Accepted Solution

how should my XML file look to pull ListItem.selected

  • ListItem.active - Indicates whether the list item is active. An item is active if the user is holding a finger on it.
  • ListItem.selected - Indicates whether the list item is selected. An item is selected if the user tapped the item and it appears selected on the screen.
  • ListItem.data - Provides access to the list item's data in the data model. This is equivalent to the ListItemData property that's used above.

If im using the above what should my xml file look like to have this work. Below sample xml. What would my xml look like if i wanted any of the above to be selected after holding a finger on it, actual selecting and sending it.

 

<listitem title="Worlds Greatest"          image="../images/photome.png"         file="worldsgreatest.qml"/>
   

 

BlackBerry 10 game reviews for the unknown, small and indie developers. Little games with big dreams. VeryBerryGames.com | Follow @VeryBerryGames | TwoCasualCoders.com | never casual on quality
Retired
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: how should my XML file look to pull ListItem.selected

[ Edited ]

Look at sample stampcollector.

(There's also cascadescookbook and weatherguesser)

 

The concept you need is this:  the xml file contains the data.  The list view is how you display and interact with the data. These are separate things.  The xml file should not have any dependency on how the program interacts with the data.

 

See: http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller

 

The xml file in your case is the model.

the XmlDataModel is playing a role that is largely the controller in MVC parlance.

 

So controlling whether something is selectable is done by setting up your ListView.

 

There's lots of easy-to-read documentation under https://developer.blackberry.com/cascades/ with some great worked examples that should make it clear how everything fits together.

 

Stuart

Highlighted
Developer
Posts: 304
Registered: ‎08-14-2012
My Device: PlayBook, Z10, Dev C
My Carrier: Rogers

Re: how should my XML file look to pull ListItem.selected

Ok I understand how that works and the samples iv looked at all talk about buttonImage. I'm just trying to make a listitem change when pressed and show and intierly new image/listitem. I have it set up as a container that gets the icon, image, tittle pulled into the container.
Once the button is touch or pressed it changes before excuteing the rest of the command
BlackBerry 10 game reviews for the unknown, small and indie developers. Little games with big dreams. VeryBerryGames.com | Follow @VeryBerryGames | TwoCasualCoders.com | never casual on quality