Filter value in primefaces datatable - jsf

Is it possible to see if filter area in a datable is empty or not and what is it's value?
I am using a datatable with pagination, when I add a new row to the datatable, I want to see if my rows are filtered or not to find the page in which newly added row is located.

Related

Primefaces - datatable inside panelgrid has invisible selected row

I have p:dialog, inside there is p:panelGrid, and one of column is p:dataTable. Datatable has selectionmode single. Problem is: dataTable loses all styling it defaulty had (it looks like pure unstyled html table). Also when i click row in dataTable, row is invisible, no data is shown. Also rowSelect functionally works, because data from selected row displays in input fields in another outputPanel correctly. Its just invisible

How do I disable PrimeFaces column overflow hiding within a datatable

I'm currently working with a <p:dataTable> (from PrimeFaces 5.2) with many columns, and as I approach the width of the datatable's parent container, PrimeFaces starts hiding columns; unfortunately it seems to be the most important column (first on the left, a <p:datePicker>).
I've tried assigning that column a priority="1" and the other columns priority="3" as described on the ShowCase site, but the first column is still hidden.
In addition to just nesting the datatable within a <p:tabView> I've tried making the dataTable scrollable via scrollable="true" and assigning a width, or also try wrapping the datatable within a <p:scrollPanel> but the column was still being hidden in either case.
When I remove enough columns (from the right-most of the table), the hidden column will again reappear.
I'm interested in a solution that is not tied/hard-coded to a specific column, as I've run into this same issue on the 2nd column, or 3rd, depending on the resolution or browser width...I want to be sure that my users are seeing everything that was coded into the datatable, even if that means they have to scroll, rather than having a dynamic function suppress values unbeknownst to the user or myself.
Basically, I recommend to add tableStyle="width:auto" to a <p:datatable> so that you do not have to deal with the single columns width. Primefaces will handle it for you dynamically depending on the length of the column entry.

How to get the selectManyCheckbox row entire values to the list using JSF and datatables

Select Many Check box items to Cart :
Declare check box first column of data
Declare the command button to the above the data
Once user click the check box current row data add to the list and this list data go to the Cart page
On click the check box current row data add to the list and on submit the button the entire list data go to the Cart page.
Thanks in Advance.
You can use primefaces datatable component for select one or more rows from a table and send this information to everywhere.
Take an example of this in showcase (the datatable have many others options too).

How to restore the state of p:dataTable before dialog reopen?

I'm using the PrimeFaces 3.5. I have p:dialog in which is p:dataTable. This is used to pick the item from filtered list.
After selecting the item I'm hiding the dialog and de-rendering the data table. But after showing the dialog again and re-rendering the data table, the data table contains the rows from previous filtering, but the filters themselves are clear.
I'm using the lazy data loading, so the values point to LazyDataModel, and the filteredValues are not set.
I would like to have the dataTable again in default state, so that both filters and selected rows would be empty. How to do that?
From the source, it looks like you can call reset() on an instance of org.primefaces.component.datatable.Table which will
Clear filtered values
Clear filters
Reset it's value
So you should obtain a reference to the client side datatable (either by value binding or walking the DOM from event) and call table.reset()

Collapsible Panels in jsf/primefaces

So what I want is this (Just the collapsible part):
http://www.primefaces.org/showcase-labs/ui/layoutEvents.jsf;jsessionid=238C388CE45C77A9B90898A82F2340EA
With 2 differences.
I want it in a datatable
I want to make a custom button that will control whether or not they are collapsed
Is this possible if so is there a good example I can go off?
i would start by
creating the dataTable as you want it to look with the row fully 'expanded'
put the data to be toggled in a panelGroup
put some sort of toggle on the row
put an effect on the panelGroup
put an action on your toggle to show/hide the panelGroup for the row
Some component libraries have this. they call them 'expandible rows', some display the data in the row, some render the row(s) below the 'parent' one.
One issue that i found (in earlier versions) is that when you had the data display in a separate row and you had a paginator set to show a set rows to display, it would bump the last row(s) when expanding the requested row to expand. I don't know if that is still the case.

Resources