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

Closed
pvydra opened this Issue Sep 20, 2016 · 3 comments

Projects

None yet

2 participants

@pvydra
pvydra commented Sep 20, 2016 edited

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

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

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

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))) {
            return;
}

In 2.5 this condition has been changed to this

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

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
Member
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
pvydra commented Sep 21, 2016

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

@BalusC
Member
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