Hi,
I am using 8.0.1 perspective module and trying to populate a dropdown. I’ve notice that options is a dictionary with keys inside of a list. So doing this works:
dropdownNode = self.getSibling("DropdownNode").props.options
dict = {}
list = []
call = system.db.createSProcCall("cGetAllNodeIdAndLocation","Humidex_r")
system.db.execSProcCall(call)
ds = call.getResultSet()
for row in range(ds.getRowCount()):
dict[row] = ds.getValueAt(row,"Location")
for key,val in dict.items():
dropdownNode[row].value = key
dropdownNode[row].label = val
I can populate the dropdown, but it will fail if I do not add array element first within the dropdown. So I tried to append this just for testing:
dropdownNode = self.getSibling("DropdownNode").props.options
list = []
list.append({"label": "hello", "value":2})
list.append({"label": "goodbye", "value":0})
dropdownNode = list
I get no errors with the bottom script in my logs on the gateway, but it doesn’t add a new array element inside the component.
This is the information returned by the stored procedure:
Id | Location |
---|---|
1 | D2ux Weld |
2 | RU Weld |
3 | KL Weld |
4 | C1E2 Weld |
5 | W Wax |
Has anyone else ran into this?