Good day,
I have a text field that will have a string and i want to pass that string to an specific table, once a button is pressed. The script will section the string in two parts and will write each part in one specific column, but so far i can only write it in one column. My script is the following:
def ames_string(value):
parte = value[0:2]
ames = value[2:]
lista_ames = [ames,parte]
return lista_ames
value=event.source.parent.getComponent(‘Text Field’).text
tabla=event.source.parent.getComponent(‘Table’).data
string_parte = ames_string(value)
Los nombres de las columnas en lista
Columnas = system.dataset.getColumnHeaders(tabla)
col_ames = tabla.getColumnAsList(tabla.getColumnIndex(Columnas[0]))
col_parte =tabla.getColumnAsList(tabla.getColumnIndex(Columnas[1]))
col_ames.append(string_parte[0])
col_parte.append(string_parte[1])
col_1 = system.dataset.toDataSet([Columnas[0]], [ for x in col_ames])
col_2 = system.dataset.toDataSet([Columnas[0]], [[y] for y in col_ames])
event.source.parent.getComponent(‘Table’).data = col_1
In the last line i tried to add col_1,col_2 but it didnt worked.
Thank you for the support.
Regards
CMV