I am trying to create a small window that will update IP address’s that are tied to specific cell names in a database table. This is done by selecting a cell from a drop down box then the entry boxes shown in the picture below are filled base off columns in the database that corresponds to the selected cell. This script is done via a property change on the drop down menu.
When trying to change just the entry boxes after about 3 seconds it goes back to it’s previous value. Because the drop down’s box value didn’t change that script shouldn’t run again.
Property Change Script on the drop down box:
[code]connectionInfo = system.db.getConnectionInfo(dbConnectionName)
cell = event.source.selectedStringValue
query1 = “Select LocalIPAddress from ComputersIp where CellName = ‘%s’”%(cell)
query2 = “Select IPAddress from ComputersIp where CellName = ‘%s’”%(cell)
query3 = “Select HostMask from ComputersIp where CellName = ‘%s’”%(cell)
LocalIP = system.db.runScalarQuery(query1, dbConnectionName)
IP = system.db.runScalarQuery(query2, dbConnectionName)
HostMask = system.db.runScalarQuery(query3, dbConnectionName)
IPAdd = LocalIP.split(’.’)
event.source.parent.getComponent(‘Local1’).intValue = int(IPAdd[0])
event.source.parent.getComponent(‘Local2’).intValue = int(IPAdd[1])
event.source.parent.getComponent(‘Local3’).intValue = int(IPAdd[2])
event.source.parent.getComponent(‘Local4’).intValue = int(IPAdd[3])
IPAdd = IP.split(’.’)
event.source.parent.getComponent(‘IP1’).intValue = int(IPAdd[0])
event.source.parent.getComponent(‘IP2’).intValue = int(IPAdd[1])
event.source.parent.getComponent(‘IP3’).intValue = int(IPAdd[2])
event.source.parent.getComponent(‘IP4’).intValue = int(IPAdd[3])
event.source.parent.getComponent(‘Text Field’).text = HostMask
event.source.parent.getComponent(‘Cell Text’).text = event.source.selectedStringValue[/code]