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
Posts: 656
Registered: ‎02-03-2010
My Device: Z10 LE
My Carrier: Rogers
Accepted Solution

Invocation Query Issue on 10.1

I have this code that was working fine in QML on 10.0 but now on 10.1 it is causing an error  that query is a read-only property.

 

 Invocation {

            id: invokeReview

            query: InvokeQuery {

                mimeType: "application/x-bb-appworld"

                uri: "appworld://content/9081"

            }

        },

 

 

Any idea why this is now a problem and how to set the query in QML.


Steven Kader at JaredCo
   Follow me on Twitter    |     Mipixi.com :  Web App for Photo Sharing
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Invocation Query Issue on 10.1

I've never quite understood how anyone got that to work before, because I've always had the read-only property error.

 

Basically the InvokeQuery object already exists and is assigned to the query property, so you want to just modify its contents.

 

Either do query { mimeType: "..." }  (without the colon or InvokeQuery part), or just assign to the individual fields directly, as in query.mimeType: "..." and query.uri: "...".


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 656
Registered: ‎02-03-2010
My Device: Z10 LE
My Carrier: Rogers

Re: Invocation Query Issue on 10.1

I understand. Thanks.

Steven Kader at JaredCo
   Follow me on Twitter    |     Mipixi.com :  Web App for Photo Sharing
Developer
Posts: 656
Registered: ‎02-03-2010
My Device: Z10 LE
My Carrier: Rogers

Re: Invocation Query Issue on 10.1

This is working now in 10.1 but doesn't compile in 10.0 .... not sure what I am doing wrong.

 

 Invocation {

            id: invokeReview

          

             query.mimeType: "application/x-bb-appworld"

             query.uri: "appworld://content/9081"

            

        },

 

 


Steven Kader at JaredCo
   Follow me on Twitter    |     Mipixi.com :  Web App for Photo Sharing
Developer
Posts: 64
Registered: ‎07-15-2008
My Device: Z10
My Carrier: Rogers

Re: Invocation Query Issue on 10.1

This code works for me on 10.0. I don't think there is a universal way to do this.. it will always break on one sdk or another.

 

        Invocation {
            id: invokeNotificationSettings
            query: InvokeQuery {
            //query { //use on 10.1 builds
                invokeTargetId: "sys.settings.target"
                mimeType: "settings/view"
                uri: "settings://notification"
            }
        }