I am working on integrating online whiteboard project, where the source code is found here. It is originally written for primefaces version 2.2.1 but we want to integrate with our main application which using latest primefaces version 3.4. After changing to latest version, we get lot of javascript errors and few of them are pasted below.
What we need to look for if we have to upgrade from version 2.2.1 to 3.4 of primefaces?
Errors
Uncaught TypeError: Object [object Object] has no method 'dialog' whiteboard.js.jsf:67
Uncaught ReferenceError: whiteboardDesigner is not defined :8080/emyed-whiteboard/whiteboard/workplace/fc4b4afe-f96f-442b-a0d0-bb29a46836dc/9fb61421-8c0f-4cbb-b0f7-96dc5e31bd56/:73
Resource interpreted as Image but transferred with MIME type text/css: "http://localhost:8080/emyed-whiteboard/javax.faces.resource/whiteboard.css.jsf?ln=css". jquery.js.jsf:14
Uncaught ReferenceError: whiteboardDesigner is not defined :8080/emyed-whiteboard/whiteboard/workplace/fc4b4afe-f96f-442b-a0d0-bb29a46836dc/9fb61421-8c0f-4cbb-b0f7-96dc5e31bd56/:82
As per above errors, whiteboardDesigner is not defined. But it is already defined in one of the javascript.
Html pages where it get errors
<button type="button" title="Draw Free Line" onclick="whiteboardDesigner.switchToMode('freeLineMode', 'pointer')" class="toolboxItem ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary" value="Draw Free Line">
Uncaught ReferenceError: whiteboardDesigner is not defined
Javascript
// create a global whiteboard designer instance
whiteboardDesigner = new WhiteboardDesigner(new WhiteboardConfig(), whiteboardId, user, pubSubUrl, pubSubTransport);
Found out that, we have included jQuery libraries in the resource directory. Below two actions where taken to resolve the issue.