【发布时间】:2016-04-19 16:44:55
【问题描述】:
我正在尝试通过单击 primefaces 命令链接来更新窗口的内容:
<p:commandLink oncomplete="if( #{documentController.documentAlreadyOpenedInExternalWindow} ) window.open('previewDocument.xhtml?documentId=#{documentController.documentId(task)}', 'new');"
但条件检查似乎永远不会被再次测试?
<p:commandLink oncomplete="if( true ) window.open('previewDocument.xhtml?documentId=#{documentController.documentId(task)}', 'new');"
上面的语句当然会在每次点击时打开窗口..
我该如何解决这个问题?
Primefaces 5.2
【问题讨论】:
-
通过更新 commandLink 本身...
-
@Kukeltje 试过了,但似乎没有用。
-
“似乎没有工作”...会发生什么?响应是什么样的?你到底做了什么?
-
@Kukeltje 我已经修复了它,我将在今天晚些时候发布解决方案。但是发生了什么:我只想“更新”(打开)已经打开的屏幕(参见布尔条件)。即使在后端为 true,该布尔值也从未变为 true,因为链接没有更新,因为初始打开发生在 target="new" 的 ajax=false commandLink 中。正如我所说,我将在今天晚些时候发布我的解决方案。
标签: jsf primefaces