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
Contributor
Posts: 13
Registered: ‎02-08-2013
My Device: Z10
My Carrier: Rogers

Re: ListView With Context Actions

[ Edited ]

 

I made it work. Thanks anyways.

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: ListView With Context Actions

Try,

 

taskItem.ListItem.indexPath within the ActionItem onTriggered.

 

FYI, it's better to use the code button when inserting code (the clipboard icon with a big C)

 


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Highlighted
Contributor
Posts: 13
Registered: ‎02-08-2013
My Device: Z10
My Carrier: Rogers

Re: ListView With Context Actions

 

ListView {
	   id: tList
	   objectName: "tList"
	   property string web
	   listItemComponents: [
		   ListItemComponent {         
				StandardListItem {
					id:taskItem						    
					contextActions: [
					   ActionSet {
						   actions: [
							   ActionItem {
								   title: "Comment"
								   imageSource: "images/icon.png"
								   onTriggered: {
										console.log(taskItemId.ListItem.view.web)
										taskItemId.ListItem.view.dataModel..viewTriggered();
								   }
							   },
							   ActionItem {
								   title: "Share"
								   imageSource: "images/ic_share.png"
								   onTriggered: {
									   console.log("share");
									   
								   }
							   }
						   ]
					   } // end of ActionSet   
				   ] // end of contextActions list                            			                                                			                                                               
				}	// end of StandarListItem
		   }	// end of ListItemComponent
	   ]	// end of ListItemComponents
	   function triggered() {
		   hello.invoke()
	   }
	   onSelectionChanged: {
		   if (selected) {
			   var chosenItem = dataModel.data(indexPath);
			   web = chosenItem.Link;
		   }
	   }

 Defining "property string web" in my listview, I was able to send data stored in "web" from onSelectionChanged signal(long press and hold emits) to context actions(onTriggered signal).  Thank for helping me