Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » troubles with nattable.configure()
troubles with nattable.configure() [message #1689835] Tue, 24 March 2015 12:48 Go to next message
Vincent Lorenzo is currently offline Vincent LorenzoFriend
Messages: 249
Registered: June 2010
Location: Paris Saclay, France
Senior Member
Hello,
I have problem doing
		
this.natTable.setConfigRegistry(configRegistry);
this.natTable.setUiBindingRegistry(new UiBindingRegistry(this.natTable));
this.natTable.configure();


I do this during the creation of the table. it is OK, but I call them too
after a column addition in order to reconfigure the new column.

I would like to know if a can set a ConfigRegistry and a UIBindingRegistry, then call the configure method several time for a given instance of the NatTable widget.

The result of the second call is a table where only the grid is displayed (with the correct number of rows and columns). The table is empty, and the appearence of the header is ignored.

It worked find on Nattable 1.1.0. Maybe the problem comes from NaTable 1.2.0, but not sure... I continue to investigate

/Vincent Lorenzo
Re: troubles with nattable.configure() [message #1689840 is a reply to message #1689835] Tue, 24 March 2015 13:05 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
You should NEVER set the ConfigRegistry and for sure never the UiBindingRegistry after NatTable#configure() was called!

NatTable#configure() does not re-configure the NatTable instance, it simply adds the configurations again. In some cases this might work because the same values are set or overriden, but I don't want to predict what happens at several places. Also note that at creation time the ConfigRegistry might be passed to underlying layers for example. If you exchange that, how do you want to be sure that the reference is updated at every place?

You should search for another solution to configure new columns. Typically add the configurations to the existing ConfigRegistry and UiBindingRegistry. But exchanging and re-configuring shouldn't work from what I know.
Re: troubles with nattable.configure() [message #1690095 is a reply to message #1689840] Wed, 25 March 2015 09:00 Go to previous message
Vincent Lorenzo is currently offline Vincent LorenzoFriend
Messages: 249
Registered: June 2010
Location: Paris Saclay, France
Senior Member
Hi Dirk,
thank you for your answer. As you said, doing this, I assumed than the ConfigRegistry was never referenced by others classes than the nattable widget. I agree that I should refactore my code to avoid to have to call configure more than one time. Nevertheless I found the origin of my problem. It comes from the bugfix https://bugs.eclipse.org/bugs/show_bug.cgi?id=447145.
A new call to AbstractLayer#configure(ConfigRegistry configRegistry, UiBindingRegistry uiBindingRegistry) is ignored... Now I need to see how to change my code.

Previous Topic:Nattable Combobox Memory leak
Next Topic:NatTable 1.3.0 released
Goto Forum:
  


Current Time: Fri Apr 26 11:35:38 GMT 2024

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

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

Back to the top