title: Customize CKEditor under XPages (the right way)
body: <p>I need to customize CKEditor's toolbar with custom buttons sets. </p>
  
  <p>I have already read these questions/answers and linked ressources:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/9030295/customize-ckeditor-plug-in-into-domino-8-5-3">Customize Ckeditor plug-in into Domino 8.5.3</a></li>
  <li><a href="https://stackoverflow.com/questions/23083997/how-to-configure-the-ckeditor-under-xpages">How to configure the CKEditor under XPages?</a></li>
  </ul>
  
  <p>What they do works, if you always do a full page refresh. But if you do a partial refresh of a part of the page - including at least one rich text control (CKEditor version 4.3.2) - <strong>after</strong> the <strong>partial refresh</strong> CKEditor chooses a toolbar like <strong>'Full'</strong> (I don't really know, but I think the default type) as toolbar type to display.  </p>
  
  <p>The problem is the whole <em>dojo-widget - custom IBM CKEditor - thing</em>. It makes your <code>toolbar</code> dojo property being 'forgotten/ignored' after a partial refresh (but it is still set!!!).</p>
  
  <p>Anyone having experience/knowledge, how to solve this best, e.g. the IBM way (if there is any?!?!?)?</p>
  
  <p>I solved it quick and dirty by changing properties of the global CKEditor JS variable (executed every time inside the partial refresh block): </p>
  
  <pre><code>&lt;xp:scriptBlock id="scriptBlock2"&gt;
      &lt;xp:this.value&gt;
          &lt;![CDATA[
              CKEDITOR.config.readOnly = true;
              CKEDITOR.config.removePlugins = 'autogrow';
              CKEDITOR.config.autoGrow_minHeight = 250;
              CKEDITOR.config.autoGrow_maxHeight = 250;
              CKEDITOR.config.toolbarLocation = 'top';
  
              CKEDITOR.config.toolbar_readonly = [
                  { name: 'tools', items: ['Find','Print', 'Preview', 'Maximize']}
              ];
          ]]&gt;
      &lt;/xp:this.value&gt;
  &lt;/xp:scriptBlock&gt;
  </code></pre>
  
  <h3>System:</h3>
  
  <ul>
  <li>IBM Domino 9.0.1 FP2 (local on client PC)</li>
  <li>OpenNTF Domino Framework in use</li>
  <li>Windows 7 32 bit</li>
  </ul>