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: 44
Registered: ‎01-07-2013
My Device: 9300
My Carrier: blackberry
Accepted Solution

Invocation from function in QML?

Hi all,

         I need to invoke invite to BBM while clicking a button in qml,i have attached my sample code but it's not working

Button {
           text:"Invite"
           id: invite_button
            onClicked: {
            invokeQuery.updateQuery();
             }
              attachedObjects: [
                    InvokeActionItem {
                      id:invokeQuery
                      title: "Invite to BBM"
                     query {
                     invokeActionId:"bb.action.INVITEBBM"
                           uri: "pin:2100000A"
                      }
                    }  
                  ]
                }

 How to do this can anyone send me some solutions to solve this.?

 Thanks

Highlighted
Contributor
Posts: 43
Registered: ‎01-05-2013
My Device: Dev Alpha
My Carrier: Telenor Hungary

Re: Invocation from function in QML?

some examples here:

 

http://supportforums.blackberry.com/t5/Cascades-Development/InvokeActionItem-not-recognized-does-not...

--------------------------------------------------------------
If my post was helpful or it was the solution for Your problem, please don't forget to give me a like, and mark my post as a solution. Thanks!
Contributor
Posts: 44
Registered: ‎01-07-2013
My Device: 9300
My Carrier: blackberry

Re: Invocation from function in QML?

Hi

    Thanks for your reply, i have gone through this but i need to do in a button click eventSmiley Sad 

Developer
Posts: 230
Registered: ‎01-12-2013
My Device: z30
My Carrier: Mobile Vikings

Re: Invocation from function in QML?

What is it doing or what is it not doing?

 

Try

onClicked: {
     var query = invokeQuery.createObject();
     query.updateQuery();
}

 Not sure if it's necessary to create an object first. Just give it a try.

______________________________________________________
BB10-OAuth: GitHub
Contributor
Posts: 44
Registered: ‎01-07-2013
My Device: 9300
My Carrier: blackberry

Re: Invocation from function in QML?

Hi,

     Thanks for your reply, it's not working i have tried like this.!! Smiley Indifferent

ImageButton {
               text:"Invite"
                onClicked: {
                     var query = invokeQuery.createObject();
                     query.updateQuery();
                }
                  attachedObjects: [
                    InvokeActionItem {
                      id:invokeQuery
                      title: "Invite to BBM"
                     query {
                     invokeActionId:"bb.action.INVITEBBM"
                     uri: "pin:2100000A"
                      }
                    }  
                  ]
            }



Any other solutions..!!!!!
Trusted Contributor
Posts: 207
Registered: ‎05-02-2010
My Device: various
My Carrier: AT&T

Re: Invocation from function in QML?

Have you thought about trying to use a trigger?

ImageButton {
text:"Invite"
onClicked: {
invokeQuery.trigger("bb.action.INVITEBBM")
}
attachedObjects: [
InvokeActionItem {
id:invokeQuery
title: "Invite to BBM"
query {
invokeActionId:"bb.action.INVITEBBM"
uri: "pin:2100000A"
}
}
]
}
If you are the original poster (OP) and your issue is solved, please remember to click the "Accept as Solution" button so that others can more easily find it. If anyone has been helpful to you, please show your appreciation by clicking the Star on the left of their post.
Contributor
Posts: 44
Registered: ‎01-07-2013
My Device: 9300
My Carrier: blackberry

Re: Invocation from function in QML?

Hi,

     Thanks for your reply,it's not working any other solutions.!!!Smiley Sad

thanks

Trusted Contributor
Posts: 207
Registered: ‎05-02-2010
My Device: various
My Carrier: AT&T

Re: Invocation from function in QML?

Try taking a look here:

http://supportforums.blackberry.com/t5/Cascades-Development/InvokeActionItem-not-recognized-does-not...
If you are the original poster (OP) and your issue is solved, please remember to click the "Accept as Solution" button so that others can more easily find it. If anyone has been helpful to you, please show your appreciation by clicking the Star on the left of their post.
Contributor
Posts: 44
Registered: ‎01-07-2013
My Device: 9300
My Carrier: blackberry

Re: Invocation from function in QML?

Hi all,

          i have found a solution regarding  Invoking Invite to BBM in a button click,i can able to go invite page but can't able to send invitation by selecting the contacts , here is my code

Button {
            text: "Invite"
            onClicked: {
                invokeQuery.uri = "pin:210000A"
                invokeQuery.updateQuery();
            }
            attachedObjects: [
                Invocation {
                    id: invokeShare
                    query: InvokeQuery {
                        id: invokeQuery
                    }
                    onArmed: {
                         trigger("bb.action.INVITEBBM");
                        
                    }
                }
            ]
        }

 Can anyone send me some solutions 

Retired
Posts: 249
Registered: ‎07-14-2008
My Device: Not Specified

Re: Invocation from function in QML?

FYI for everyone, The InvokeActionItem has known issues where you cannot update the query once it is created. To be safe, I suggest calling a C++ method that creates a new InvokeActionItem via the builder methods, everytime you need to invoke something via InvokeActionItem or Invocation class.