0

f:view<f:view rendered="#{p.statusmsg!=null}">中的所有内容,无论 statusmsg、picstatus 或 videostatus 的值是否为空,都将被<f:view rendered="#{p.picstatus!=null}">执行<f:view rendered="#{p.videostatus!=null}">

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>
4

1 回答 1

4

<f:view> 没有属性rendered。_

此属性仅在UIComponent基础标签上受支持,即库的所有标签和一些h:ui:的标签,包括<ui:fragment>.

只需替换<f:view><ui:fragment>.

也可以看看:

于 2013-03-03T14:05:23.193 回答