tags:

views:

353

answers:

2

I am using lots of commandLinks in my app. For them to work, JSF generates some wild Javascript ( function dpf(f) {var adp... ). Sadly, the script-tag destroys my layout. (It really does - I am sure about that).

Is there a way to force JSF to generate the script-tag somewhere else?

A: 

Currently, I have an empty, hidden commandLink at the position, where I want the script-tag to be. This is working but I am not really satisfied with this "solution".

Mo
+2  A: 

Maybe you can try to externalize your Javascript. Instead of putting the Javascript code within your page, it will only include a script tag that points to a Javascript file. To do that, modify your web.xml file to have that:

<context-param>
    <param-name>com.sun.faces.externalizeJavaScript</param-name>
    <param-value>true</param-value>
</context-param>
romaintaz
Not an option for my situation but it should work and I will therefore accept it.
Mo