Does any one know how to config CKEditor to submit the editor content when the Enter key is pressed?
Thanks,
How to submit CKEditor when Enter key is pressed
-
- PrimeFaces Core Developer
- Posts: 3979
- Joined: 03 Dec 2010, 14:11
- Location: Bavaria, DE
- Contact:
You must register the on-enter handler by yourself with jquery (don't know if this works)
Then you could call the editor widget via: myEditorWidgetVar.fireEvent('save');
Then you could call the editor widget via: myEditorWidgetVar.fireEvent('save');
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
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
-
- PrimeFaces Core Developer
- Posts: 3979
- Joined: 03 Dec 2010, 14:11
- Location: Bavaria, DE
- Contact:
Just post the JS example, i think its not hard to use it with the my JSF port
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
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
Follow the link below:
http://cksource.com/forums/viewtopic.php?f=11&t=18485
That's really what I want to achieve.
Thanks.
http://cksource.com/forums/viewtopic.php?f=11&t=18485
That's really what I want to achieve.
Thanks.
Jonathan Ekwempu
TobiSoft Inc.
TobiSoft Inc.
-
- PrimeFaces Core Developer
- Posts: 3979
- Joined: 03 Dec 2010, 14:11
- Location: Bavaria, DE
- Contact:
myWidgetVar.instance.on('key', function(e) {
myWidgetVar.fireEvent('save');
});
should work. Otherwhise no idea. You can get the real ckeditor instance via myWidgetVar.instance.
myWidgetVar.fireEvent('save');
});
should work. Otherwhise no idea. You can get the real ckeditor instance via myWidgetVar.instance.
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
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
-
- PrimeFaces Core Developer
- Posts: 3979
- Joined: 03 Dec 2010, 14:11
- Location: Bavaria, DE
- Contact:
<pe:ckEditor .... widgetVar="myEditor">
<pe:javascript event="initialize" execute="myEditor.instance.on('key', function(e) { myEditor.fireEvent('save'); });" />
</pe:ckEditor>
this works. But you must add if key == enter.
<pe:javascript event="initialize" execute="myEditor.instance.on('key', function(e) { myEditor.fireEvent('save'); });" />
</pe:ckEditor>
this works. But you must add if key == enter.
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
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
-
- Information
-
Who is online
Users browsing this forum: No registered users and 5 guests