Color picker

101 views
Skip to first unread message

Nicolas Micoud

unread,
Jun 28, 2018, 7:50:20 AM6/28/18
to iDempiere
Hi,

I would like to allow user to choose a color in new kind of field.

But, Color Picker are not available (see https://www.zkoss.org/zkdemo/input/color_picker).
The only workaround i see is to open this webpage https://htmlcolorcodes.com/fr/ and let user select the desired color, copy the html code and paste it in a String field.

Do you see another way to achieve it ?

Thanks,

Nicolas

Heng Sin Low

unread,
Jun 28, 2018, 10:55:30 AM6/28/18
to idem...@googlegroups.com
--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/e804744d-ddb0-4498-b939-2023e4502ca4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nicolas Micoud

unread,
Jun 29, 2018, 6:22:30 AM6/29/18
to iDempiere
Thanks for the link, but I have no idea how to implement it :-/

Heng Sin Low

unread,
Jun 30, 2018, 12:33:26 AM6/30/18
to idem...@googlegroups.com
create a new editor, use the text input component and set type to color.

Nicolas Micoud

unread,
Jul 3, 2018, 7:30:54 AM7/3/18
to iDempiere
Hi,

In order to test rapidly, i made the change in WUrlEditor :

line 45         getComponent().getTextbox().setClientAttribute("type", "url");
became
:
        getComponent
().getTextbox().setClientAttribute("type", "color");

It displays like this (see Field.png)



Now when clicking on the black bar, a popup opens :





But i don't see how i can get the selected color.
Nothing happens in the onEvent method.
And i can't find which objects is used to display the color picker panel.

Any hint ?

Thanks,


Nicolas
Auto Generated Inline Image 1
Auto Generated Inline Image 2

Nicolas Micoud

unread,
Jul 4, 2018, 5:21:37 AM7/4/18
to iDempiere
It's working !!!!
Thanks for your guidance :)


I create a new editor which extends WStringEditor

    public WColorPickerTGIEditor(GridField gridField) {
       
super(gridField);
       
System.out.println("new");
        getComponent
().setClientAttribute("type", "color");
   
}




And that's it !


Do you (or Carlos) think it should be integrated in trunk ? Just to know how i integrate it.

Thanks,

Nicolas
Auto Generated Inline Image 1
Auto Generated Inline Image 2

Carlos Antonio Ruiz Gomez

unread,
Jul 4, 2018, 5:50:44 AM7/4/18
to idem...@googlegroups.com
Hi Nicolas,

I opened this ticket:
https://idempiere.atlassian.net/browse/IDEMPIERE-3738

I think that's the intention of Color reference in core but it's wrongly implemented.

Please read my comment in ticket suggesting how to fix and I would like to receive feedback from community about that idea - patches also welcome of course  :)

Regards,

Carlos Ruiz
Reply all
Reply to author
Forward
0 new messages