Topic
  • 4 replies
  • Latest Post - ‏2013-01-03T16:51:54Z by LaksSundar
SystemAdmin
SystemAdmin
2327 Posts

Pinned topic Dojox.app and Dojox.mobile.app framework support in worklight 5.0.5

‏2012-12-25T17:09:56Z |
I had tried to port an application written in dojox.app to Worklight. When the application startup in iOS, it just show blank page. The XCode console show ERROR error JSON.stringify()ing argument: TypeError: JSON.stringify cannot serialize cyclic structures.

I had also tried to port another application written in dojox.mobile.app to Worklight. The same scenario happen.

My question is dojox.app and dojox.mobile.app supported in Worklight 5.0.5?

If yes, is there something that I had missed? Is there any sample that is build on the two app framework?
  • SystemAdmin
    SystemAdmin
    2327 Posts

    Re: Dojox.app and Dojox.mobile.app framework support in worklight 5.0.5

    ‏2012-12-25T20:29:53Z  
    If you're talking about Dojo Mobile (http://dojotoolkit.org/features/mobile) I believe it should work as expected.

    Here's a Sample Worklight Project using Dojo Mobile:

    IBM Worklight Starter application with Dojo Mobile
    ftp://public.dhe.ibm.com/software/mobile-solutions/worklight/docs/v505/WorklightStarter_DojoMobile.zip

    More about Dojo Mobile here:
    https://www.ibm.com/developerworks/mobile/worklight/getting-started/#dojo-mobile

    Regarding the JSON.stringify error take a look at this:
    http://stackoverflow.com/a/9382383/186909

    Someone asked a similar question here, but regarding the difference between server-side JavasScript in Adapter and client-side JavaScript in Webkit (or some other specific JS Engine):
    http://www.ibm.com/developerworks/forums/thread.jspa?threadID=464615
  • SystemAdmin
    SystemAdmin
    2327 Posts

    Re: Dojox.app and Dojox.mobile.app framework support in worklight 5.0.5

    ‏2012-12-26T03:02:58Z  
    If you're talking about Dojo Mobile (http://dojotoolkit.org/features/mobile) I believe it should work as expected.

    Here's a Sample Worklight Project using Dojo Mobile:

    IBM Worklight Starter application with Dojo Mobile
    ftp://public.dhe.ibm.com/software/mobile-solutions/worklight/docs/v505/WorklightStarter_DojoMobile.zip

    More about Dojo Mobile here:
    https://www.ibm.com/developerworks/mobile/worklight/getting-started/#dojo-mobile

    Regarding the JSON.stringify error take a look at this:
    http://stackoverflow.com/a/9382383/186909

    Someone asked a similar question here, but regarding the difference between server-side JavasScript in Adapter and client-side JavaScript in Webkit (or some other specific JS Engine):
    http://www.ibm.com/developerworks/forums/thread.jspa?threadID=464615
    Sorry, I am not talking about Dojo Mobile. I know dojo mobile work in WorkLight.

    I should have been more specified. What I am referring to is the framework describe here
    http://dojotoolkit.org/reference-guide/1.8/dojox/mobile/app.html

    There are few samples provide in the dojo distribution, under the dojox/mobile/tests directory, eg:
    http://download.dojotoolkit.org/release-1.8.3/dojo-release-1.8.3/dojox/mobile/tests/simpleApp/

    For the dojox.app framework, I am referring to this:
    http://dojotoolkit.org/reference-guide/1.8/dojox/app.html

    Samples are provided in the dojo, under the dojox/app/tests directory, eg:
    http://download.dojotoolkit.org/release-1.8.3/dojo-release-1.8.3/dojox/app/tests/simpleModelApp/
  • berstler
    berstler
    1 Post

    Re: Dojox.app and Dojox.mobile.app framework support in worklight 5.0.5

    ‏2013-01-03T15:44:28Z  
    While Worklight 5.0.5 does not provide explicit tooling for dojox.mobile.app, I can't think of any reason why it shouldn't theoretically work.

    I searched around a little about this particular error and found that it seems to be a rather common occurrence on iOS.

    http://stackoverflow.com/questions/9382167/serializing-object-that-contains-cyclic-object-value
    http://community.phonegap.com/nitobi/topics/json_stringify_cannot_serialize_cyclic_structures
    http://hackerheart.com/post/30996200054/typeerror-json-stringify-phonegap-sencha

    The solution or workaround to this problem depends on which code is actually calling JSON.stringify(). Please have a look at the above reports and their solutions to see if any suit your situation. However, if JSON.stringify() is called from deep within a third-party library, you may need to take it up with the maintainer of the library. That being said, if the offending code is within Dojo and you are using the version of Dojo that ships with Worklight Studio, then feel free to open a PMR to have the issue addressed by IBM support.
  • LaksSundar
    LaksSundar
    13 Posts

    Re: Dojox.app and Dojox.mobile.app framework support in worklight 5.0.5

    ‏2013-01-03T16:51:54Z  
    • berstler
    • ‏2013-01-03T15:44:28Z
    While Worklight 5.0.5 does not provide explicit tooling for dojox.mobile.app, I can't think of any reason why it shouldn't theoretically work.

    I searched around a little about this particular error and found that it seems to be a rather common occurrence on iOS.

    http://stackoverflow.com/questions/9382167/serializing-object-that-contains-cyclic-object-value
    http://community.phonegap.com/nitobi/topics/json_stringify_cannot_serialize_cyclic_structures
    http://hackerheart.com/post/30996200054/typeerror-json-stringify-phonegap-sencha

    The solution or workaround to this problem depends on which code is actually calling JSON.stringify(). Please have a look at the above reports and their solutions to see if any suit your situation. However, if JSON.stringify() is called from deep within a third-party library, you may need to take it up with the maintainer of the library. That being said, if the offending code is within Dojo and you are using the version of Dojo that ships with Worklight Studio, then feel free to open a PMR to have the issue addressed by IBM support.
    We had a similar issue but then noticed that it was because of DOJO include dojo/domReady! The app was working fine in mobile web but won't work in iOS Simulator/ devices. Are you facing a similar issue?