My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 187: Filter doesn't work when the nested property of the first row is null.
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Jun 2009


 
Reported by 5754....@gmail.com, Apr 8, 2009
What steps will reproduce the problem? (See the attachment test.jsp)
1. construct an object with a nested property which value is null.
2. create an ArrayList, add the object into the ArrayList.
3. add some more objects into the ArrayList.
4. write a JSP which use jmesa:tableFacade to render a table with the
ArrayList above.
5. access the JSP in browser.
6. enter some character in the filter box above the nested property which
should filter some rows out.

What is the expected output? What do you see instead?
Expected: The corresponding rows remain.
Actual: no result returns. The table will be always empty no matter what I
enter.

What version of the product are you using? On what operating system?
Jmesa 2.2.8; Jmesa 2.4.1; Jmesa 2.4.2

Please provide any additional information below.
1. I have attached a file named 'test.jsp' to reproduce this problem.
Please edit it to conform your directory, css, js etc.
2. This problem is caused by ItemUtils#getPropertyClassType(Collection<?>,
String) that is using apache common bean utils to property type which
cannot handle a null property. I have also attached a patch to fix this
using java reflection. You might want to try this patch on trunk branch.

test.jsp
1.5 KB   View   Download
NullableColumnFilter.patch
5.2 KB   View   Download
Apr 9, 2009
Project Member #1 jeff.johnston.mn@gmail.com
Thanks! I'll take a look at this.

What version of the BeanUtils are you using? The BeanUtils API had problems with null
values with nested classes that seem to be resolved in BeanUtils 1.8.
Apr 13, 2009
#2 5754....@gmail.com
I am using BeanUtils 1.7. 
Apr 13, 2009
#3 5754....@gmail.com
FYI, it doesn't work with BeanUtils 1.8 either.
Apr 14, 2009
Project Member #4 jeff.johnston.mn@gmail.com
Sorry about the slow response.... I'm looking forward to checking out what you did!
At work we have some tables that have a lot of nested objects that I want to test
against. I am hoping to find time this week yet to do that.
Status: Accepted
Apr 20, 2009
Project Member #5 jeff.johnston.mn@gmail.com
I looked at your patch tonight...I'm very impressed! It really looks great. You made
it easy for me too because it only goes through the new BeanUtils if the value is
null. Looking over your implementation I wonder if this wouldn't be a better default
though. Have you tested bean properties that are nested? 

Tomorrow at work I am going to make time to test this out more in our project that
uses a lot of JMesa tables. The code is checked into the branch right now and after
more testing I want to just cut a new release because there is no reason for this
code to sit on the trunk.

Again, sorry about dragging my heels on this patch. Its been pretty crazy lately...I
appreciate your efforts though!
Status: Started
Jun 11, 2009
Project Member #6 jeff.johnston.mn@gmail.com
Part of the 2.4.3 release.
Status: Fixed

Powered by Google Project Hosting