I am trying to add an external javascript code to add some effects to the gwt generated part of the page.
I was provided with some static html/css from the designer, and it uses javascript to add the desired effects to the page.
Our app uses MVP architecture as described on the official GWT pages, so for the initial test I just put the static html into an UiBinder xml file of a desired view. The output was nice, and the page looked the same as the provided one when opened in the browser. The only problem is that the javascript effects don't work.
Specifically, it is the accordion effect of the Rico framework. When a mouse is over a list element, it should change colour. And when a user clicks on the list element, it expands to show more details (like a tree widget).
The script inclusion in the module's host page looks like this:
<head>
...
<script src="javascript/rico.js" type="text/javascript"></script>
<script type='text/javascript'>
Rico.loadModule('Accordion');
Rico.onLoad( function() {
new Rico.Accordion( $$('div.panelheader'), $$('div.panelContent'),
{panelHeight:66, hoverClass: 'mdHover', selectedClass: 'mdSelected'});
});
</script>
...
</head>
All of the .js files that were provided by the designer are in the war/javascript
folder, and when inspected in firebug (in both development mode and tomcat deployed), the browser seems to see those files. I can click on the src="../...js"
and the browser does open the correct files.
Where could the problem be? Since the static page works and the effects are visible, i suppose the problem was in the merge with the GWT. Did I do something wrong with the inclusion, or is the external javascript having problem with accesing the gwt generated parts of the page?