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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 148
Registered: ‎01-08-2013
My Device: 9860
My Carrier: Airtel
Accepted Solution

Invoke problem in BB10

[ Edited ]

Hi All,

    In my project I have done to invoke webbrowser. There is three buttons with three different URL. But when I click on facebook button it first time does not give any result but second time click it give correct result. then I click on tweeter button it opens facebook URL. Then I click on youtube buttons it opens tweeter URL. I can not understand where my problem.

 

My code is

 

ImageButton {
                id: facebook
                defaultImageSource: "asset:///images/768/mainfacebook_768.png"
                pressedImageSource: "asset:///images/768/mainfacebook_768.png"
                disabledImageSource: "asset:///images/768/mainfacebook_768.png"
                layoutProperties: AbsoluteLayoutProperties {
                    positionX: 538.6
                    positionY: 1213.2
                }
                onClicked: {
                    invokeShare.query.uri = "https://www.facebook.com/";
                    invokeShare.trigger("bb.action.OPEN")
                }
            }
            ImageButton {
                id: twitter
                defaultImageSource: "asset:///images/768/maintwitter_768.png"
                pressedImageSource: "asset:///images/768/maintwitter_768.png"
                disabledImageSource: "asset:///images/768/maintwitter_768.png"
                layoutProperties: AbsoluteLayoutProperties {
                    positionX: 611.5
                    positionY: 1213.7
                }
                onClicked: {
                    invokeShare.query.uri = "https://twitter.com/";
                    invokeShare.trigger("bb.action.OPEN")
                }
            }
            ImageButton {
                id: youtube
                defaultImageSource: "asset:///images/768/mainyoutube_768.png"
                pressedImageSource: "asset:///images/768/mainyoutube_768.png"
                disabledImageSource: "asset:///images/768/mainyoutube_768.png"
                layoutProperties: AbsoluteLayoutProperties {
                    positionX: 689.2
                    positionY: 1214.2
                }
                onClicked: {
                    invokeShare.query.uri = "http://m.youtube.com";
                    invokeShare.trigger("bb.action.OPEN")
                }
            }
          
            attachedObjects: [
                Invocation {
                    //property string videoUrl
                    id: invokeShare
                    query.onUriChanged: {
                        invokeShare.query.updateQuery();
                    }
                    query {
                        mimeType: "text/html"
                        //uri: ""
                        invokeActionId: "bb.action.OPEN"
                    }

                }
            ]

 Please tell me where my problem.

 

Thanks & Regards

          Sanjit

New Contributor
Posts: 7
Registered: ‎02-24-2013
My Device: BlackBerry Z10 & Q10
My Carrier: Maxis

Re: Invoke problem in BB10

Hi,

 

You can try my suggested method:

 

 attachedObjects: [
                Invocation {
                    //property string videoUrl
                    id: invokeShare1
                   
                    query: InvokeQuery {
                     mimeType: "text/html"
                     uri: "https://www.facebook.com/"
                     invokeActionId: "bb.action.OPEN"
                   }

                },
                Invocation {
                    //property string videoUrl
                    id: invokeShare2
                   
                    query: InvokeQuery {
                     mimeType: "text/html"
                     uri: "https://twitter.com/"
                     invokeActionId: "bb.action.OPEN"
                   }

                },
                Invocation {
                    //property string videoUrl
                    id: invokeShare3
               
                    query: InvokeQuery {
                     mimeType: "text/html"
                     uri: "http://m.youtube.com"
                     invokeActionId: "bb.action.OPEN"
                   }

                }
            ]

 Then call the invocation objects respectively:

onClicked: {
   invokeShare1.trigger("bb.action.OPEN")
}

 

Regards,

Syam

Developer
Posts: 148
Registered: ‎01-08-2013
My Device: 9860
My Carrier: Airtel

Re: Invoke problem in BB10

Hi man202,

    Your code is static. But my requirement is dynamic. When use list view their is more list this time what will you do?

 

 

 

New Contributor
Posts: 7
Registered: ‎02-24-2013
My Device: BlackBerry Z10 & Q10
My Carrier: Maxis

Re: Invoke problem in BB10

Hi Sanjit,

 

You can perform invocation from inside c++ 

 

InvokeManager invokeManager;
InvokeRequest request;
request.setMimeType("text/html");
request.setAction("bb.action.OPEN");


request.setUri(QUrl("YOUR URL HERE"));
InvokeTargetReply *reply = invokeManager.invoke(request);

 

Regards,

Syam

Developer
Posts: 148
Registered: ‎01-08-2013
My Device: 9860
My Carrier: Airtel

Re: Invoke problem in BB10

[ Edited ]

Hi man202,

     Your code is working perfectly.Smiley Happy

Thanks & Regards

          Sanjit