\r
import org.simantics.databoard.Bindings;\r
import org.simantics.databoard.binding.Binding;\r
+import org.simantics.databoard.binding.RecordBinding;\r
import org.simantics.databoard.binding.error.BindingException;\r
import org.simantics.databoard.parser.repository.DataTypeSyntaxError;\r
import org.simantics.databoard.parser.repository.DataValueRepository;\r
import org.simantics.databoard.type.ArrayType;\r
import org.simantics.databoard.type.Datatype;\r
+import org.simantics.databoard.type.RecordType;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
import org.simantics.db.VirtualGraph;\r
OrderedSetUtils.replace(graph, resource, list.get(index), el);\r
} else {\r
Datatype dt = graph.getPossibleRelatedValue(resource, l0.HasDataType, Bindings.getBindingUnchecked(Datatype.class));\r
- if (dt instanceof ArrayType) {\r
+ if (dt instanceof RecordType) {\r
+ RecordType rt = (RecordType) dt;\r
+ RecordBinding rb = Bindings.getBinding(rt);\r
+ Binding indexBinding = rb.getComponentBinding(index);\r
+ Object parsedValue = indexBinding.parseValue(value, new DataValueRepository());\r
+ Object v = graph.getValue(resource, rb);\r
+ rb.setComponent(v, index, parsedValue);\r
+ graph.claimValue(resource, v, rb);\r
+ } else if (dt instanceof ArrayType) {\r
ArrayType at = (ArrayType) dt;\r
Binding binding = Bindings.getBinding(at);\r
Binding indexBinding = Bindings.getBinding(at.componentType());\r