I’m not sure it’s a bug or something wrong with my method:
If I add a value to a table that provides items for a valuelist, the item doesn’t show in the valuelist until i quit the solution (or switch to Designer Mode, in Developer).
I tried to add a controller.SaveData, but it doesn’t help (the value, in fact, IS trasferred to the record, but the valuelist doesn’t update accordingly).
The problem doesn’t occur if a add the record manually. Here is my method:
var answer = plugins.dialogs.showQuestionDialog( "Liste valori", "Do you want to add value " + globals.gAggiungiLV + " to valuelist " + globals.gCampoLV + "?", "OK", "Cancel")
if ( answer == "OK" )
{
controller.loadAllRecords()
controller.newRecord()
controller.omitRecord()
controller.loadOmittedRecords()
//isolate the foundset, it's ugly, I know that ;-)
var fsUpdater = databaseManager.getFoundSetUpdater(foundset)
fsUpdater.setColumn(globals.gCampoLV,globals.gAggiungiLV)
fsUpdater.performUpdate();
controller.saveData();
Get_ValuelistItems();
}
Servoy 2.0.3, OSX.3.4