I am using JSF 2.2 with Primefaces 6.2.
My problem is that the container that has a p:textEditor
of primefaces has the property display: none;
at the beginning, when the change with JavaScript to inline
shows me a pair of select
, without more, as if the JavaScript of the component had not been rendered.
If someone has an idea to solve it or knows what is the problem ...
Thanks in advance!
EDITION
Code .xhtml (is in a ui: composition)
<div class="col-g-12">
<p:textEditor
id="textEditorSendMail"
placeholder="#{msg.management_mail_send_content}"
value="#{managementMailBean.textNewMail}">
<f:facet name="toolbar">
<span class="ql-formats">
<button class="ql-bold"></button>
<button class="ql-italic"></button>
<button class="ql-underline"></button>
<button class="ql-strike"></button>
</span>
<span class="ql-formats">
<select class="ql-font"></select>
<select class="ql-size"></select>
</span>
</f:facet>
</p:textEditor>
</div>
JavaScript code
function show_send_message(event) {
if (event.target.parentNode.id == "formMailToolbarMessageActions:btnNewMail") {
document.getElementById("mail_show").style.display = "none";
document.getElementById("mail_send").style.display = "inline";
} else {
document.getElementById("mail_show").style.display = "inline";
document.getElementById("mail_send").style.display = "none";
}
}
CSS Code
#mail_send{
display: none;
}
At first the editor is with the display none, then I play with a button to "show it" and "hide it"