【问题标题】:foreach in rich data table丰富数据表中的foreach
【发布时间】:2014-07-09 00:16:35
【问题描述】:

我正在尝试在数据丰富的表格中显示列表我的代码是

<rich:dataTable value="#{form.tableResultat}"
                            var="rows"  style="width:700px" >

                            <rich:columnGroup columnClasses="#{rows.classLevel}">

                        <c:forEach var="index" begin="0" end="3">
                            <rich:column colspan="#{rows.columns[index].colSpan}" rowspan="#{rows.columns[index].rowSpan}">
                            <t:outputText value="#{rows.columns[index].colSpan}"  />
                            </rich:column>
                            </c:forEach>
                            </rich:columnGroup>

                            </rich:dataTable>

问题是 thevar 索引它是空的,但是当我替换 ${index} 时它会显示值,我不能在我的代码中执行 ${index} 我如何解决这个问题以及问题是什么

【问题讨论】:

    标签: jsf richfaces richdatatable


    【解决方案1】:

    首先: 你有一个错字

    <t:outputText value="#{rows.columns.[index].colSpan}"  />
    

    我认为这应该是这样的:

    <t:outputText value="#{rows.columns[index].colSpan}"  />
    

    您是否尝试过删除 c:forEach 循环并对其进行硬编码?

    【讨论】:

    猜你喜欢
    • 2011-02-11
    • 2011-08-19
    • 2021-08-13
    • 1970-01-01
    • 2011-01-28
    • 2010-12-14
    • 2012-01-22
    • 2011-01-02
    相关资源
    最近更新 更多