Conditional config.xhtml

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
synaptic
Posts: 22
Joined: 30 Jan 2019, 16:59

23 Jan 2021, 19:14

How can I do the <ui:include src="./config.xhtml" /> to be conditional (preferred with JSF only, w/o JSTL)?

I've tried below, when myBean.edit boolean equal to true, no luck

Code: Select all

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">

<h:head />
<h:body>
    <h:panelGroup id="viewPanel1">
        <h:panelGroup id="tableRenderPanel2" rendered="#{myBean.edit}">    
            <ui:include src="./config.xhtml" />
        </h:panelGroup>                         
    </h:panelGroup>			
</h:body>
</html>
of course template.xhtml and config.xhtml are in the same path.
Sapphire Theme 5.0.0
PrimeFace (Elite) 12.0.3
Mojarra JSF 2.3.14.SP04 & OmniFaces 3.11.2

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

29 Jan 2021, 02:11

Are you updating the panel element after you make the change in bean?

Also, you can try it with;

Code: Select all

<ui:fragment rendered="#{myBean.edit}">
    <ui:include src="./config.xhtml" />
</ui:fragment>

Note: Please update parent element after changing edit's value

Best Regards,

Post Reply

Return to “Sapphire - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests