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
laurentC
Posts: 266
Registered: ‎02-05-2010
My Device: Blackberry Z10
Accepted Solution

Share images from listview

Hello,

I'm loading png images (included in project assets) in a ListView. Then I want to trigger the invocation framework to share the selected image. And I want to let it choose the list of invokable applications. Is it the right way to go :

 

ListView {	
	layout: GridListLayout {}
	dataModel: XmlDataModel {
		source: "data.xml"
	}
	
	listItemComponents: [
		ListItemComponent {
			type: "image"
 
			ImageView {
				imageSource: ListItemData.imagePath				
			}
		}
	]
	attachedObjects: [
		Invocation {
			id: invoke
			query {
				mimeType: "image/png"						
			}
		}
	]
	
	onTriggered: {		                
		var selectedItem = dataModel.data(indexPath);
		invoke.uri = selectedItem.imagePath;
		invoke.trigger("bb.action.SHARE");
	}   
}

 thanks for your help,
Laurent

Twitter : @LaurentKP
My apps
Please use plain text.
Developer
laurentC
Posts: 266
Registered: ‎02-05-2010
My Device: Blackberry Z10

Re: Share images from listview

I just tried the code. My list is not scrollable !?!!

Twitter : @LaurentKP
My apps
Please use plain text.
Developer
laurentC
Posts: 266
Registered: ‎02-05-2010
My Device: Blackberry Z10

Re: Share images from listview

OK sorry it works. I could not scroll it because the listview was behind an other container.

Twitter : @LaurentKP
My apps
Please use plain text.