Page 1 of 1

p:editor and execCommand

Posted: 02 Feb 2011, 18:33
by jterstiege
Hi,

is there a way to call execCommand (as supported by the original cleditor) on the Primefaces p:editor?

What I'm trying to achieve is either:

a) replace the currently selected text with another text or
b) insert a new text at the current cursor position

Re: p:editor and execCommand

Posted: 02 Feb 2011, 18:50
by cagatay.civici
Client side api of cleditor is at;

http://premiumsoftware.net/cleditor/doc ... arted.html

There is execCommand there, maybe it will help.

widgetVar.editor will give you cleditor instance.

Re: p:editor and execCommand

Posted: 03 Feb 2011, 10:39
by jterstiege
Thanks, it's working fine now.

Re: p:editor and execCommand

Posted: 19 May 2011, 21:26
by crazy.8
I am trying to append something to the editor using execCommand but I can't seem to find the command for this action. on the MCETiny editor the command is execCommand(mceInsertContect, false, dataToAppend) how can i do this with the editor in prime?

Re: p:editor and execCommand

Posted: 28 Oct 2011, 18:57
by andrerip
Thanks optimus.prime! It helped me a lot...