portal:inputRichText fails to render on Ajax request if render="false" on initial request

Description

Steps to reproduce:

  1. Change the portal:inputRichText attributes for the general.xhtml use case to include rendered="#{!showcaseModelBean.selectedComponent.rendered}" (to ensure that the inputRichText is not loaded on initial page render).

  2. Navigate to the portal:inputRichText "General" example.

  3. Click the Rendered check box.

If the bug still exists, the portal:inputRichText will not appear, and the following message will appear in the browser logs:

Refused to execute script from 'http://localhost:8080/web/guest/portal-showcase/-/portal-tag/portal/inputrichtext//o/frontend-editor-ckeditor-web/ckeditor/ckeditor.js?browserId=other&minifierType=js&languageId=en_US&b=7006&t=1535034902742' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

If the bug is fixed, no error message will appear, and the portal:inputRichText will appear.

Workaround

  1. To work around this issue, add the skipEditorLoading="false" attribute to always include the necessary scripts.

  2. Alternatively, use JavaScript to show and hide editor on the client. Load the portal:inputRichText with rendered="true" on the initial page load (to ensure all the necessary resources are loaded). If you want to still hide the rich text editor on initial load, then set style="display: none;" and unset that via JavaScript (document.getElementById('#{inputRichText.clientId}').style.display = null) when you want to show the rich text editor.

Environment

None

Activity

Show:
Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Fix versions

Affects versions

Priority

Zendesk Support

Created May 28, 2019 at 8:18 AM
Updated July 3, 2019 at 2:43 PM
Resolved May 28, 2019 at 2:47 PM

Flag notifications