سؤال

I added OmniFaces to use the CombinedResourceHandler. But now the PrimeFaces Extensions <pe:ckEditor> doesn´t work anymore.

Is there any workaround for this issue?

هل كانت مفيدة؟

المحلول

Unfortunately, this is a known issue caused by the way how PrimeFaces Extensions loads and manages its JS resources. This was already ever reported as an issue on old Google Code host and is mentioned in the current OmniFaces known issues wiki as follows:

PrimeFaces Extensions <=0.7.1-4.0.0 (and probably future versions)

PrimeFaces Extensions JS resource primefaces-extensions.js is incompatible with CombinedResourceHandler. During load, it attempts to figure the version from its own <script> element in order to dynamically load additional CSS/JS resources. This is however absent and the attempt fails with a JS error which in turn causes the dynamic loading of additional CSS/JS resources for e.g. CKEditor to fail.

Your best bet is to exclude primefaces-extensions.js from combining by adding the following entry to web.xml telling the CombinedResourceHandler to not combine the PrimeFaces Extensions main script file:

<context-param>
    <param-name>org.omnifaces.COMBINED_RESOURCE_HANDLER_EXCLUDED_RESOURCES</param-name> 
    <param-value>primefaces-extensions:primefaces-extensions.js</param-value> 
</context-param>

If you're using OmniFaces 2.2 or newer, then you can use a wildcard * as name:

<context-param>
    <param-name>org.omnifaces.COMBINED_RESOURCE_HANDLER_EXCLUDED_RESOURCES</param-name> 
    <param-value>primefaces-extensions:*</param-value> 
</context-param>

If you're using PrimeFaces Extensions before version 3.0.0, then you also need to make sure that the PrimeFaces Extensions own resource handler is explicitly declared after CombinedResourceHandler in faces-config.xml:

<application>
    <resource-handler>org.omnifaces.resourcehandler.CombinedResourceHandler</resource-handler>
    <resource-handler>org.primefaces.extensions.application.PrimeFacesExtensionsResourceHandler</resource-handler>
</application>

نصائح أخرى

This issue is fixed in PrimeFaces Extensions 6.2.8 or higher.

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top