mojarra icon indicating copy to clipboard operation
mojarra copied to clipboard

Nested <cc:insertChildren> generates wrong client ID

Open BalusC opened this issue 7 years ago • 0 comments

https://stackoverflow.com/q/48857301/157882

test.xhtml

<h:form id="form">
    <my:level1 id="level1">
        <my:level3 id="level3" beanInstance="#{bean}" methodName="action" />
    </my:level1>
</h:form>

level1.xhtml

<cc:implementation>
    <my:level2 id="level2">
        <cc:insertChildren />
    </my:level2>
</cc:implementation>

level2.xhtml

<cc:implementation>
    <cc:insertChildren />
</cc:implementation>

level3.xhtml

<cc:implementation>
    <h:commandButton id="button" value="Submit #{component.clientId}"
        action="#{cc.attrs.beanInstance[cc.attrs.methodName]}">
        <f:ajax />
    </h:commandButton>
</cc:implementation>

Expectation is that submit button mentions as client ID form:level1:level2:level3:button, however instead it says form:level1:level3:button and causes that the com.sun.faces.component.visit.PartialVisitContext, which in turn correctly finds level2, cannot find the target button and hence not invoke its action.

BalusC avatar Feb 26 '18 08:02 BalusC