I try to create contents of an html table dynamically. Based on some userinput I want to show/hide additional rows.
Very simple example:
<xp:table border="1" width="100%">
<xp:repeat id="repeat1" rows="30" repeatControls="true" removeRepeat="true">
<xp:this.value><![CDATA[#{javascript:return [1,2]}]]></xp:this.value>
<tr>
<td>Item 1</td>
<td>Item 2</td>
</tr>
<xp:tr>
<xp:this.rendered><![CDATA[#{javascript:viewScope.get("show")}]]></xp:this.rendered>
<xp:td colspan="2">
Action Row
</xp:td>
</xp:tr>
</xp:repeat>
</xp:table>
I expect that this row shows up if viewScope is set to true. But what I get is
<div id="view:_id1:repeat1">
Item 1Item 2Action Row
Item 1Item 2Action Row
</div>
<table border="1" width="100%">
<tbody>
<tr>
<td>Item 1</td>
<td>Item 2</td>
</tr>
<tr>
<td>Item 1</td>
<td>Item 2</td>
</tr>
</tbody>
</table>
The rendered row is placed outside the table tree along with the duplicated text content of the repeated table cells.
How can I show/hide a table row by SSJS?
<xp:tr>
is valid only inside<xp:table>
. – Frantisek Kossuth<tr>
tag with computedText. – Frantisek Kossuth