IT2Be
June 22, 2015, 1:58pm
1
In Servoy 7.3.1 I create a new datasource:
vSet = databaseManager.createEmptyDataSet(0, vNames);
vSource= vSet.createDataSource(‘name’, vTypes);
And I add a row:
vSet.addRow(vValues);
I can not edit the values anymore doing:
vSet.setValue(vRow,vColumn,vSingle)Value);
Am I doing something wrong or is this not possible?
One thing that has really bitten me is that this kind of code fails silently if Servoy does not like one or more of the column names.
I let users create custom fields. I would simply take their names and replace the spaces with underscores. Then they started using characters like “/”…
at least in 7.4.4 this works for me. What do you mean by “I can not”?
I have this:
var vSet = databaseManager.createEmptyDataSet(0, ["one", "two", "three"]);
var vSource= vSet.createDataSource('name', [JSColumn.TEXT, JSColumn.TEXT, JSColumn.TEXT]);
vSet.addRow(["a", "b", "c"]);
application.output(vSet.getAsText(",","\n","",false))
vSet.setValue(1,2,"x");
application.output(vSet.getAsText(",","\n","",false))
application.output(vSet.getValue(1,2))
var fs = datasources.mem[vSource].getFoundSet();
fs.loadAllRecords();
application.output(fs.getRecord(1))
and it gives me
a,b,c
a,x,c
x
Record[DATA:Row(mem:name)[DATA:_sv_rowid=3,one=a,two=x,three=c, CALCULATIONS: {}]] …
IT2Be
June 24, 2015, 6:07pm
4
The issue was that my Servoy version was apparently (too) old.
After upgrading the issue did not show up anymore.
Thanks for your help Patrick!