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:validateBean IllegalArgumentException: Cannot convert PROPERTY of type class org.omnifaces.el.ExpressionInspector$ValueExpressionType to class java.lang.Boolean #144

Closed
BalusC opened this Issue Jul 6, 2015 · 1 comment

Comments

Projects
None yet
1 participant
@BalusC
Member

BalusC commented Jul 6, 2015

http://stackoverflow.com/q/31209226/157882

In a nutshell: using class level <o:validateBean> on a boolean property via <h:selectBooleanCheckbox> fails with mentioned exception during ExpressionInspector#getValueReference().

@BalusC BalusC changed the title from IllegalArgumentException: Cannot convert PROPERTY of type class org.omnifaces.el.ExpressionInspector$ValueExpressionType to class java.lang.Boolean to o:validateBean IllegalArgumentException: Cannot convert PROPERTY of type class org.omnifaces.el.ExpressionInspector$ValueExpressionType to class java.lang.Boolean Aug 4, 2015

@BalusC BalusC closed this in 8129a00 Oct 14, 2015

@BalusC

This comment has been minimized.

Show comment
Hide comment
@BalusC

BalusC Oct 14, 2015

Member

Turns out that EL coercion is causing this. I bypassed it to make it to always return null as evaluated value, so EL doesn't attempt to coerce an invalid value.

Right now the work around is to return null instead of our internal value ValueExpressionType.PROPERTY. This way EL won't attempt to coerce it. Only in EL 3.0 we can solve it more nicely by overriding the ELContext#coerceToType() to return the value object unmodified.

Member

BalusC commented Oct 14, 2015

Turns out that EL coercion is causing this. I bypassed it to make it to always return null as evaluated value, so EL doesn't attempt to coerce an invalid value.

Right now the work around is to return null instead of our internal value ValueExpressionType.PROPERTY. This way EL won't attempt to coerce it. Only in EL 3.0 we can solve it more nicely by overriding the ELContext#coerceToType() to return the value object unmodified.

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