use <p:contextmenu> with <p:editor>

Asked

Viewed 107 times

2

I tried to use the contextmenu of Primefaces with the Editor component, but it doesn’t work. The menu only appears if you right-click on the toolbars. The Editor component body takes the name of the id concatenated with _input I tried to use this in the attribute for of the component contextmenu but then the page does not open because it is not possible to locate the id which is logical because it will only exist after the process of parser jsf.

<p:editor id="e" 
          height="430"
          widgetVar="editorHtml"
          value="#{m.texto}" />
<p:contextMenu for="e">
    <p:menuitem value="Teste" />
</p:contextMenu>

Would anyone know to do the contextmenu work with the editor?

  • I created a page and tried to fix it. I couldn’t. It’s related to <iframe> created by <p:editor>. I think your problem can be solved with Javascript.

  • Thank you very much Rodrigo for your time and help! The answer I got from one of the Primefaces developers: "It’s not possible". But as you said I think I can solve with JS, but in case I will change strategy and try a different approach. Thanks again.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.