rich:column is generating extra td element

255 Views Asked by At

Hi Iam using rich:dataTable to display elements which is of type List of type MyClass.

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


By using the above code Iam able to display the StudentName and marks in the same row but the problem is after displaying marks another empty column is generated(as explained below) when i find the source code using firebug.

The source code for the above code is shown below.

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

How to avoid generating of that extra column? Could any one help me out of this.Also what ever I have done using ui:repeat can I achieve that using any of rich faces tag.

1

There are 1 best solutions below

0
On

I didnt checked null condition and in first iteration it is displaying that value so that is the extra column inserted.Almost wasted 2 days thats why I have posted here.