New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

o:validateMultiple - add the possibility to process disable components #411

Closed
NicolaIsotta opened this Issue Nov 2, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@NicolaIsotta

NicolaIsotta commented Nov 2, 2017

Consider a case like this:

<h:inputText id="input1"/>
<h:inputText id="input2"/>
<h:inputText id="input3" disabled="#{someBean.someProperty}"/>
<o:validateMultiple components="input1 input2 input3" validator="#{myMultipleValidator}"/>

where myMultipleValidator expects 3 components.
If #{someBean.someProperty} evaluates to false, myMultipleValidator will fail, because he won't receive the component input3.
I think it would be useful to add a property, e.g. skipDisabledComponents, which control the behavior: if it's false, disabled or readonly inputs will be processed too. Obviously it should default to true to keep consistency with the current behavior.

@BalusC

This comment has been minimized.

Show comment
Hide comment
@BalusC

BalusC Dec 3, 2017

Member

There's another problem: HTML won't send values of disabled inputs to server in first place.

Better use hidden inputs.

Member

BalusC commented Dec 3, 2017

There's another problem: HTML won't send values of disabled inputs to server in first place.

Better use hidden inputs.

@BalusC

This comment has been minimized.

Show comment
Hide comment
@BalusC

BalusC Dec 10, 2017

Member

On second thought, this could be quite useful if the validator should just retrieve the original model value in such case.

Member

BalusC commented Dec 10, 2017

On second thought, this could be quite useful if the validator should just retrieve the original model value in such case.

BalusC added a commit that referenced this issue Dec 10, 2017

@BalusC BalusC closed this Dec 10, 2017

@NicolaIsotta

This comment has been minimized.

Show comment
Hide comment
@NicolaIsotta

NicolaIsotta Dec 10, 2017

That's exactly my use case. Thanks @BalusC

NicolaIsotta commented Dec 10, 2017

That's exactly my use case. Thanks @BalusC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment