How to set p:editor value using javascript

UI Components for JSF
Post Reply
ikoen
Posts: 10
Joined: 10 Jun 2010, 10:54

14 Sep 2011, 09:00

Using PrimeFaces 3.0.M2

How can I set a value of the p:editor using javascript?

Thanks,

Koen

ikoen
Posts: 10
Joined: 10 Jun 2010, 10:54

26 Sep 2011, 21:53

Bump.

I'm trying to set the value of an editor in a dialog. Worked like a charm in the previous version of PF using "setEditorHtml".

Anyone?

Thanks a lot.

ikoen
Posts: 10
Joined: 10 Jun 2010, 10:54

29 Sep 2011, 21:22

Bump.

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

29 Sep 2011, 21:56

Maybe you can get the editor instance with:

widget.editor and set the value via CLEditor API?
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

ikoen
Posts: 10
Joined: 10 Jun 2010, 10:54

29 Sep 2011, 22:00

Thanks for your reply.

I tried using the API but it does not seems pretty straight forward to set a value, while it was quite easy in previous version of the editor.

User avatar
bruno.neves
Posts: 22
Joined: 15 Jul 2010, 14:03

13 Jan 2012, 14:47

I'm having the same problem, did anybody would have done??
Primefaces 3.4.2
Mojarra 2.1.7
Glassfish 3.1.2
Netbeans 7.1.1

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

13 Jan 2012, 14:57

CLEditor doesn't seem to support this so I think we need to extend this, create an issue if you like.

User avatar
bruno.neves
Posts: 22
Joined: 15 Jul 2010, 14:03

17 Jan 2012, 14:02

I managed to solve this way:

Code: Select all

    widgetVarEditor.editor.focus();
    setTimeout(function() {
        widgetVarEditor.editor.execCommand('inserthtml', 'TEXT', false);
    }, 0);
    return false;
But I think that create a issue would be better, then I'll do it!
Primefaces 3.4.2
Mojarra 2.1.7
Glassfish 3.1.2
Netbeans 7.1.1

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 65 guests