Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Filter Row - Initial values
Filter Row - Initial values [message #1698878] Thu, 18 June 2015 13:40 Go to next message
Thomas Kernstock is currently offline Thomas KernstockFriend
Messages: 27
Registered: July 2009
Location: Vienna
Junior Member
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 14:29 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2803
Registered: July 2012
Senior Member
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 15:08 Go to previous messageGo to next message
Thomas Kernstock is currently offline Thomas KernstockFriend
Messages: 27
Registered: July 2009
Location: Vienna
Junior Member
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 16:44 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2803
Registered: July 2012
Senior Member
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 21:15 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2803
Registered: July 2012
Senior Member
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 14:02 Go to previous message
Thomas Kernstock is currently offline Thomas KernstockFriend
Messages: 27
Registered: July 2009
Location: Vienna
Junior Member
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: Tue Mar 02 05:49:44 GMT 2021

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

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

Back to the top