1
votes

I have a primefaces datatable with a rowToggler. When you type in values in the filters for a column, and then click the rowToggler on a row to open the expansion, and then if you click the rowToggler to close the expansion, the values are still in the column filters, but the data reloads without filtering the data.

I tried adding oncomplete='authTableWidget.filter();' to my p:ajax event="rowToggle, but that just makes it so that when you try to open a row expansion, it just reloads the table data with the filtered values and doesn't actually open the row expansion.

<p:dataTable var="auth" value="#{authBacking.auths}" widgetVar="authTableWidget" editable="true" id="authTable" paginator="true" rows="20" rowsPerPageTemplate="20,50,100" 
    paginatorTemplate="{CurrentPageReport} {PreviousPageLink} {PageLinks} {NextPageLink} {RowsPerPageDropdown}" 
    filteredValue="#{authBacking.filteredAuths}">

    <p:ajax event="rowToggle" listener="#{authBacking.openRow}" update=":authForm:authTable" />

    <p:column>
        <p:rowToggler />
    </p:column>
2
I assume your authBacking is loosing the filtered values, because its request scoped. (and the ajax request causes the backing bean to reset) - dognose
It's actually ViewScoped - Catfish
What kind of Class is "auth"? does it implement Serializable ? - yannicuLar
auth is just a plain java object. I tried adding Serializable but that doesn't do anything. - Catfish
try not updating the form on rowToggle. I personally haven't used rowToggler yet but in the show case exmaples, the rowToggle doesn't update the form. primefaces.org/showcase/ui/datatableExpandableRows.jsf - MrRaymondLee

2 Answers

2
votes

Try not updating the form on rowToggle. I personally haven't used rowToggler yet but in the show case examples, the rowToggle doesn't update the form.

0
votes

I have a similar problem, I solved it make update for all, except the table.