I have a composite component and use it regular but also within masterDetail.
Now i must duplicate my data update commandButton to render it once with selectDetailLevel and once without.
Maybe an alternative is, that selectDetailLevel is not so strict that it must be a child of masterDetail.
Here a simplified use case:
Code: Select all
<p:commandButton rendered="#{cc.attrs.detailLevel ne null}"
action="#{cc.attrs.dao.createOrUpdate(cc.attrs.entity)}">
<pe:selectDetailLevel level="#{cc.attrs.detailLevel} contextValue="#{cc.attrs.entity}"/>
</p:commandButton>
<p:commandButton rendered="#{cc.attrs.detailLevel eq null}"
action="#{cc.attrs.dao.createOrUpdate(cc.attrs.entity)}"/>
Code: Select all
<p:commandButton action="#{cc.attrs.dao.createOrUpdate(cc.attrs.entity)}">
<pe:selectDetailLevel level="#{cc.attrs.detailLevel} contextValue="#{cc.attrs.entity}" rendered="#{cc.attrs.detailLevel ne null}"/>
</p:commandButton>