-1

I have to get the value of h:outputtext to evaluate a condition using Expression language. I am using the below piece of code. but getting "org.apache.jasper.JasperException: /test.jsp(43,20) PWC6296: The function element must be used with a prefix when a default namespace is not specified" error.

Kindly help me how i can check for the conditions.

<h:outputText id="myname" value="Sumit" />
<h:graphicImage height="84px" width="255px" value="/images/LogoDistributor.jpg" rendered="#{element('myname')=='sumit'}"></h:graphicImage>
<h:graphicImage height="84px" width="255px" value="/images/LogoGold.jpg" rendered="#{element('myname')=='sumt'}"></h:graphicImage>
<h:graphicImage height="84px" width="255px" value="/images/LogoPlat.jpg" rendered="#{element('myname')=='Sumit'}"></h:graphicImage>

Thanks in advance.

1 Answers1

0

You should call the function element('...') over its bean class like:

rendered="#{MyBean.element('myname').equals('sumit')}"  

MyBean here, is the class containing the method element('...'). It should be a jsf managed bean.

scaleSpace
  • 31
  • 2