Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » ReflectiveColumnPropertyAccessor IllegalArgumentException(Problem edit cell after hide a column)
icon8.gif  ReflectiveColumnPropertyAccessor IllegalArgumentException [message #1404360] Thu, 31 July 2014 14:05 Go to next message
Thiago Nascimento is currently offline Thiago NascimentoFriend
Messages: 3
Registered: July 2014
Junior Member
Hi,

I am started in Natable and have a problem in cell edition when i hide a column or when i change column position.

Sorry my english.

My printStrackTrace:

Jul 31, 2014 10:42:42 AM org.eclipse.nebula.widgets.nattable.data.ReflectiveColumnPropertyAccessor setDataValue
GRAVE: Data type being set does not match the data type of the setter method in the backing bean
java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.nebula.widgets.nattable.data.ReflectiveColumnPropertyAccessor.setDataValue(ReflectiveColumnPropertyAccessor.java:69)
at org.eclipse.nebula.widgets.nattable.data.ExtendedReflectiveColumnPropertyAccessor.setDataValue(ExtendedReflectiveColumnPropertyAccessor.java:40)
at org.eclipse.nebula.widgets.nattable.extension.glazedlists.groupBy.GroupByColumnAccessor.setDataValue(GroupByColumnAccessor.java:40)
at org.eclipse.nebula.widgets.nattable.data.ListDataProvider.setDataValue(ListDataProvider.java:51)
at org.eclipse.nebula.widgets.nattable.layer.DataLayer.setDataValue(DataLayer.java:144)
at org.eclipse.nebula.widgets.nattable.edit.command.UpdateDataCommandHandler.doCommand(UpdateDataCommandHandler.java:54)
at scc.util.ui.editors.table.UpdateGenericTableDataCommandHandler.doCommand(UpdateGenericTableDataCommandHandler.java:43)
at org.eclipse.nebula.widgets.nattable.edit.command.UpdateDataCommandHandler.doCommand(UpdateDataCommandHandler.java:1)
at org.eclipse.nebula.widgets.nattable.command.AbstractLayerCommandHandler.doCommand(AbstractLayerCommandHandler.java:19)
at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.doCommand(AbstractLayer.java:162)
at org.eclipse.nebula.widgets.nattable.layer.AbstractLayerTransform.doCommand(AbstractLayerTransform.java:102)
at org.eclipse.nebula.widgets.nattable.grid.layer.GridLayer.doCommandOnChildLayer(GridLayer.java:109)
at org.eclipse.nebula.widgets.nattable.grid.layer.GridLayer.doCommandOnChildLayers(GridLayer.java:96)
at org.eclipse.nebula.widgets.nattable.layer.CompositeLayer.doCommand(CompositeLayer.java:135)
at org.eclipse.nebula.widgets.nattable.grid.layer.GridLayer.doCommand(GridLayer.java:178)
at org.eclipse.nebula.widgets.nattable.edit.InlineEditHandler.commit(InlineEditHandler.java:56)
at org.eclipse.nebula.widgets.nattable.edit.editor.AbstractCellEditor.commit(AbstractCellEditor.java:341)
at org.eclipse.nebula.widgets.nattable.edit.editor.AbstractCellEditor.commit(AbstractCellEditor.java:331)
at org.eclipse.nebula.widgets.nattable.edit.editor.AbstractCellEditor.commit(AbstractCellEditor.java:326)
at org.eclipse.nebula.widgets.nattable.edit.editor.TextCellEditor$1.keyPressed(TextCellEditor.java:246)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:167)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1081)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1108)
at org.eclipse.swt.widgets.Text.sendKeyEvent(Text.java:1726)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1104)
at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1525)
at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4723)
at org.eclipse.swt.widgets.Text.WM_CHAR(Text.java:2611)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4611)
at org.eclipse.swt.widgets.Text.windowProc(Text.java:2597)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4977)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2549)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3757)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:140)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:611)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at scc.application.Application.start(Application.java:21)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
at org.eclipse.equinox.launcher.Main.main(Main.java:1426)


Re: ReflectiveColumnPropertyAccessor IllegalArgumentException [message #1404381 is a reply to message #1404360] Thu, 31 July 2014 19:22 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
This typically means you registered the converter at the wrong place. I suppose you registered the labels not via DataLayer.
Re: ReflectiveColumnPropertyAccessor IllegalArgumentException [message #1404651 is a reply to message #1404381] Mon, 04 August 2014 17:16 Go to previous messageGo to next message
Thiago Nascimento is currently offline Thiago NascimentoFriend
Messages: 3
Registered: July 2014
Junior Member
This is my register code:

//property names
		String[] propertyNames = this.getProprities();

		//mapping from property to label, needed for column header labels
		Map<String, String> propertyToLabelMap = this.getMapLabel();		

		IColumnPropertyAccessor<T> columnPropertyAccessor = 
				new ExtendedReflectiveColumnPropertyAccessor<T>(propertyNames);
		
		this.bodyLayerStack = new BodyLayerStack<T>(
				new ArrayList<T>(genericInput.getCollections()), columnPropertyAccessor,configRegistry, false);
		
		final ColumnOverrideLabelAccumulator columnLabelAccumulator = new ColumnOverrideLabelAccumulator(bodyLayerStack);
		bodyLayerStack.setConfigLabelAccumulator(columnLabelAccumulator);
		registerColumnLabels(columnLabelAccumulator);

....
}


private void registerColumnLabels(ColumnOverrideLabelAccumulator columnLabelAccumulator) {
		if(propertiesLabelShow != null && !propertiesLabelShow.keySet().isEmpty()){
			List<FieldInformation> sortFis = getSortFieldInformation();
			int i =0;
			for (FieldInformation fieldInformation : sortFis) {
				Field field = propertiesLabelShow.get(fieldInformation);
				columnLabelAccumulator.registerColumnOverrides(i, field.getName());
				i++;
			}
		}
		
	}



Re: ReflectiveColumnPropertyAccessor IllegalArgumentException [message #1404891 is a reply to message #1404651] Wed, 06 August 2014 04:53 Go to previous messageGo to next message
Alex Dong is currently offline Alex DongFriend
Messages: 5
Registered: July 2014
Junior Member
hi

Seems i got the same exception before.i have a table and hide some columns by default.And i resolved this pb by implements the IColumnPropertyAccessor of NatTable,means write the columnPropertyAccessor of yours.in fact if you see the default columnPropertyAccessor of natTable,its setDataValue() or getDataValue() via reflection.In some cases,it can't meet your demand If your table is dynamic and complex,better to implement the IColumnPropertyAccessor and wirte your own accessor by caculate the data model you give.Hope it can help you.

[Updated on: Wed, 06 August 2014 04:54]

Report message to a moderator

Re: ReflectiveColumnPropertyAccessor IllegalArgumentException [message #1404917 is a reply to message #1404891] Wed, 06 August 2014 06:26 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
The issue is that you registered the column label accumulator to the body layer. But as you rely on the data structure it needs to be registered to the body data layer!

No custom accessor is needed in that case!
Previous Topic:Translations of Nattable core messages
Next Topic:Select and deselect All the row in the nattable programaticaly
Goto Forum:
  


Current Time: Tue Apr 16 04:35:28 GMT 2024

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

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

Back to the top