TinGinard
TinGinard

Reputation: 377

facelets ui:fragment ignores rendered attribute

i'm having a very strange behaviour with this piece of code:

<ui:fragment rendered="#{price.guestIdTrue}">
<b>PRICE_GUEST_ID_TRUE : #{price.guestIdTrue}</b>
    <h:outputText>#{Global.guestTypeMap[price.guestId]}&#160;#{price.guestIndex}</h:outputText>
</ui:fragment>

Even when the rendered condition is false, the

PRICE_GUEST_ID_TRUE : false 1

1 is the #{price.guestIndex}

The ui namespace is correctly defined, and it works on others facelets.

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:t="http://myfaces.apache.org/tomahawk">

Any Ideas of what happens.

Thanks in advance.

Upvotes: 3

Views: 4772

Answers (1)

BalusC
BalusC

Reputation: 1108632

You seem to be using <ui:fragment> inside an iterating tag/component where the #{price} is actually the currently iterated variable, such as the JSTL <c:forEach> tag, or the JSF <h:dataTable> or <ui:repeat> component while using an early version of Mojarra. In those situations, the #{price} is not available in EL scope at the point it's been evaluated.

You need the <h:panelGroup rendered> instead or to upgrade the Mojarra version to the latest.

Upvotes: 6

Related Questions