我正在集成在线白板项目,其中的源代码发现here。它最初是为primefaces版本2.2.1编写的,但我们希望与使用最新的primefaces版本3.4的主应用程序集成。在切换到最新版本后,我们得到了很多javascript错误,其中一些错误被粘贴在下面。如果我们必须从2.2.1版升级到3.4版的primefaces,我们需要寻找什么?
错误
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根据上述错误,未定义whiteboardDesigner。但是它已经在一个javascript中定义了。
出现错误的Html页面
<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 definedJavascript
// create a global whiteboard designer instance
whiteboardDesigner = new WhiteboardDesigner(new WhiteboardConfig(), whiteboardId, user, pubSubUrl, pubSubTransport);发布于 2012-10-08 23:37:15
发现,我们已经在资源目录中包含了jQuery库。采取以下两项措施来解决问题。
1.Since primefaces 3.4 comes with latest version of jQuery library, we have removed the library which we added in the resource dir. This have resolved the issue.
2. Added jQuery-UI to the resource dir for dialog function to work发布于 2012-10-07 19:47:25
除了PrimeFaces blog,PrimeFaces还保留了一个migration guide on their Google code site。
看到你发布的代码,我有点担心。它看起来像Java,而不是JavaScript。(不过我不是JavaScript专家。)
https://stackoverflow.com/questions/12765217
复制相似问题