Issue when working with richfaces client side validation

UI Components for JSF
spinner
Posts: 31
Joined: 29 Nov 2010, 18:10

21 Sep 2011, 21:41

Hey Guys,

I have good news, I made some tests with richfaces client side validation system and primefaces form inputs, and it works!
But there's a problem though with p:password.
p:password generates the input inside a span which keeps the ID you passed to the tag. the input receives a generated ID with the suffix "_input".
richfaces tries to access the value from the input using the ID you passed to the p:password component, since the component is span, it doesn't collect the correct value.

I suggest that the input keeps the ID and the span receives a suffix like "_container".

wdyt? Considering the interop feature of JSF2, do you think that is it worth to track this issue?

btw, I'm using prime 3.0.M3.

best regards
José Freitas

spinner
Posts: 31
Joined: 29 Nov 2010, 18:10

23 Sep 2011, 22:06

guys?

spinner
Posts: 31
Joined: 29 Nov 2010, 18:10

29 Sep 2011, 20:27

I'm kinda lost here, how can a community member contribute to the project?
I cannot register an issue without discussing it in forum (and you don't seem to want to discuss it).
Since you guys are working with svn, I cannot make a pull request (I mean, I cannot contribute without being explicit a member of the project)

Is there another channel that I can use to help you improve the software?

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

29 Sep 2011, 20:37

You could create an issue and attach an patch to the issue :)
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

robert.m
Posts: 226
Joined: 07 Dec 2010, 22:52
Location: Salzburg/Austria

29 Sep 2011, 21:16

primefaces doesn't accept patches (anymore), as Cagatay stated in a comment on an issue I created that had a patch attached.

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

29 Sep 2011, 21:47

Hi spinner,

What you described is not a PrimeFaces issue. It's a correct behavior. Many components are generated by this way. If you write span element with suffix "_container", the component can't be updated as whole.

If RichFaces can't access input field because it has Id <component-id>_input, then it's an RichFaces issue. They have to change their logic to find editable fields. We had a similar issue with p:focus, but it was fixed a couple of time ago. All what you (RichFaces) needs is to write a correct jQuery selector to find editable field under <component-id>. Look jQuery selector in Focus.java please. I mean this one

Code: Select all

public final static String INPUT_SELECTOR = ":not(:submit):not(:button):input:visible:enabled:first"
I hope I answered your question.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

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

29 Sep 2011, 23:55

I agree with Oleg, using ids is not a good solution because it assumes client id belongs to an input which is usually not the case with rich components like autocomplete, spinner ...

I think they should improve it on their end with a jQuery selector that finds the input inside the client id target.

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

29 Sep 2011, 23:56

I suggest that the input keeps the ID and the span receives a suffix like "_container".
Your suggesting will break ajax updates, a component should have it's clientId set to the main container for ajax updates.

spinner
Posts: 31
Joined: 29 Nov 2010, 18:10

30 Sep 2011, 16:05

First of all, thanks for your answers and attention.

After your points, I must agree with you, maybe it's better to guarantee the interoperability of this feature building a way to find the input field (as Oleg stated), than to guarantee that all inputs would have the same id of the component.


p.s.: Although I'm sure you have your reasons for not accepting patches anymore, I'd suggest you to analyze github as a potenial code host for your project and its pull request system.
It's amazing how community can push the project forward.

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

30 Sep 2011, 18:48

PrimeFaces is a conservative project :)

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 65 guests