Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Primefaces editor in a dialog doesn't works

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:

Editor in dialog problem

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

like image 343
Paolo Dragone Avatar asked Feb 20 '13 14:02

Paolo Dragone


2 Answers

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" />
like image 118
Paolo Dragone Avatar answered Nov 13 '22 09:11

Paolo Dragone


Try adding showEffect="fade" to dialog component.

like image 40
Can Yegane Avatar answered Nov 13 '22 08:11

Can Yegane