jakartaee / faces

Jakarta Faces
Other
101 stars 54 forks source link

Allow refreshable ValueExpression for validator/converter/behavior tags #1499

Open tandraschko opened 4 years ago

tandraschko commented 4 years ago

Attributes on validators and converters are created and evaluated built time. We may just need to introduce stateHelper like in components.

There are many workarounds in the past to support ValueExpression correctly for that cases: 1) PrimeFaces behaviors: https://github.com/primefaces/primefaces/tree/master/src/main/java/org/primefaces/behavior/base 2) MyFaces common converters https://cwiki.apache.org/confluence/display/MYFACES/MyFaces+Commons+Converters 3) MyFaces commons validator https://svn.apache.org/repos/asf/myfaces/commons/trunk/myfaces-commons-validators/src/main/java/org/apache/myfaces/commons/validator/

also see: https://issues.apache.org/jira/browse/MYFACES-3547 https://stackoverflow.com/questions/4439850/refresh-jsf-validator-attributes-on-rerender

Actually it's not a big feature, it just makes it easier to use and align the APIs with component attributes.

BalusC commented 3 years ago

OmniFaces <o:validator> and <o:converter> tags also basically convert all attributes of existing validators/converters to deferred value expressions.

tandraschko commented 3 years ago

@BalusC i would like to work on this. How should we proceed? introduce a StateHelper, same like on Components? Wouldnt be that much work and we have the same API. I would start with behaviors first.

tandraschko commented 1 year ago

There is also another problem when e.g. dealing with a validator inside UIRepeat in our MF ValidatorTagHandlerDelegate we check the disabled flag on build-time but the disabled EL might reference to a ui:repeat var so if you load the page the first time and no ui:repeat item is present, do an AJAX update on the repeat with items, the validation will just be skipped

there may be other places in the spec which needs to be checked

tandraschko commented 1 year ago

thats a bit more work, we need to introduce StateHelper for converters and so on; lets move to 5.0