Skip to main content



      Home
Home » Eclipse Projects » NatTable » Filter Row - Initial values
Filter Row - Initial values [message #1698878] Thu, 18 June 2015 09:40 Go to next message
Eclipse UserFriend
Hi,

I would like to set the initial value of a filter when showing the NAT table for the first time. This should not be a static filter and the filtervalue should be visible in the filter row in the same way it is there after entering the value manually. I would need that for Text and Dropdown.

Thanx
Thomas
Re: Filter Row - Initial values [message #1698890 is a reply to message #1698878] Thu, 18 June 2015 10:29 Go to previous messageGo to next message
Eclipse UserFriend
FilterRowDataProvider#setDataValue()


before opening should do the job
Re: Filter Row - Initial values [message #1698897 is a reply to message #1698890] Thu, 18 June 2015 11:08 Go to previous messageGo to next message
Eclipse UserFriend
Hi Dirk,

thank you for the fast reply.

This works great for Stringfields but I still have a problem with Dropdowns.

Lets assume I have a dropdown in col. 3 with the values {"A", "B", "C", "D"}

Neither
filterRowHeaderLayer.getFilterRowDataLayer().getFilterRowDataProvider().setDataValue(3, 0, new Integer(2) );
nor
filterRowHeaderLayer.getFilterRowDataLayer().getFilterRowDataProvider().setDataValue(3, 0, new String("C") );

will work. The value is set to the Field but I receive an errormessage:

SCHWERWIEGEND: Error on applying a filter
java.lang.NullPointerException
at org.eclipse.nebula.widgets.nattable.extension.glazedlists.filterrow.DefaultGlazedListsFilterStrategy.getStringFromColumnObject(DefaultGlazedListsFilterStrategy.java:227)
at org.eclipse.nebula.widgets.nattable.extension.glazedlists.filterrow.DefaultGlazedListsFilterStrategy.applyFilter(DefaultGlazedListsFilterStrategy.java:147)
Re: Filter Row - Initial values [message #1698908 is a reply to message #1698897] Thu, 18 June 2015 12:44 Go to previous messageGo to next message
Eclipse UserFriend
It's an NPE. So is there a display converter registered for that column? And if so, why does it return null?
Re: Filter Row - Initial values [message #1698923 is a reply to message #1698908] Thu, 18 June 2015 17:15 Go to previous messageGo to next message
Eclipse UserFriend
When are you setting the values? You need to set them AFTER NatTable#configure() as it immediately triggers applying the filter. If you set the values before, the NatTable instance is not initialized.
icon14.gif  Re: Filter Row - Initial values [message #1699018 is a reply to message #1698923] Fri, 19 June 2015 10:02 Go to previous message
Eclipse UserFriend
Thank you Dirk it works. Setting the values after the configure() statement did it !
br
Thomas
Previous Topic:Table Size after hiding column
Next Topic:Preserve Selection On Sorting
Goto Forum:
  


Current Time: Fri Jun 20 04:19:43 EDT 2025

Powered by FUDForum. Page generated in 0.04595 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top