I am having difficulty with a global var (as data provider) when I do the following code:
var cat1_sql = '';
var maxrows = 100;
var calling_obj = 2;
cat1_sql = 'select screen_label, cat1_id from cat1 ' +
'where is_active = 1 and call_obj_id = ' + calling_obj + ' order by cat1_order';
globals.dcm_debug_glob(globals.catWidget1); // internal debug method in lieu of Debugger - global var ok here
var dataset = databaseManager.getDataSetByQuery('global_all', cat1_sql, null, maxrows)
dataset.rowIndex = 1;
globals.catWidget1 = dataset.getValue(1,2)
var nameArray = dataset.getColumnAsArray(1);
var idArray = dataset.getColumnAsArray(2);
// all of the var's and arrays above check out ok in the debugger ...
application.setValueListItems('cat1_sql', nameArray, idArray);
elements.cat_pick1.requestFocus()
The global var catWidget1 is a numeric intended to store the id’s being returned into idArray. When I run the above code and try to look at the global var catWidget1 in the onDataChange event, global var catWidget1 becomes a null.
Can anyone see what I am doing wrong? This is a very simple application at this point as it is within a separate method node and I am just starting on some reusable objects.
Michael