eaCmg
eaCmg

Reputation: 13

IBM Worklight 6.0 - How to include Dojo patch with pre-built Dojo layers?

Developing Worklight 6.0 applications with Dojo 1.9, we're encountering some page navigation problems on Galaxy SII, SIII, Note devices with running Android v4.1.2 (very common).

We see these issues were resolved by Dojo patch #17164.
This patch is not included in Worklight's default Dojo build.

We tried to include it by placing the files in the project's dojox\mobile folder but with no effect - we guess it is being overwritten by unpatched classes during build.

Is there any other way to include/define this patch? We prefer to avoid custom building Dojo ourselves to keep up with WL versions.

Upvotes: 1

Views: 704

Answers (3)

Ken Vernaillen
Ken Vernaillen

Reputation: 859

https://dl.dropboxusercontent.com/u/40842201/Worklight%20Samsung%20fix/mobile-ui-layer.js

Try to use this 'mobile-ui-layer.js' in your www/layers folder. Just copy the file and recompile the application.

The fix is based on the following problem:

Upvotes: 0

nsand
nsand

Reputation: 236

Since you would like to avoid custom building Dojo, an alternative may be to remove the www/layers/mobile-ui-layers.js from your project and rely on the Dojo Library project providing resources during development. You can then place the updated the original files in the Dojo Library project and utilize the Mobile Browser Simulator. When deploying to the device, however, you must then place all of the application's required resources that were once part of the mobile-ui-layers into your project's www/ directory, maintaining the appropriate directory structure.

For information on the Dojo Library project and finding out which Dojo resources are requested by an application, please see the Worklight Studio Infocenter Document Worklight Dojo library project setup.

If you do decide to venture and perform a custom Dojo build, you can rebuild the mobile-ui-layers.js file to use the patched files using the Dojo Build Factory.

Upvotes: 1

Craig Swing
Craig Swing

Reputation: 8162

I have used monkey patching to accomplish what you are trying to do.

require(['dojox/mobile/css3'], function(css3) {    
    css3.prototype.name = function(p, hyphen) {
        // put your patched version of the function here.
    };
});

You will need to make sure this code gets executed before any code that needs to use the patched version gets called.

You will also be copying code from the original function. Every time you upgrade Dojo or Worklight, you will need to evaluate whether the patch is still required or if the patch needs to be modified because of changes made to the original function that may not be part of the patch.

http://en.wikipedia.org/wiki/Monkey_patch

Is "monkey patching" really that bad?

Upvotes: 0

Related Questions