AdrianoKF
AdrianoKF

Reputation: 3021

RichFaces 4 replacement for <a4j:loadScript>

I'm currently migrating a legacy JSF 1.2 application using RichFaces 3.3 to JSF 2.0 and RichFaces 4.

However, inclusion of the jQuery library bundled with RichFaces does no longer work by including <a4j:loadScript src="resource://jquery.js"/>, as the <a4j:loadScript> component has been removed from RichFaces version 4.

The RF 3.3 to 4 migration guide does not state how to include the bundled scripts otherwise. I've seen suggestions to use <h:outputScript name="jquery.js" target="head" />, but this produces no output whatever in the rendered page.

Has anyone got a solution to load those bundled scripts? Thanks in advance!

Upvotes: 4

Views: 4237

Answers (1)

BalusC
BalusC

Reputation: 1108972

To get <h:outputScript target="head"> to work, you need to have a <h:head> instead of a <head> in the master template.


Unrelated to the concrete problem, RichFaces 4 already ships with bundled jQuery. You do not necessarily need to load one yourself.

Upvotes: 2

Related Questions