【问题标题】:rich:column is generating extra td elementrich:column 正在生成额外的 td 元素
【发布时间】:2013-01-24 04:59:21
【问题描述】:

您好,我使用rich:dataTable 来显示MyClass 类型的List 类型的元素。

<rich:dataTable value="#{myBean.myClassList}"> var="item"
<rich:column> 
<h:outputText value="#{item.stdName}"
</rich:column>
<rich:column>
<table class="subtable">
<tr>
<ui:repeat value="#{item.listStr}" var="stdMarks">
<td><h:outputText value="#{stdMarks}"/></td>
</uirepeat>
</tr>
</table>
</rich:column>


通过使用上面的代码,我能够在同一行显示 StudentName 和标记,但问题是在显示标记后,当我使用 firebug 找到源代码时,会生成另一个空列(如下所述)。

上述代码的源代码如下所示。

<table id="selectForm:servicesDispTable" class="rich-table servicesDispClassTable" width="850">
<tr>
    <td id="selectForm:servicesDispTable:1:j_id51" class="rich-table-cell>
       <span>Kumar</span> 
    </td>
    <td  id="selectForm:servicesDispTable:1:j_id53"><span>89</span></td>
    <td  id="selectForm:servicesDispTable:1:j_id57"><span>76</span></td>
    <td><!-- comment generating extra column here -->
        <table class="subtable">
           <tr></tr>
        </table> 
    </td>
</tr>

</table>

如何避免生成额外的列?任何人都可以帮助我解决这个问题。我曾经使用 ui:repeat 做过什么,我可以使用任何丰富的面孔标签来实现这一点。

【问题讨论】:

    标签: richfaces uirepeat richdatatable


    【解决方案1】:

    我没有检查空条件,在第一次迭代中它显示的是那个值,所以这是插入的额外列。几乎浪费了 2 天,这就是我在这里发布的原因。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-08
      • 2021-05-15
      • 1970-01-01
      • 2016-08-22
      • 1970-01-01
      相关资源
      最近更新 更多