I\'ve developed a hybrid application using Worklight 6.1 + Dojo 1.8. The application tests out fine using Chrome \"Common & Android\". When I deploy the device to my Nexus
Worklight 6.1 uses Dojo v1.9.1-20130926, not v1.8.
You can verify this in the dojoLib created for you when adding Dojo to a Worklight project. There is a version.txt file.
There is one relevant error from the LogCat: scriptError dojo.js:21
Most relevant past questions:
I do not know if the 1.8 was a typo or not, but I would suggest to start afresh with a new Worklight project, following my example below. If this is now working, I suggest to continue onwards from there.
This is what I've done. Let me know if you're doing anything else in specific:
Added the following Dojo widgets: Heading, Button, TextBox, Slider, Carousel, CarouselItem...
In common\js\main.js, dojoInit()
is auto-updated with the required modules in the require
function:
function dojoInit() { require([ "dojo/ready", "dojo/parser", "dojox/mobile", "dojo/dom", "dijit/registry", "dojox/mobile/ScrollableView", "dojox/mobile/Button", "dojox/mobile/Heading", "dojox/mobile/TextBox", "dojox/mobile/Carousel", "dojox/mobile/CarouselItem", "dojox/mobile/SearchBox", "dojox/mobile/Slider"], > function(ready) { ready(function() { }); }); }
In both the MBS and simulator/device, I see the same:
MBS:
iOS Simulator/device:
Now if I go to the Dojo Library Requests
view and uncheck Provide Missing Dojo Resources
and re-run in Xcode, the graphics will then not load. If I re-check the option and re-run in Xcode, the graphics then load again.
Missing graphics:
To correct this I needed to re-build the project in Eclipse.
Why?
When building with Provide Missing Dojo Resources
checked, you will find the following in the HEAD of the generated HTML: <script data-dojo-config="isDebug: false, async: true, parseOnLoad: true, mblHideAddressBar: false" src=http://some-ip-address-and-path/dojo/dojo.js" type="text/javascript"></script>
This src
URL tells the application to get all Dojo resources from the dojoLib library in the server.
When unchecking Provide Missing Dojo Resources
and re-building the project in Eclipse, the src
URL changes to dojo/dojo.js
, meaning all resources will be taken from whatever is included in the Dojo library inside the application.