o:validateBean on class-level broken in 2.5 #313

pvydra opened this Issue Sep 20, 2016 · 3 comments


None yet

2 participants

pvydra commented Sep 20, 2016 edited

After upgrade to 2.5, o:validateBean stopped working on class-level validation.

        <o:validateBean value="#{myBean.agreement}" />

        <p:commandButton update="@form" value="Button" action="# {myBean.save()}"  /> 

Stack: Wildfly 9, JSF 2.2, PrimeFaces 5.3

I've found out by debugging that method ValidateBean.processValidateBean(UIComponent component) in 2.4 contains following condition:

if (!form.equals(getCurrentForm()) || (component instanceof UICommand && !hasInvokedSubmit(component))) {

In 2.5 this condition has been changed to this

if (!form.equals(getCurrentForm()) || !hasInvokedSubmit(component)) {

Since hasInvokedSubmit returns (in both versions) false (because component is HtmlFormbut getCurrentActionSource() is UICommand) the condition always ends execution in 2.5.

@BalusC BalusC closed this in 502f392 Sep 20, 2016
BalusC commented Sep 20, 2016 edited

That was an awkward mistake. Can you please try today's latest 2.6 snapshot after its build has passed and confirm? Then I will release a 2.5.1.

pvydra commented Sep 21, 2016

I can confirm it is working in 2.6-20160920.200801-3

BalusC commented Sep 21, 2016

I have just released 2.5.1. It will be on Maven Central sooner or later today.

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