Menu

#625 Filter with empty bugged

Not planned
closed
nobody
None
5
2022-01-23
2016-03-06
Florian Hof
No

On the list mode, it is possible to filter. The filter type "empty" or "not empty" have a problem if a filter with a value was already done.
To reproduce:
1. Filter on a column with "begin with" or "=" and specify a value to filter.
2. Apply the filter.
3. Change the filter on the same column with "empty" or "not empty".
4. Apply the filter. An error occurs and a stack trace comes in the logs, because Hibernate cannot parse the query.

I attached a small correction in Tab.java. I also do that the messages spans the whole table in listEditor.jsp, otherwise the layout looks strange. See the attached patch below and the unit test attached in my comment from 2016-04-17.

1 Attachments

Discussion

  • Florian Hof

    Florian Hof - 2016-03-06

    By the way, it was not possible to select "empty" or "not empty" for number. This can of course be usefull on optional fields. Adding this possibility is a small change, see the attached filter_empty_for_all_types.patch. I could test this improvement successfully.

    I'm looking forward to see the next OpenXava version! Those modifications are small in size but bring more power and more confidence to the user.

    EDIT 13.03.2016: I moved this part to feature request https://sourceforge.net/p/openxava/feature-requests/512/

     

    Last edit: Florian Hof 2016-03-13
  • Javier Paniza

    Javier Paniza - 2016-03-07

    Hi Florian:

    The filter empty for all types is rather a new feuture, not a bug. We work fixing bug for the maintenance versions, so we fix this issue for 5.5.1 or 5.6.1 or 5.7.1..., but not for 5.5.

    On the other hand we don't put the is empty for numbers by design, because most times numbers cannot be optional, but 0, so giving the two option == null or == 0 to the user can be confused for him. That is, we remove some functionality for some special cases to made simpler for most cases.

     
  • Florian Hof

    Florian Hof - 2016-03-13

    Hi Javier,
    Thanks for your response. For clarity I separate the tickets.
    I keep this one for the bug (Java Exception with stracktrace and error message to the user).
    I create the feature request #512 for the empty filter on all types.

     
  • Florian Hof

    Florian Hof - 2016-04-17

    I just add a unit test that reproduces the original problem (see To reproduce in the description). The test fails without the correction and success with the patch.

    A note on the change colspan="0" in listEditor.jsp: As of the W3C spec, it spans to all remaining columns. It helps the error message to display nicely, without distending the result table.

     

    Last edit: Florian Hof 2016-10-27
  • Florian Hof

    Florian Hof - 2016-10-27
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -5,4 +5,4 @@
     3. Change the filter on the same column with "empty" or "not empty". 
     4. Apply the filter. An error occurs and a stack trace comes in the logs, because Hibernate cannot parse the query. 
    
    -I attached a small correction in _Tab.java_. I also do that the messages spans the whole table in _listEditor.jsp_, otherwise the layout looks strange. See the attached patch. 
    +I attached a small correction in _Tab.java_. I also do that the messages spans the whole table in _listEditor.jsp_, otherwise the layout looks strange. See the attached patch below and the unit test attached in my comment from  2016-04-17. 
    
    • status: open --> unread
     
  • Florian Hof

    Florian Hof - 2022-01-23
    • status: unread --> closed
     
  • Florian Hof

    Florian Hof - 2022-01-23

    This problem cannot be reproduced with OpenXava 6.6.1. Inbetween there was a rework of the filters in table mode.

     

Log in to post a comment.