I have a client dataset tag run an SQL query and it successfully retrieves data from database. I can see the HTML formatting is still in place in my tag browser. My dataset has 2 columns, I basically am searching for an index location in column 0, then referencing a different column by that index value. Then I bind the HTML text value to a label. However, my HTML formatting is removed at some point and I’m not sure how to proceed.
log = system.util.getLogger("Helper Popup:")
startLogging = True
if (event.propertyName == 'procedure'): #window custom property
procedureHelp = event.source.procedure
if startLogging:
log.info("Procedure for Help: %s " % procedureHelp)
# Get procedure description table information
dsProcedures = system.tag.read("[Client]Procedures/ProceduresDescription").value
system.tag.
# column 0 is procedures, column 1 should be the static description
listProcedureNames = list(dsProcedures.getColumnAsList(0))
listProcDesc = list(dsProcedures.getColumnAsList(1))
if startLogging:
log.info("all procedure names: %s " % listProcedureNames)
log.info("all descriptions: %s " % listProcDesc)
log.info("Procedure for Help: %s" % procedureHelp)
# only if the value is in there, index it.
if (procedureHelp in listProcedureNames) :
index = listProcedureNames.index( procedureHelp )
procedureDescription = listProcDesc[ index ]
if (startLogging):
log.info("Index = %s" % index)
log.info("Description: %s " % procedureDescription)
if (startLogging):
log.info("Description Type %s || Description: %s " % (type(procedureDescription), procedureDescription))
else:
if startLogging:
log.info("%s" % ("ITEM NOT FOUND IN DATABASE"))
procedureDescription = "ITEM NOT FOUND IN DATABASE"
# Set helper text to the description
event.source.getComponent('HelperText').text = procedureDescription
pass