When I hardcode “.text” ( line 10 that is commented out) when populating the text for a component it works, but using a variable does not. I know I can work around this by testing for the type from my power table, but is there a way to make this assignment without doing this?
def loopPowerTable():
pyRowData = system.dataset.toPyDataSet(event.source.parent.getComponent('formOnePopulated2').data)
for row in pyRowData:
sqlField = row[1]
dataType = row[2]
componentName = row[3] + " " + row[1]
assign = sqlField+" = event.source.parent.getComponent('"+componentName+"')."+dataType
try:
sqlField = event.source.parent.getComponent(componentName).dataType
#sqlField = event.source.parent.getComponent(componentName).text
print "OK"+assign
except AttributeError:
print "AttributeError:"+assign