Tuesday, July 16, 2013

Upgrading the BIRT Web Viewer Example prototype.js version.

The latest version of BIRT (4.2) comes with an OLD version of prototype.js. 1.4.. It so old it doesn't even show on the prototype.js page anymore. If you want to use jquery you also need to upgrade the prototype.js version.

But if you upgrade the prototype.js version to 1.7 the viewer will suddenly stop working properly including things like the progress bar not showing, and being unable to click on stuff.

To fix it, you need to follow the advice in this article which mentions some things that have changed between 1.4 and 1.5. Specifically this part which talks about the backwards compatibility:


====================
Backward compatibility change: toggle(), show(), and hide(), as well as Field.clear() and Field.present(), no longer take an arbitrary number of arguments. Before upgrading to Prototype 1.5, check the various JS files in Birt/webcontent/birt/ajax for instances like this:

Element.toggle('page', 'sidebar', 'content') // Old way; won't work in 1.5
['page', 'sidebar', 'content'].each(Element.toggle) // New way; 1.5-compatible


Element.show('page', 'sidebar', 'content') // Old way; won't work in 1.5
['page', 'sidebar', 'content'].each(Element.show) // New way; 1.5-compatible


Element.hide('page', 'sidebar', 'content') // Old way; won't work in 1.5
['page', 'sidebar', 'content


====================

No comments: