ColorPicker java.awt.Color support dropped?

UI Components for JSF
Post Reply
KennardConsulting
Posts: 7
Joined: 08 Sep 2010, 02:52

11 May 2012, 07:57

Hi guys,

Thanks for the great work you do on PrimeFaces!

I'm in the process of updating http://metawidget.org and have hit a problem. The PrimeFaces Color picker appears to have a colourful history? At first it supported java.awt.Color, then that got moved to being Converter-based in order to accomodate Google App Engine. At some point the ColorPickerRenderer appeared to be (correctly, I think) using...

Code: Select all

line 57: String value = getValueAsString(facesContext,colorPicker);
http://grepcode.com/file/repository.pri ... derer.java

...but in the latest release (3.2) it appears to be back to...

Code: Select all

line 55: String value = (String) colorPicker.getValue();
...which I think breaks Converter support? And the showcase only demonstrates using Strings. Has java.awt.Color support been dropped? Is it possible to use a Converter to reproduce it? I understand the Google App Engine limitation, but I would think java.awt.Color would be a common use case?

Regards,

Richard

User avatar
T.dot
Expert Member
Posts: 620
Joined: 01 Feb 2012, 15:39
Location: Vienna/Austria

11 May 2012, 09:15

ColorPicker was reimplemented for 3.0. Blog post was here:
http://blog.primefaces.org/?p=1201

As you already know the lines that don't work for you I would suggest to override the component/renderer and add a converter. You can also create an issue, but I don't think it will get very high priority ;)
Please share your code if you implement it by yourself.

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

13 May 2012, 22:49

Why don't you write a converter?

KennardConsulting
Posts: 7
Joined: 08 Sep 2010, 02:52

14 May 2012, 01:56

Hi Optimus!

Thanks for replying.

I did try writing a Converter, but since the line of code I highlighted (ColorPickerRenderer:55) uses a cast rather than calling getValueAsString, my Converter gets ignored.

Earlier versions of ColorPickerRenderer *did* use getValueAsString (also as I highlighted), so I believe this may be a bug in 3.2?

Regards,

Richard.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 25 guests