3

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?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
internet
  • 385
  • 1
  • 8
  • 27

2 Answers2

2

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>
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • Thank you for your reply. Is there any plan for solving this issue? Any date? – internet Jul 28 '14 at 20:20
  • It's not possible from OmniFaces side on. In essence, PrimeFaces Extensions shouldn't be trying to check its version based on ` – BalusC Jul 29 '14 at 06:20
  • could you post a example? Thank you very much. I want to us Omnifaces Resource Handler, but I should use Primefaces Extensions, also... – internet Jul 29 '14 at 19:06
  • 1
    That would require modifying their sources. You'd better just exclude them from combining. I updated the answer with detail as to how to achieve that. – BalusC Jul 29 '14 at 19:59
1

This issue is fixed in PrimeFaces Extensions 6.2.8 or higher.

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

Melloware
  • 10,435
  • 2
  • 32
  • 62