primefaces / primefaces

Ultimate Component Suite for JavaServer Faces
http://www.primefaces.org
MIT License
1.77k stars 752 forks source link

p:resetInput the same as f:resetValues?! #12324

Open tandraschko opened 1 month ago

tandraschko commented 1 month ago

if yes, we can remove p:resetInput

melloware commented 1 month ago

Interesting: https://docs.oracle.com/javaee/7/javaserver-faces-2-2/vdldocs-facelets/f/resetValues.html

it specifically calls out that it doesn't walk into children which is exactly the bug

Evaluates to Collection. The clientIds of components that will be passed to UIViewRoot.resetValues(). The identifiers must be space delimited. Note: do not use any of the @ keywords such as @form or @this with this tag because UIViewRoot.resetValues() does not descend into the children of the listed components.

jepsar commented 1 month ago

Hmm.. we are on JSF 2.3 and it's not offered in the code completion nor recognized. This might be a NetBeans thing though.

Screenshot 2024-07-26 at 15 24 12
    <dependency>
      <groupId>javax</groupId>
      <artifactId>javaee-web-api</artifactId>
      <version>8.0</version>
      <scope>provided</scope>
    </dependency>
jepsar commented 1 month ago

I just tried (ignoring NetBean's warning) and it gave me:

ERROR: Cannot invoke "javax.faces.view.facelets.TagAttribute.getObject(javax.faces.view.facelets.FaceletContext, java.lang.Class)" because "this.render" is null

tandraschko commented 1 month ago

you need to declare render attr

DazzlingBob commented 1 month ago

I always thought that does not fully support Content Security Policy but does. Therefore i always avoid the use of . So using f:resetValues instead of p:resetInput could give CSP problems (maybe depending on the Faces implementation).

tandraschko commented 1 month ago

Thats actually completely unrelated, there is no client side code for p/f:resetValues

DazzlingBob commented 1 month ago

Thats actually completely unrelated, there is no client side code for p/f:resetValues

Ok, CSP should be fine then! Changed one xhtml file from to in a project which uses mojarra-2.3.18 and the change works fine. Will do some more testing.

BTW: f:resetValues is not recognized by eclipse IDE.

melloware commented 1 month ago

f:resetValues must be missing from the taglib or Eclipse must not pick it up for some reason. I have seen that before.