gpt4 book ai didi

jsf - 从 PrimeFaces 7 更新到 8 后,对话框中的 PrimeFaces 文本编辑器出现问题

转载 作者:行者123 更新时间:2023-12-04 09:15:27 24 4
gpt4 key购买 nike

我有一个带有 PrimeFaces 的 JSF 应用程序,我正在将其更新到 PrimeFaces 版本 8(当前使用版本 7)。
更新后,我在对话框中的 TextEditor 出现了奇怪的行为。我使用 commandLink 打开对话框并更新对话框以刷新其内容。当我这样做时,我在 JavaScript 控制台上收到错误消息。

texteditor.js.xhtml?ln=primefaces&v=8.0:7 Uncaught TypeError: Cannot read property 'innerHTML' of null
at e.value (texteditor.js.xhtml?ln=primefaces&v=8.0:7)
at new e (texteditor.js.xhtml?ln=primefaces&v=8.0:7)
at texteditor.js.xhtml?ln=primefaces&v=8.0:7
at Array.map (<anonymous>)
at e.value (texteditor.js.xhtml?ln=primefaces&v=8.0:7)
at e.value (texteditor.js.xhtml?ln=primefaces&v=8.0:7)
at e.value (texteditor.js.xhtml?ln=primefaces&v=8.0:7)
at texteditor.js.xhtml?ln=primefaces&v=8.0:7
at Array.forEach (<anonymous>)
at e.value (texteditor.js.xhtml?ln=primefaces&v=8.0:7)
错误来自代码:
a(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "selectItem", this).call(this, t, n), t = t || this.defaultItem, this.label.innerHTML = t.innerHTML
其中 t 为空,因此 t.innerHTML 会引发错误。
但是 - 如果我只打开对话框但不更新它 - 一切正常。
我创建了一个最小的样本。第一个 fink 工作正常,第二个链接产生错误。
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:p="http://primefaces.org/ui"
xmlns:h="http://java.sun.com/jsf/html"
>

<h:head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<title>test</title>
</h:head>
<h:body>
<h:form id="contentForm">
<p:commandLink value="works"
oncomplete="PF('dialogTemplateSendMailToPersonVar').show()"/>
<br/>
<p:commandLink value="does not work"
oncomplete="PF('dialogTemplateSendMailToPersonVar').show()"
update=":templatePersonSendMailForm"/>
</h:form>

<p:dialog id="dialogTemplateSendMailToPersonId" widgetVar="dialogTemplateSendMailToPersonVar" dynamic="true">
<h:form id="templatePersonSendMailForm">

<p:textEditor id="txtTemplateText" />

</h:form>
</p:dialog>
</h:body>

</html>
在这个示例中,更新是无用的,但会产生与我的整个页面相同的错误,其中我有填充编辑器和对话框中其他字段的支持 bean。
有没有人经历过类似的事情或知道如何解决这个问题?我查看了 PrimeFaces 8.0.x 版本的发行说明,但没有发现 TextEditor 有任何问题。不更新对话框不是一个选项;-)

最佳答案

好的,问题已在 6.2 中修复:https://github.com/primefaces/primefaces/issues/2802
然而,当 QuillJS 1.3.7 升级为安全 CVE 时,此更改丢失。
我刚刚提交了一个 PR,希望能在 8.0.4 和 9.0 中解决这个问题。
公关:https://github.com/primefaces/primefaces/issues/2802

关于jsf - 从 PrimeFaces 7 更新到 8 后,对话框中的 PrimeFaces 文本编辑器出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63247737/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com