对话框中的Primefaces编辑器不起作用 [英] Primefaces editor in a dialog doesn't works

查看:118
本文介绍了对话框中的Primefaces编辑器不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个对话框来插入一些字段,其中之一是p:editor,显示该字段时会被禁用,而未被禁用.一个奇怪的"true"字符串显示在编辑器主体中. 代码:

I have a dialog to insert some fields, one of those is a p:editor which is displayed like it is disabled while it is not. A strange "true" string is displayed into the editor body. The code:

<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>

显示问题的对话框图像:

An image of the dialog that shows the problem:

如您所见,编辑器就像已禁用,并在其主体中显示"true".

As you can see the editor is like disabled and shows "true" into its body.

推荐答案

我解决了这个问题. 我只是将update=":insertForm"放到了打开对话框的commandButton中,并且它起作用了.

I solved this issue. I've just put update=":insertForm" into the commandButton that opens the dialog and it works.

<p:commandButton id="insertButton" value="Inserisci" oncomplete="dlg1.show();" update=":insertForm" />

这篇关于对话框中的Primefaces编辑器不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆