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

Web and WebWorks Development

Reply
Developer
Posts: 817
Registered: ‎11-19-2009
My Device: Z10, Q10, 9900, 9790, PlayBook,
My Carrier: T-Mobile UK, Three, O2, Orange, Sunrise, Swisscom
Accepted Solution

blackberry.transport.makeAsyncCall doesn't catch errors properly

blackberry.transport.makeAsyncCall keeps generating a couple of errors at load time. Here is the message in the PlayBook debugger:

TypeError: Result of expression 'response' [null] is not an object.

 

I'm not sure what is triggering it since it's part of WebWorks and not our apps. Is there a way to find out?

--
Olivier - interfaSys ltd
Developing for BlackBerry 10 devices using the Sencha Touch framework.
Developer
Posts: 163
Registered: ‎05-06-2011
My Device: Playbook
My Carrier: Not Specified

Re: blackberry.transport.makeAsyncCall doesn't catch errors properly

Yes, even I get the same error in a different scenario. This happen when a Custom Dialog is called. I get the exact same error in debugger console.

Retired
Posts: 518
Registered: ‎07-18-2011
My Device: Bold
My Carrier: Rogers

Re: blackberry.transport.makeAsyncCall doesn't catch errors properly

Hi guys,

 

What are you trying to accomplish by calling the transport methods directly? They are WebWorks internal and need their parameters to be set up. Are you debugging on a desktop or directly off a PlayBook?

 

You can see what the existing APIs do in the existing source: https://github.com/blackberry/WebWorks-TabletOS/blob/master/js_api/blackberry.app.event/js/common/ap...



1.Please resolve your thread by clicking the "Accept as Solution" button below the post which solved your problem!
2. If any post helps you please click the button below the post(s)
Developer
Posts: 817
Registered: ‎11-19-2009
My Device: Z10, Q10, 9900, 9790, PlayBook,
My Carrier: T-Mobile UK, Three, O2, Orange, Sunrise, Swisscom

Re: blackberry.transport.makeAsyncCall doesn't catch errors properly

That's the thing, we're not calling it, we're just seeing the error when doing remote debugging and since this is an error and not a warning, this may break things at load time.

From my point of view. This is an error that should be fixed by the WebWorks team, but I'm trying to find out if there is a workaround we could apply.
--
Olivier - interfaSys ltd
Developing for BlackBerry 10 devices using the Sencha Touch framework.
Retired
Posts: 518
Registered: ‎07-18-2011
My Device: Bold
My Carrier: Rogers

Re: blackberry.transport.makeAsyncCall doesn't catch errors properly

Let me know if that resolves the issue.

Try replacing the call in the JS dispatcher of the offending API to transport.makeSyncCall from transport.makeAsyncCall. The JavaScript dispatcher of each API is located under:

 

<WebWorks Install Directory>\bbwp\ext\<Offending API>\js\common\<API Name>_dispatcher.js

 



1.Please resolve your thread by clicking the "Accept as Solution" button below the post which solved your problem!
2. If any post helps you please click the button below the post(s)
Developer
Posts: 817
Registered: ‎11-19-2009
My Device: Z10, Q10, 9900, 9790, PlayBook,
My Carrier: T-Mobile UK, Three, O2, Orange, Sunrise, Swisscom

Re: blackberry.transport.makeAsyncCall doesn't catch errors properly

The problem is that I have no idea which API is the offending one as the error message doesn't give much information.

 

I'll see if I can find the time to go trough each one.

--
Olivier - interfaSys ltd
Developing for BlackBerry 10 devices using the Sencha Touch framework.
Developer
Posts: 163
Registered: ‎05-06-2011
My Device: Playbook
My Carrier: Not Specified

Re: blackberry.transport.makeAsyncCall doesn't catch errors properly

Will both the functionalities transport.makeSyncCall and  transport.makeAsyncCall behave in the same manner? I don't feel that is the case since one is for making an asynchronous call and other one is not. So will it not tamper the normal workflow.

 

The function definitions can be found at directory  bbwp\AirAppTemplates\src\WebWorksApplicationSharedJsRepository0\sharedglobal\3_xhr.js

 


Contributor
Posts: 41
Registered: ‎07-21-2011
My Device: Superberry
My Carrier: Rogers

Re: blackberry.transport.makeAsyncCall doesn't catch errors properly

They will actually function the same.

What happens is that a synchronous XHR request is made to the implementation layer, which registers the JS callback with the AS code that implements the functionality. The synchronous XHR request then returns with a status code which indicates whether an implementation was found or not. If all is ok, the AS will execute the JS callback it received when your asynchronous event fires at some future point in time.
----------------------------------------------------------------------------------------------
I kode for cudos! Or was it the other way around?
Developer
Posts: 817
Registered: ‎11-19-2009
My Device: Z10, Q10, 9900, 9790, PlayBook,
My Carrier: T-Mobile UK, Three, O2, Orange, Sunrise, Swisscom

Re: blackberry.transport.makeAsyncCall doesn't catch errors properly

So we're back to square one and RIM still needs to fix their loader so that it doesn't crash on start.

--
Olivier - interfaSys ltd
Developing for BlackBerry 10 devices using the Sencha Touch framework.
Contributor
Posts: 41
Registered: ‎07-21-2011
My Device: Superberry
My Carrier: Rogers

Re: blackberry.transport.makeAsyncCall doesn't catch errors properly

I'm not sure that I follow. Have you tried the workaround suggested by hifetz?
----------------------------------------------------------------------------------------------
I kode for cudos! Or was it the other way around?