Conditional render selectDetailLevel

Community Driven Extensions Project
Post Reply
djmj
Posts: 400
Joined: 16 Dec 2011, 01:23

08 Nov 2015, 19:42

What about "rendered" attribute on `selectDetailLevel`?

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)}"/>
Proposal:

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>
Primefaces: 11.0.0 RC2
Primefaces-Extension: 11.0.0
PrimeFaces-Mobile: 11.0
OmniFaces: 3.11
Jsf: Mojarra 2.3.8
Server: Glassfish 5.1.0

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests