javatrinidad

Table is not being refreshed after valueChangeListener is executed


I have a table that shows info from a backing bean's list attribute. I also have a selectOneRadio that clears that list on its valueChangeListener. Finally the table should show empty after that valueChangeListener but it keeps showing the previous info.

This is the key components in my jsp file:

The selectOneRadio:

<tr:selectOneRadio id="selectValue" 
    value="#{myBean.value}" 
    autoSubmit="true" 
    valueChangeListener="#{myBean.changeValue}"
    layout="horizontal">
        <f:selectItems value="#{myBean.values}" />
</tr:selectOneRadio>

The table:

<trh:tableLayout inlineStyle="width: 100%;" partialTriggers="selectValue">
    <tr:table partialTriggers="selectValue" 
        id="tableResults" var="var" emptyText="No records" width="100%"
        value="#{myBean.listInfo}"
        selectedRowKeys="#{myBean.selectedElements}"
        rowBandingInterval="1" rowSelection="multiple"> 

As I said, when I click the radio button the method changeValue(event) of MyBean is executed clearing the listInfo list but the table keeps showing the elements that were in the list dispite of the partialTriggers attribute.

What is wrong with this approach? Is there another way to refresh the table so it will display empty after clicking the radio button?

Thanks very much.


Solution

  • By removing the enclosing tableLayout tag the table gets refreshed properly as espected of partialTriggers.

    I don't understand why was this happening and it would be nice if anyone can explain it but I consider the question closed.