p:colorPicker and event="change"

UI Components for JSF
Post Reply
vished
Posts: 437
Joined: 02 Feb 2014, 17:38

26 Mar 2020, 16:21

Hi all,

I have an issue with the p:colorPicker component.

I have the following code:

Code: Select all

		<p:colorPicker
														id="customStatus_customStatus_styleClassForeground"
														value="#{customStatusLanguageEditController.customStatus.styleClassForeground}">
														<p:ajax event="change"
															update="@form:layout_preview_container" />
													</p:colorPicker>
My issue is now:
if i open the colorPicker PopUp and use my mouse for searching a right color code, the event is always fired as soon I move my mouse.

Is there a possibility to fire the event only then if I close again the PopUp?
Otherwise the event is multiple times.

Any suggestions?
PF 7.0

Melloware
Posts: 1780
Joined: 22 Apr 2013, 15:48

26 Mar 2020, 17:46

If you can reproduce it with a small PrimeFaces Test reproducer: https://github.com/primefaces/primefaces-test

I would then report it on the GitHub issues page with your attached reproducer. if what you are saying is true is sounds like a bug.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 8.0.1 / PF Extensions 8.0.2

Melloware
Posts: 1780
Joined: 22 Apr 2013, 15:48

27 Mar 2020, 18:55

I can't reproduce your issue. Mine only Fires change event when you actually "pick" a color not when you move your mouse?

Also I submitted this ticket: https://github.com/primefaces/primefaces/issues/5734
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 8.0.1 / PF Extensions 8.0.2

vished
Posts: 437
Joined: 02 Feb 2014, 17:38

27 Mar 2020, 22:06

Just to avoid any confusion.

I want to say:
If I move my mouse here, it seems for me always do an update:
Image

Do you have the same?
PF 7.0

Melloware
Posts: 1780
Joined: 22 Apr 2013, 15:48

28 Mar 2020, 13:59

Yes but you are "clicking" your mouse button and selecting a color right? Not just moving your mouse like you stated?

Clicking the mouse is selecting a color thus firing a "change" event. This is the correct behavior.

What you might want to request on GitHub is a "close" event when the popup is closed.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 8.0.1 / PF Extensions 8.0.2

vished
Posts: 437
Joined: 02 Feb 2014, 17:38

01 Apr 2020, 18:53

I´ve tried it again.
Yes, I keep clicking my mouse button and move the circle inside it.

Is there any possibility to avoid this?
PF 7.0

Melloware
Posts: 1780
Joined: 22 Apr 2013, 15:48

01 Apr 2020, 19:45

What you might want to request on GitHub is a "close" event when the popup is closed. The "change" event is doing the right thing. You want a new event.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 8.0.1 / PF Extensions 8.0.2

Melloware
Posts: 1780
Joined: 22 Apr 2013, 15:48

05 Apr 2020, 15:25

This ticket was created: https://github.com/primefaces/primefaces/issues/5769

And fixed for PF 9.0
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 8.0.1 / PF Extensions 8.0.2

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests