Hi
We migrated to Servoy 5.0.1 last week. I encounter problems with with selected record: When loading a foundset via query the selected index seems to be -1 now. Did this change since Servoy 4?
Regards
Hi
We migrated to Servoy 5.0.1 last week. I encounter problems with with selected record: When loading a foundset via query the selected index seems to be -1 now. Did this change since Servoy 4?
Regards
that shouldnt happen, if there is data and you load your foundset in a form the selected index should be set on the first row.
What exactly do you do?
This is what I do. The last command in new. Without the last command no record is selected, which I never noticed before in Servoy
queryCourses = " SELECT code, period_fraction_name, period_school_year, subject_code" +
" FROM courses" +
" WHERE period_fraction_name = '" + globals.plcSelectedPeriod.split(' ')[0] + "'" +
" AND period_school_year = " + globals.plcSelectedPeriod.split(' ')[1] +
" AND subject_code = '" + selectedSubjectCode + "'" +
" ORDER BY code";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), queryCourses, null, 100);
controller.loadRecords(dataset);
controller.setSelectedIndex(1); // this command was not needed before
Johan, do you see why this happens now?
Regards
did the foundset have a selection before you call loadRecords (or better said did the foundset had data?)
BufferedDataSet has data, but rowIndex is -1
no not the buffered dataset
The foundset before you do this:
controller.loadRecords(dataset);
so before that line
what is the foundset.getSize() or foundset.getSelectedIndex()
Sorry. Foundset is empty, selected index is 0:
=>foundset
FoundSet {alldataproviders:array[26],maxRecordIndex:0,selectedIndex:0}
can you create a case for this?
I have looked at it and it is not a simple fix.
So you could reproduce it?
Thanks for looking.
Best regards
Birgit
To reproduce it, clear the foundset onLoad of the form and use the form on a tab panel.
Regards
Birgit