Primefaces从版本2.2.1更改为3.4?

时间:2012-10-07 00:58:14

标签: javascript jquery primefaces

我正在整合在线白板项目,其中找到源代码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 defined

的Javascript

// create a global whiteboard designer instance
whiteboardDesigner = new WhiteboardDesigner(new WhiteboardConfig(), whiteboardId, user, pubSubUrl, pubSubTransport);

2 个答案:

答案 0 :(得分:0)

除了PrimeFaces blog,PrimeFaces保留migration guide on their Google code site

我有点担心看到您发布的代码。它看起来像Java,而不是JavaScript。 (虽然我不是JavaScript专家。)

答案 1 :(得分:0)

发现,我们在资源目录中包含了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