I need color picker on my page.
First, I placed Primefaces’ colorpicker, but when I tried to use it, I received “IllegalArgumentException: text/xml is not a supported mime type”. Probably this occurs because I use my own jquery library, which has no colorpicker element, and it overrides Primefaces’ one.
So, I tried it in other way. I used “jscolor” library which turns any input field to colorpicker. I got component:
<h:inputText value="#{searchManagedBean.selectedColor}" class="color"/>
It works perfectly, but when I submit form, value in backing bean doesn’t update. In backing bean I have getter and setter for this field, so I can’t figure out what is the reason of this problem.
Could you help me with one of these problems, or maybe provide another solution?
Thanks!
I found the solution. If I update the value in some other element, value in backing bean updates too. So, now I have something like this:
For me, it’s very strange behaviour. I don’t know why it works, but it works!