<p:textEditor> onchange missing, other solutions?

UI Components for JSF
Post Reply
lastresort
Posts: 18
Joined: 07 Nov 2016, 11:14

21 Dec 2016, 15:23

We'd like to replace the editor by the new textEditor, but we can't find an option to process the value to the bean directly after it was changed.

Unfortunately both editors don't support direct p:ajax, but with the p:editor it was possible to do it with this workaround:

Code: Select all

<p:editor widgetVar="editorVar" onchange="saveEditor()" value="#{ Bean.editorValue }"/p>
<p:remoteCommand name="saveEditor" oncomplete="PF('editorVar').saveHTML()"/>
But the new p:textEditor is missing the onchange attribute, is there any other way to save the value after an blur or change event?
PF Elite 8.0.1 + PF Extensions 8.0.2 + MyFaces 2.3-next-M2 @ Quarkus 1.4.2.Final

webel
Posts: 87
Joined: 18 Sep 2010, 09:29
Location: Sydney, Australia
Contact:

21 Jul 2017, 04:36

Likewise interested.
Primefaces 6.1
JSF Mojarra 2.3.0
(Netbeans 8.2+Glassfish 4.1.1 OR Payara 4.1)
Mac OS X "Yosemite" 10.10.5 / Linux CentOS 6.7

mauromol
Posts: 26
Joined: 11 Apr 2014, 16:32

28 May 2018, 17:51

Did anyone find a solution?

patilrohana
Posts: 1
Joined: 23 Oct 2019, 16:05

23 Oct 2019, 16:26

Here is the solution,After a lot of struggle, I found below solution:
This editor is mainly built-up on quill java script libraries,so I recommend to visit https://quilljs.com/docs/quickstart/ for more information
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
We manually have to find the textEditor's object using java script then use on() function to get work-done like onChange()

PF('logEditor').editor.on('text-change',function(){
alert('hello World');
});

In above code, Alert will trigger once user start type (first keyPress) on p: textEditor. Put this solution in your page loading code.

Thanks,
Rohan Patil

Melloware
Posts: 3716
Joined: 22 Apr 2013, 15:48

25 Oct 2019, 21:20

this already is baked into the TextEditor?

See: https://github.com/primefaces/primeface ... js#L94-L97
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 21 guests