-
Notifications
You must be signed in to change notification settings - Fork 762
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataTable: MultiViewState with a LazyDataModel #2155
Comments
I'm having the same issue. When going back to the page, none of the filters are being sent to the LazyDataModel. |
Hello guys, Any chance to have an answer for this issue ? Thank you. |
I just used two listeners to save the state of the pagination and filters till they get it working with the LazyDataModel. So it would look like: XHTML:
Controller
This seems to give the datatable the intended functionality and is a good bandaid for now. |
Hello, Regards, |
I was having the same issue setting MultiViewState in DataTable with LazyLoad using 6.1. I was trying to solve it in the backing bean by binding the table to a UIComponent (my idea was to save the TableState manually) when I noticed that after binding the table the problem disapeared. So, if you just set the binding attribute of the LazyLoad DataTable to a UIComponent in the backing bean the MultiViewState atribute works without doing anything else. EDIT: my solution has other side effects but jamesdcampbell's works for me so that's what I'm using. |
It looks like in |
we have the same filter problem with lazyModels, the filter text in the header will be restored but the data where not filtered, sorting and paging is working correctly |
@benoitbb If you like this to get fixed, you should provide a reproducer or at least a minimal but complete peace of code that can just be taken and tried out with copy and paste... |
Feel free to reopen - or create a new issue but with runnable example (at best a forked primefaces-test project) |
1) Environment
I do not understand what's happen in my code. I have to add piece of javascript code after the datatable to force the submit of the filter values. So when I access to a page I first load datas without filtering and then I have to load data again with filtering. I can see the filter values but they are not submitted at the first load of the page.
2) Expected behavior
Same behaviour than the showcase (http://www.primefaces.org/showcase/ui/data/datatable/tableState.xhtml) but with a LazyDataModel List
3) Actual behavior
I have to add a piece of javascript after the datatable declaration to make the filters appear in the "load" function.
<script type="text/javascript"> $(document).ready(function () { PF('processes').filter() }); </script>
..
4) Steps to reproduce
5) Sample XHTML
<p:dataTable id="processes" widgetVar="processes" var="proc" value="#{processDTODataModel}" filteredValue="#{processesController.filteredProcessesDto}" selection="#{processesController.selectedItems}" rows="#{processDTODataModel.nbRows}" first="#{processDTODataModel.firstIndex}" paginatorTemplate="#{processDTODataModel.paginatorTemplate}" currentPageReportTemplate="#{processDTODataModel.currentPageReportTemplate}" rowsPerPageTemplate="#{processDTODataModel.rowsPerPageTemplate}" multiViewState="true" selectionMode="multiple" rowKey="#{proc.id}" paginatorPosition="top" disabledTextSelection="false" reflow="true" paginator="true" lazy="true">
..
6) Sample bean
`@Named
@ViewAccessScoped
public class ProcessInstanceCommentDTODateModel extends LazyDataModelWrapper {
}`
..
Could you have a look please ?
Thank you.
Regards,
The text was updated successfully, but these errors were encountered: