Hello,
I'm trying to use the PrimeFaces Color Picker on a JSF 1.2 page that is using Facelets and RichFaces and I get a javascript "PrimeFaces is undefined" error. I added the following namespace:
xmlns:p="http://primefaces.prime.com.tr/ui
and added <p:resources/> to the <head>.
When I load the page I get the color button but when I click on it nothing happens. When I view the source it looks like the <script> and <link> tags are added properly and it looks like the propery javascript is inserted where I put the <p:colorPicker> tag when I view the source.
Any suggestions?
PrimeFaces is undefined
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
Can you post your PrimeFaces Resource Servlet configuration?
Code: Select all
<servlet>
<servlet-name>Resource Servlet</servlet-name>
<servlet-class>org.primefaces.resource.ResourceServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Resource Servlet</servlet-name>
<url-pattern>/primefaces_resources/*</url-pattern>
</servlet-mapping>
EDIT:
Also I put the primefaces-1.0.0.jar in my WEB-INF/lib folder
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
Hi you got the url-pattern wrong, it should be singular.
Code: Select all
<url-pattern>/primefaces_resource/*</url-pattern>
Wow as if...I thought I copied it from somewhere too. Anyway that fixed it up. Thanks.
EDIT:
The only other problem I'm having now is that when the page is first rendered the color picker is shown in expanded form then shrinks back down to just the button. The issue with that is that I have multiple color pickers displayed on the page and a reset button to set them all back to their default colours. When I click reset all of the buttons get re-rendered which causes the awkward expansion/shrink problem. Even if I can get around it on the reset, it still happens the first time the page is loaded and this is undesirable. Is there some way to work around it?
EDIT:
The only other problem I'm having now is that when the page is first rendered the color picker is shown in expanded form then shrinks back down to just the button. The issue with that is that I have multiple color pickers displayed on the page and a reset button to set them all back to their default colours. When I click reset all of the buttons get re-rendered which causes the awkward expansion/shrink problem. Even if I can get around it on the reset, it still happens the first time the page is loaded and this is undesirable. Is there some way to work around it?
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
So you mean a short period of UI flicker? I think this is because of progressive enhancement approach which we can improve for sure.
Here's a screenshot of what I am experiencing. It happens when the page is rendered. You'll notice the first color picker is fine but it starts out like the other two. After a second or two all display correctly. In total there are 16 color pickers on the page. It's possible that there may be more at some point in the future.cagatay.civici wrote:So you mean a short period of UI flicker? I think this is because of progressive enhancement approach which we can improve for sure.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 55 guests