0

Everything inside f:view <f:view rendered="#{p.statusmsg!=null}">,<f:view rendered="#{p.picstatus!=null}"> and <f:view rendered="#{p.videostatus!=null}"> is getting executed whether the value of statusmsg,picstatus or videostatus is null or not

1)getMoreStatusUpdate.xhtml

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

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

<h:head></h:head>
<h:body>
   <div id="content">
      <h:form>
         <ui:repeat var="p" value="#{statusBean.moreStatusList}">                   
            <f:view rendered="#{p.statusmsg!=null}">
            //Status content    
            </f:view>
            <f:view rendered="#{p.picstatus != null}"> 
            //Picture Status Content                            
            </f:view>  
            <f:view rendered="#{p.videostatus != null}">
            //Video Status Content
            </f:view>                   
         </ui:repeat>
      </h:form>
   </div>
</h:body>
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Wizard Sultan
  • 830
  • 7
  • 22
  • 45

1 Answers1

4

The <f:view> doesn't have a rendered attribute.

This attribute is only supported on UIComponent based tags, which is all tags of the h: library and a few of the ui: library including <ui:fragment>.

Just replace <f:view> by <ui:fragment>.

See also:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • Thanks a lot. I was hoping you would answer, that way I knew my problem is going to get solved at one go. I am currently struggling a lot to design a social network site and your post and suggestion on internet have been really helpful. – Wizard Sultan Mar 03 '13 at 14:12