I am using the following details for populating the combox, but unfortunately it is not working, the result is combox is blank:
VBSCRIPT:
Code: Select all
Function PopulateComboWithOffices()
Dim fso, strLine, pos, idx,srcFile
Const comboProp = "CBOX_OFFICE"
Const ForReading = 1
Const orderStart = 10
Const orderDelta = 5
Const SEP_1 = "#"
Const SEP_2 = "|"
tempOfficeFile = Session.Property("TempFolder") & "OfficeList.txt" 'Session.Property("AI_OFFICELIST")
'AI_OFFICELIST
'Read the text file and populate the combo-box
Set fso = CreateObject("Scripting.FileSystemObject")
Set srcFile = fso.OpenTextFile(tempOfficeFile, ForReading, False)
AIComboData = comboProp & SEP_1 & CStr(orderStart) & SEP_1 & CStr(orderDelta)
idx = -1
Do While srcFile.AtEndOfStream <> True
idx = idx + 1
strLine = srcFile.ReadLine
pos = InStr(strLine, ",")
strOfficeName = Left(strLine, pos-1)
strOfficeID = Mid(strLine, pos)
' the whole line will be inserted as value and the env. var. name as text
AIComboData = AIComboData & SEP_2 & strOfficeID & SEP_1 & strOfficeName
If idx = 0 Then
' select the first item (index 0) in the ComboBox
Session.Property(comboProp) = strOfficeID
End If
Loop
' Close the file
srcFile.Close
' Set the Property that will be used as input by the AI PopulateComboBox
' Custom Action
Session.Property("AI_COMBOBOX_DATA") = AIComboData
End FunctionEvent: DoAction
Arguments: PopulateComboWithOffices
Condition: 1 AND AI_COMBOBOX_DATA <> "SUCCESS"
Kindly let me know how to populate the combox box dynamically from the text file, a step by step process will be nicer, so as to get it work quickly.
FOLLOW US
Get the latest news in Application Packaging