I have a screen in Vision that has 15 rows of 6 text fields each. I'd like to populate these text fields with preexisting data upon loading the page, so I have the below script as an internalFrameActivated script, but I'm having trouble figuring out how to actually access the components in this way. I keep getting an error about doubleValue not existing for Type: None.
Is it possible to access components in this way, or is there a better way to do it?
if system.gui.getParentWindow(event).getComponentForPath('Root Container').updateFlag == True:
existingDataset = system.tag.read('[client]QC/VeneerThicknessCheck/UpdateExisting/ExistingDataForUpdateQuery').value
field_map = {
"tail": "TailField",
"center": "CenterField",
"head": "HeadField",
"average": "AverageField",
"length": "LengthField",
"width": "WidthField"
}
rows = 15
fields_per_row = len(field_map)
#Loop through all 15 rows, set all values to 0
for row in range(rows):
#group_component = event.source.parent.getComponent("Root Container.Group %d" % group_number)
groupVal = row + 1
group_component = system.gui.getParentWindow(event).getComponentForPath("Root Container.Group %d" % groupVal)
system.gui.getParentWindow(event).getComponentForPath('Root Container.Group 1.AverageField').doubleValue
#group = {}
for field_index, field_info in enumerate(field_map):
system.gui.messageBox("field_index: " + str(field_index) + "field_info: " + str(field_info) , "DEBUG")
component_name = field_info
system.gui.messageBox("component_name: " + str(component_name), "DEBUG")
data_index = (row * fields_per_row) + field_index
system.gui.messageBox("data_index: " + str(data_index), "DEBUG")
value = existingDataset[data_index]
system.gui.messageBox("group component: " + str(group_component), "DEBUG")
#system.gui.messageBox("group_component.getComponent(component_name): " + str(group_component.getComponent(component_name)),"DEBUG")
system.gui.messageBox("group_component.getComponent(component_name): " + str(group_component.getComponent(component_name)),"DEBUG")
group_component.getComponent(component_name).doubleValue = value
system.gui.messageBox("Row: " + str(row) + ". Component Name: " + str(component_name) + ". Value = " + str(value), "DEBUG")