Skip to content
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
Closed

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

pvydra opened this issue Sep 20, 2016 · 3 comments

Comments

@pvydra
Copy link

@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
Copy link
Member

@BalusC 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
Copy link
Author

@pvydra pvydra commented Sep 21, 2016

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

@BalusC
Copy link
Member

@BalusC 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants