2014-09-11 85 views
0

我想加载数据网格中的动态xhtmls。但不知何故,它在p:outputlabel中显示正确的数据,并在ui:include中获得了一个空值。ui:包含内部不工作p:dataGrid

这里是我的代码片段

<p:dataGrid var="myBoard" value="#{dashBoard.widgetList}" columns="2" 
       rows="2" paginator="true" id="widgetsGrid" 
       paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}" 
       rendered="#{dashBoard.boardSize gt 0}"> 

     **// ***** Here is populate correct data ******** 
     <p:outputLabel value="#{myBoard.endpointUrl}" /> 

     <p:panel id="one_#{myBoard.id}"> 
      <p:lightBox iframe="true" id="lighbox_one_#{myBoard.id}" height="550px" width="1024px" > 
       <h:outputLink value="display" title="#{myBoard.name}"> 
        <ui:insert name="widgetone"> 

         **// ******* how come this would be null? ********* 

         <ui:include src="#{myBoard.endpointUrl}"> 
         </ui:include> 

        </ui:insert> 
        <f:param name="id" value="#{myBoard.id}" /> 
       </h:outputLink> 
      </p:lightBox> 
     </p:panel>  

    </p:dataGrid> 

我没有尝试不同的方法把它放在c:if但解决不了一样。 是由primefaces支持的这个序列还是任何建议来实现相同的?

在此先感谢...

回答

0

这是因为 “#{} myBoard.endpointUrl” 是在 “Restore View阶段” 无效。

有关JSF生命周期的详细信息:http://docs.oracle.com/javaee/1.4/tutorial/doc/JSFIntro10.html

+0

感谢您的答复......那么有没有什么解决办法,以实现在P中的一样:的数据网格?或者我应该使用其他组件? – 2014-09-11 13:11:27

+0

选中此项:http://stackoverflow.com/questions/13990965/jsf-uiinclude-not-being-rendered-properly – S19 2014-09-11 13:13:45