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 on class-level broken in 2.5 #313

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

Comments

Projects
None yet
2 participants
@pvydra

pvydra commented Sep 20, 2016

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

This comment has been minimized.

Show comment
Hide comment
@BalusC

BalusC Sep 20, 2016

Member

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.

Member

BalusC commented Sep 20, 2016

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

This comment has been minimized.

Show comment
Hide comment
@pvydra

pvydra Sep 21, 2016

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

pvydra commented Sep 21, 2016

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

@BalusC

This comment has been minimized.

Show comment
Hide comment
@BalusC

BalusC Sep 21, 2016

Member

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

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