【问题标题】:ui:include is not working inside p:dataGridui:include 在 p:dataGrid 中不起作用
【发布时间】:2014-09-11 12:40:53
【问题描述】:

我正在尝试在数据网格中加载动态 xhtml。但不知何故,它在 p:outputlabel 中显示了正确的数据,并在 ui:include 中得到了一个空值。

这是我的代码 sn-p

<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 是否支持此序列或实现相同的任何建议?

在此先感谢...

【问题讨论】:

    标签: jsf jsf-2 primefaces datagrid facelets


    【解决方案1】:

    这是因为“#{myBoard.endpointUrl}”在“恢复视图阶段”期间为空。

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

    【讨论】:

    猜你喜欢
    • 2017-06-23
    • 2011-05-31
    • 1970-01-01
    • 1970-01-01
    • 2020-01-02
    • 1970-01-01
    • 2014-09-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多