开发者

Is PrototypeScript.js necessary for Richfaces

开发者 https://www.devze.com 2023-02-14 09:06 出处:网络
Our site currently uses Richfaces 3.3.3 and JSF 2. There are various native custom javscript functions scattered about the site.

Our site currently uses Richfaces 3.3.3 and JSF 2. There are various native custom javscript functions scattered about the site.

I'm looking to clean it all up and implement a reusable set of custom libraries that will use the jQuery javascript framework.

There is currently no custom code using custom Prototype on ou开发者_运维百科r site.

What I'm wondering is:

Can I remove the prototype file completely?

It currently takes up 96kb and 78ms to load.

3_3_3.Finalorg.ajax4jsf.javascript.PrototypeScript.xhtml

Or is it necessary in order for some of the Richfaces components to work correctly?

If I can remove it, how would I do this?

Thanks


Unfortunately it is necessary. Richfaces uses jQuery too, so if you instruct Richfaces to load jQuery on all pages (see the docs on how to do it), you can use jQuery. Another way is to use jQuery.noConflict().

List of component dependencies is in richfaces-ui-XXX.jar\META-INF\richfaces.component-dependencies.xml, if you don't use any component that depends on prototype (only a slim chance), you may remove prototype (see the linked documentation on how).

In Richfaces 4.0 prototype is removed in favor of jQuery.

0

精彩评论

暂无评论...
验证码 换一张
取 消