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
Regular Contributor
Posts: 75
Registered: ‎05-31-2013
My Device: 9900
My Carrier: Ufone
Accepted Solution

sharing text using share card

hi

i want to share text using share card

but i am facing some problem

 

i have a list view, after loading data to listview, i am getting that data to some property, and then passing data for sharing

 

but unable to see that data , but if set the text of some label, i can see that text

 

 ListView {
                
                id: myListView1
                property string p_sharing : ""
                dataModel: dataModel1
				
                // Use a ListItemComponent to determine which property in the
                // data model is displayed for each list item
                listItemComponents: [
                    ListItemComponent {
                        id: listiemm
                        type: "item"
                        
                        Container {
                        //    property real p_font_size: 10
                            id:mainlist
                            
                            rightPadding: 20
                            leftPadding: 20
                            horizontalAlignment: HorizontalAlignment.Center
                            verticalAlignment: VerticalAlignment.Center
                            layout: StackLayout {
                                orientation: LayoutOrientation.TopToBottom
                            
                            }
							
							 Label {
                                id: title
                                horizontalAlignment: HorizontalAlignment.Right
                                verticalAlignment: VerticalAlignment.Top
                               text: ListItemData.title                              
                                multiline: true
                                onTextChanged: {
                                    mainlist.ListItem.view.p_sharing =title.text
                                    console.log("news Title label --->"+ mainlist.ListItem.view.p_sharing)
                                }
                            }
							}
                           

 outside the list, i have my sharing button, and one label

 

  ImageButton {
                    
                    id: btnshare1
                    onClicked: {
                        share1.trigger("bb.action.SHARE")
                        
                    
                    }
                    
                    attachedObjects: [
                        Invocation {
                            id: share1
                            
                            query {
                                
                                mimeType: "text/plain; charset=utf-8"
                                invokeActionId: "bb.action.SHARE"
                                data: ss1.encodeQString(myListView1.p_sharing) ;
                             //   data:myListView1.p_sharing
                            }
                            
                          
                        }
                    
                    ]
                    defaultImageSource: "asset:///images/list.png"
                    pressedImageSource: "asset:///images/list.png"
                    disabledImageSource: "asset:///images/list.png"
                
                }
                attachedObjects: [
                    
                    WebImageView {
                        id: ss1
                    }
                ]

 and here is label

 

Label {
                id: lbl
                text:"abc"+ myListView1.p_sharing
                
                horizontalAlignment: HorizontalAlignment.Center
            }

 i can see the property value in label, but not seeing the text in sharing card

 

any help ?

Regular Contributor
Posts: 75
Registered: ‎05-31-2013
My Device: 9900
My Carrier: Ufone

Re: sharing text using share card

can any body help me ?

i can view that text on label, but unable to share

Developer
Posts: 827
Registered: ‎10-16-2012
My Device: Red Z10
My Carrier: Rogers

Re: sharing text using share card

TheMarco posted a tutorial on how to do this a few months back

 

https://forrst.com/posts/Adding_Social_Sharing_through_Invocation_to_your-Fmz

Highlighted
Regular Contributor
Posts: 75
Registered: ‎05-31-2013
My Device: 9900
My Carrier: Ufone

Re: sharing text using share card

i have seen that link before, but doesn't implement that

 

now i have implemented that link

it works Smiley Happy