Having some trouble populating a ComboBox with a Table, maybe someone can spot the error. I keep getting an error message saying "Attempt to call Global 'tEnhed' (a table value)"
This is the code I have:
On app Startup:
On Page OnShow:
I thourght it could have something to do with the table so I tried to take the data from the table and pass it to a string that would then be parsed to the combobox but I get the same error, now its just on the string in stead..
What am I doing wrong?
Cheers,
Jonas
This is the code I have:
On app Startup:
Code:
--********** Create constant Tables START **********-- tEnhed = {"Bæver", "Ulv-Toomai", "Ulv-Seeonee", "Junior", "Spejder", "Senior", "Rover", "Leder"};
Code:
--********** Make sure all fields are empty START **********-- ComboBox.DeleteItem("cbEnhed", -1); Input.SetText("ipAdresse", ""); Input.SetText("ipPostnr", ""); Input.SetText("ipCpr", ""); Input.SetText("ipIndmeldt", ""); Input.SetText("ipEfternavn", ""); Input.SetText("ipFornavn", ""); Label.SetText("lbCity", "By"); --********** Make sure all fields are empty END **********-- --Used dialog to make sure the data is in the table -- result = Table.Concat(tEnhed, ";", 1, TABLE_ALL); -- Dialog.Message("Notice", result, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); --********** Read Constant tables to fields START **********-- -- Prevent the ComboBox from updating ComboBox.SetUpdate("cbEnhed", false); -- Add Table to ComboBox nEnhed = Table.Count(tEnhed); min = 1; -- The number to start at max = nEnhed; -- The number to stop at for count = min, max do local cEnhed = tEnhed(count); Dialog.Message("Notice", cEnhed, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); --ComboBox.AddItem("cbEnhed", cEnhed, count); end ComboBox.SetUpdate("cbEnhed", true);
What am I doing wrong?
Cheers,
Jonas
Comment