【发布时间】:2013-02-05 15:15:10
【问题描述】:
我有一个对话框来插入一些字段,其中一个是 p:editor,它显示为好像它被禁用而它不是。一个奇怪的“真”字符串显示在编辑器主体中。 代码:
<p:dialog id="insertPanel" header="Inserisci" widgetVar="dlg1" appendToBody="true" modal="true">
<h:form id="insertForm">
<h:panelGrid columns="2">
<h:outputLabel value="Nome: " for="name" />
<p:inputText id="name" value="#{controller.name}" />
<h:outputLabel value="Oggetto: " for="subject" />
<p:inputText id="subject" value="#{controller.subject}" />
<h:outputLabel value="Visibilità: " for="visibility" />
<p:inputText id="visibility" value="#{controller.visibility}" />
<h:outputLabel value="Testo: " for="text" />
<p:editor id="text" value="#{controller.text}" width="600"/>
<f:facet name="footer">
<p:commandButton actionListener="#{controller.insert}" value="Inserisci" />
</f:facet>
</h:panelGrid>
</h:form>
</p:dialog>
显示问题的对话框图像:
如您所见,编辑器就像被禁用并在其正文中显示“true”。
【问题讨论】:
-
如果有帮助,我注意到如果我按下插入按钮而不插入其他字段,表单会返回验证错误,然后编辑器才开始工作!我不明白为什么!
-
您是否将
<p:dialog>放置在任何其他PrimeFaces 组件中,例如<p:layout>? -
是的,它在
<p:layout>中,但有appendToBody="true",它应该不会修复任何问题? -
这里我们有一个类似的问题stackoverflow.com/questions/24743084/…,但在这种情况下是重新渲染编辑器时
标签: jsf-2 primefaces editor