Bug with o:validateBean and composite components (again) #347

Closed
recentralized opened this Issue Jan 27, 2017 · 3 comments

Projects

None yet

2 participants

@recentralized
Contributor

Hi Bauke, in lieu of being able to reopen issue #342, I'm creating this new bug.

Turns out that my fix (that you had merged) only works if h:form is defined in the calling page. Recently I moved h:form to be within the composite component and discovered that the o:validateBean ValueExpression was still evaluating to null.

Examples:

The following worked after fixing issue #342:

  demo.xhml:
    <h:form>
      <foo:testDialog bean="#{controller.entity}"/>
    </h:form>

  resources/foo/testDialog.xhtml:
    <cc:implementation>
      <o:validateBean value="#{cc.attrs.bean}"/>
    </cc:implementation>

However that fix did not work for the following:

  demo.xhtml:
    <foo:testDialog bean="#{controller.entity}"/>

  resources/foo/testDialog.xhtml:
    <cc:implementation>
      <h:form>
        <o:validateBean value="#{cc.attrs.bean}"/>
      </h:form>
    </cc:implementation>
@recentralized
Contributor

Fixed in pull request #348

@BalusC BalusC added a commit that closed this issue Jan 31, 2017
@BalusC BalusC Fix #347 Let Components#forEachComponent() always start from viewRoot
Extend ValidateBeanIT with two composite component cases
4308e73
@BalusC BalusC closed this in 4308e73 Jan 31, 2017
@BalusC
Member
BalusC commented Jan 31, 2017

I fixed it in Components#forEachComponent() side and added two composite based cases to integration test. Today's latest 2.6-SNAPSHOT contains the fix, please let me know if that works for you too.

@BalusC BalusC added a commit that referenced this issue Jan 31, 2017
@BalusC BalusC #347: fix Sonar warning eb8bdab
@recentralized
Contributor

I fixed it in Components#forEachComponent() side and added two composite based cases to integration test. Today's latest 2.6-SNAPSHOT contains the fix, please let me know if that works for you too.

I tested the develop branch (at commit b2b749) and reviewed the recursive call you put in Components.invoke and confirmed the bug is fixed for my application. Thanks!

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