how to get current value of colorpicker

UI Components for JSF
Post Reply
ledantecpierre
Posts: 2
Joined: 19 Mar 2013, 18:59

12 Apr 2013, 19:58

Hello,

I have a colorpicker set to the user to update the backgroundcolor define like this
<p:colorPicker id="inlineCP" value="#{userSessionBean.backgroundColor}" mode="inline" widgetVar="colorpick"/>
I can record the value in my bean using a save button, but I would like to access the current value as the user click on the colorpicker so I can preview the backgroundcolor change before saving it. Is it possible to use widgetvar? something like colorpick.getValue(). I can also use javascript or jquery, any suggestion?

protayus
Posts: 11
Joined: 02 Mar 2013, 01:58

12 Apr 2013, 23:40

I was recently trying to do something similar, using colorpicker. I do wish I could fire changes simply when the color was selected via event.

Oleg had a solution for ajax update here.

viewtopic.php?f=3&t=15033
PrimeFaces 4.0
PrimeFaces Extensions 1.0.00 RC1, OmniFaces 1.6
Jboss 7.1.1.Final, Mojarra 2.1.7
Netbeans 7.2, Windows 7
Owner of PrimeFaces Cookbook: http://ova2.github.com/primefaces-cookbook & PF Starter

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 82 guests