loading javascript resources for primefaces components

UI Components for JSF
Post Reply
Matrium
Posts: 112
Joined: 16 May 2011, 08:27

05 Aug 2011, 17:04

Hi,

i am not sure how to load the .js files for specific primefaces components. i need it because large parts of my page are dynamically rendered, if i use a component in that dynamic parts which was not used on the initial page i have a problem..

i tried with dragdrop like this

Code: Select all

    <h:head>
       <h:outputScript name="dnd/dragdrop.js" library="primefaces"
          target="head" />
         ...
but it doesnt seem to work. with firebug i found out that the location is

Code: Select all

 http://localhost:8080/MyApp/javax.faces.resource/dnd/dragdrop.js.jsf?ln=primefaces&v=3.0.M2 
i am sure there is a pretty solution for this, can you help me?
PrimeFaces (Elite) 4.0.13, Majorra 2.1.28, Tomcat 7.0.53
Testing with Firefox, Chrome and IE9+IE10
<3 Primefaces!!!

Matrium
Posts: 112
Joined: 16 May 2011, 08:27

08 Aug 2011, 06:39

*add

of course i can simply add

Code: Select all

	<script
		src="/MyApp/javax.faces.resource/dnd/dragdrop.js.jsf?ln=primefaces&v=3.0.M2"
		type="text/javascript" />
to the template, but isn't there a better solution around? I don't want the context-path or the primeface version to be there because i would have to change every xhtml file if i change the version or the path
PrimeFaces (Elite) 4.0.13, Majorra 2.1.28, Tomcat 7.0.53
Testing with Firefox, Chrome and IE9+IE10
<3 Primefaces!!!

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 60 guests