Skip to main content



      Home
Home » Eclipse Projects » NatTable » Bug in assigning converters
Bug in assigning converters [message #1031935] Tue, 02 April 2013 07:37 Go to next message
Eclipse UserFriend
Hello,

I am using NatTable version 0.9.0 and I want to use my own converter as shown in the documentation. There is, however a bug in the code.

For this reason, I have created a new converter:
public class NewBigDecimalConverter extends DefaultDisplayConverter {
	@Override
	public Object canonicalToDisplayValue(ILayerCell cell,
			IConfigRegistry configRegistry, Object canonicalValue) {
		return "Test";
	}
}


I am also adding the converter to every cell. There are no other converters in the application:
configRegistry.registerConfigAttribute(
	CellConfigAttributes.DISPLAY_CONVERTER, 
	new NewBigDecimalConverter(),
	"BODY"
	);


I have also checked the cells. They have the required labels (255255255 is another label):
Labels:
255255255
EVEN_BODY
BODY


However, my converter is not called. Every cell shows the original value (a big decimal number) and not my converted value. Any chance to debug this one even further?

Regards,
Clemens
Re: Bug in assigning converters [message #1031944 is a reply to message #1031935] Tue, 02 April 2013 07:50 Go to previous messageGo to next message
Eclipse UserFriend
I don't think there is a bug. Otherwise everybody who uses NatTable wouldn't ever be able to use converters.

Usually this is caused because you either register your special configuration too late or not at all. Where and when do you add the configuration that registers your converter?
Re: Bug in assigning converters [message #1032103 is a reply to message #1031944] Tue, 02 April 2013 11:15 Go to previous messageGo to next message
Eclipse UserFriend
You are completely right. The configuration took place after the table had been shown once. Since there was no refresh, the converter could not work.
I am very sorry for the hassle!
Re: Bug in assigning converters [message #1032109 is a reply to message #1032103] Tue, 02 April 2013 11:21 Go to previous message
Eclipse UserFriend
Quote:
I am very sorry for the hassle!


No problem. Using NatTable is not as easy as we would like it to be. At least for now. Wink

You should just be careful using the word bug unless you are really sure that it is a bug. Such a nasty word causes developers to lose hair. Wink
Previous Topic:Using NatTable freezeSelectionCommand not working
Next Topic:Row selection when right clicking row header
Goto Forum:
  


Current Time: Fri Jul 04 21:48:48 EDT 2025

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

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

Back to the top