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
maheshkumar1990
Posts: 44
Registered: ‎01-07-2013
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

Please use plain text.
Contributor
chriske86
Posts: 43
Registered: ‎01-05-2013
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!
Please use plain text.
Contributor
maheshkumar1990
Posts: 44
Registered: ‎01-07-2013
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 event:smileysad: 

Please use plain text.
Developer
Curahee
Posts: 206
Registered: ‎01-12-2013
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.

______________________________________________________
beRail: BlackBerry World - GitHub
Mobile Vikings: BlackBerry World - GitHub
Park in Brussels: BlackBerry World
Please use plain text.
Contributor
maheshkumar1990
Posts: 44
Registered: ‎01-07-2013
My Carrier: blackberry

Re: Invocation from function in QML?

Hi,

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

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..!!!!!
Please use plain text.
Trusted Contributor
Sith_Apprentice
Posts: 207
Registered: ‎05-02-2010
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.
Please use plain text.
Contributor
maheshkumar1990
Posts: 44
Registered: ‎01-07-2013
My Carrier: blackberry

Re: Invocation from function in QML?

Hi,

     Thanks for your reply,it's not working any other solutions.!!!:smileysad:

thanks

Please use plain text.
Trusted Contributor
Sith_Apprentice
Posts: 207
Registered: ‎05-02-2010
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.
Please use plain text.
Contributor
maheshkumar1990
Posts: 44
Registered: ‎01-07-2013
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 

Please use plain text.
BlackBerry Development Advisor
shaque
Posts: 218
Registered: ‎07-14-2008

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.

Please use plain text.