1
votes

I would like to define an area inside a table on an XPage and then partially refresh this area when a button is clicked. I have no problem using partial refresh with a panel but I do not know how I can define an area to be refreshed which is inside a table. I have tried unsuccessfully with "div" and "xp:span" tags to define such an area. Here is what I am doing:

<xp:table>
<xp:div id="RefreshAreaID">
<xp:tr>
<xp:td>
<xp:label value="Row 3" id="label3"></xp:label></xp:td>
<xp:td></xp:td>
</xp:tr>
<xp:tr>
<xp:td>
<xp:label value="Row 4" id="label4"></xp:label></xp:td>
<xp:td></xp:td>
</xp:tr>
</xp:div>

When I add the xp:div tags, I no longer see the rows and cells it contain on the XPages design editor.

3

3 Answers

3
votes

Use xp:div with an id and then inside the xp:div you add the content to be refreshed.

Update: Now that you have added your source code I can recommend that you refresh the entire table. So add an id to the table and then refresh that component:

<xp:table id="RefreshAreaID">
<xp:tr>
<xp:td>
<xp:label value="Row 3" id="label3"></xp:label></xp:td>
<xp:td></xp:td>
</xp:tr>
<xp:tr>
<xp:td>
<xp:label value="Row 4" id="label4"></xp:label></xp:td>
<xp:td></xp:td>
</xp:tr>
...
</xp:table>

You can also look into refreshing several table rows by chaining the partial refreshes.

1
votes

As Per Henrik already said you could use a div. or if you still want to work with tables try this:

<xp:panel tagName="table" id="tableId">
    <xp:panel tagName="tr" id="trId">
        <xp:panel tagName="td" id="tdId"></xp:panel>
    </xp:panel>
</xp:panel>

You should be able to refresh the whole table using "tableId", the table Row using "trId" or only the td using "tdId".

1
votes

I don't think you can mix tags like that. Suggestions:

  1. Refresh the rows you need one by one.

  2. If there are really many rows to be refreshed split your table to multiple tables and refresh the whole table.

  3. Use colspan to make one full width cell. Add a new table inside that cell and refresh that. (edit)

EDIT

Based on your comments the only problem is validation. Check "[x] Process data without validation" check box in your button event to disable validation.