java - Include different file with primefaces -


i'm trying include different file according type of java object.

i'm doing :

<p:panelgrid rendered="#{adapter.habitation}" >     <ui:include src="./habitation.xhtml" /> </p:panelgrid>  <p:panelgrid rendered="#{adapter.animas}">     <ui:include src="./animals.xhtml" /> </p:panelgrid> 

but cases throw exception because it's trying resolve xhtml files.

any idea what's wrong?

thanks

you need boolean expression in rendered attribute.

try this:

<p:panelgrid rendered="#{adapter.habitation != null}" >     <ui:include src="./habitation.xhtml" /> </p:panelgrid>  <p:panelgrid rendered="#{adapter.animas != null}">     <ui:include src="./animals.xhtml" /> </p:panelgrid> 

Comments

Popular posts from this blog

java - BeanIO write annotated class to fixedlength -

Using Java 8 lambdas/transformations to combine and flatten two Maps -

How to connect android app to App engine -