1

pe:ckEditor is used in my program by a user to enter new e-mail message content. Users need browser spellcheck enabled.

I know that the ckEditor, on which the pe:ckEditor is based, can have this enabled by adding config.disableNativeSpellChecker = false; to config, however pe:ckEditor does not have a config file and is modified by values of its attributes. Though, I have not found in its doc any attribute that would achieve this.

I checked similar questions here, but vast majority of them is about ckEditor and modifying its config, which is useless for this case.

Please, let me know if you know a solution to this issue.


pe:ckEditor showcase - not enabled browser spellcheck apparent apparent enabled browser spellcheck

Melloware
  • 10,435
  • 2
  • 32
  • 62
A.Alessio
  • 321
  • 2
  • 15
  • I htink it is similar to this ticket: https://github.com/primefaces-extensions/primefaces-extensions.github.com/issues/740 I think the plugin has to be added to the core component I don't think there is an easy way to plug components in from the outside based on the way JSF/PFE has the load the plugins. – Melloware Mar 10 '20 at 11:44
  • Feel free to submit a PR adding the Spell Check plugin to PFE! – Melloware Mar 10 '20 at 11:49
  • Hi, @Melloware. Thank you for your comment. From what I understood from the *ckEditor* docs, it is not necessary to add any plugin to enable browser spellcheck, just to add `config.disableNativeSpellChecker = false;` to its config file - the doc says *"By default, native browser spell check functionality is disabled in the editor. Use the config.disableNativeSpellChecker configuration option to enable it"*. Using config file is not an option for me. `pe:ckEditor` has no attributes that would modify this behaviour. Is plugin really necessary? Or am I missing smth? Please let me know. Thank you – A.Alessio Mar 10 '20 at 13:00
  • See my solution below... – Melloware Mar 10 '20 at 13:56

2 Answers2

1

Have you tried defining your own custom config JS file like..

CKEDITOR.editorConfig = function( config ) {
    // Define changes to default configuration here. For example:
    config.disableNativeSpellChecker = false;
};

And then calling the PFE customConfig option like...

<pe:ckEditor id="editor" 
             value="#{editorController.content}"
             customConfig="#{request.contextPath}/js/config/myconfig.js" />

Or as of PFE 8.0.1 there is a new attribute "disableNativeSpellChecker='false'" you can set on the pe:ckeditor itself

https://github.com/primefaces-extensions/primefaces-extensions.github.com/issues/763

Melloware
  • 10,435
  • 2
  • 32
  • 62
  • I have figured out how to access custom config in https://stackoverflow.com/questions/59612256/primefaces-extensions-ckeditor-cannot-access-custom-config. However that is an inelegant workaround for me, because I would have to move all (many) files containing `pe:ckEditor` to a folder that is accessible via URL + I would have to make a special method generating the URL as have more environments (dev, test, prod, etc.), so the URL varies on each environment. – A.Alessio Mar 10 '20 at 16:27
  • Is it the only way? If so, can I submit a ticket somewhere with a suggestion for making an attribute, whose value would modify this? – A.Alessio Mar 10 '20 at 16:28
  • I don't understand. Just put this one config.js in your webapp and reference it from #{request.contextPath}/js/config/myconfig.js that is just 1 file? I don't know what you mean you would have to make the folder accessible via URL? – Melloware Mar 10 '20 at 20:17
  • Or open a ticket here for us to make this a default: https://github.com/primefaces-extensions/primefaces-extensions.github.com/issues – Melloware Mar 11 '20 at 11:02
  • Thank you, I will do that. :) – A.Alessio Mar 11 '20 at 14:53
1

Regarding the previous answer from @Melloware, I reported an issue. Based on it a new attribute to modify this behaviour has been made. See https://github.com/primefaces-extensions/primefaces-extensions.github.com/issues/763.

A.Alessio
  • 321
  • 2
  • 15