1 Reply Latest reply on Apr 29, 2009 11:02 AM by nbelaevski

    extendedDataTable filtering dont read hidden rows

      I have an extendedDataTable with filtering. The filter only filters the datatable and does not remove rows from the datatable which is fine, but I am enabling some buttons based on what is in some of the fields.

      For example, the dataTable has some rows which are reservable, and some which are not. I also have a reserve button (at the bottom). As long as rows which are reservable are visible on screen the reserve button has to be enabled, but when there are no reservable rows, the reserve button should be disabled. Since the filtering does not remove the row, only hides it from the user, when the button checks to see whether or not its disabled it sees the hidden rows and does not disable when there are no reservable rows visible.

      Is there a way to handle this?

        • 1. Re: extendedDataTable filtering dont read hidden rows
          nbelaevski

          Hello,

          That's definitely not a common case. Suggestions:

          1. Disable/enable button on the client using JS - jQuery to check whether elements with a special CSS classes (e.g. my-app-reservable) were output to the client or not.
          2. Extend org.richfaces.model.ExtendedTableDataModifiableModel and enable/disable button according to whether reservable rows were encountered in walk() method (hint: walk() method provides row keys, use getRowData()/setRowKey() to obtain row value).
          3. Create converter that will set request-scoped variable controlling the button if reservable row was passed for conversion - this will require you to provide output component for row data and is kind of hack.