ComboBox underlying value

ComboBox underlying value

Postby RajJulha » Fri Oct 24, 2014 3:39 am

Im using KTM version 6 and have a form where I'm programatically populating a combobox by setting the ComboboxItems with something like "Code1|Description One;Code2|Description Two;Code4|Description Three" in the ValidationForm_BeforeComboBoxDropDown(ByVal ComboboxName As String, ByVal pXDoc As CASCADELib.CscXDocument, ByRef ComboboxItems As String) method.

When I run the form combobox shows Description One, Description Two, Descripion Three as selection items which is what I expect. When I select an item I want to pick up the corresponding code i.e. the value before the pipe that I set in ComboboxItems in the ValidationForm_AfterComboboxItemSelected(ByVal ComboboxName As String, ByVal pXDoc As CASCADELib.CscXDocument, ByVal SelectedIndex As Long, ByVal SelectedText As String) method. How can I achieve that? I wanted to avoid maintaining a 2 dimentional array and I thought that the fact I have SelectedIndex in this event I could pick up the field using the ComboBoxName but I can seem to find any property in the field object that stores my underlying codes associated with each combobox item.

Thanks
RajJulha
Participant
 
Posts: 14
Joined: Wed Nov 17, 2010 5:35 am

Re: ComboBox underlying value

Postby David Wright » Mon Oct 27, 2014 12:48 am

There is no API object for a ComboBox, even though
Code: Select all
ValidationForm.Forms(f).ComboBox
would be its natural place to be.
You only have access to
Code: Select all
ValidationForm.Fields(f).FieldStyle=CscValidationFieldStyleCombo
.
You will have to use an array or perhaps
Code: Select all
Split("Code1:Description One",":")(0)
, which would return "Code1". However the user would see "Code1:Description One" in the ComboBox.
David Wright
Participant
 
Posts: 18
Joined: Mon Jul 17, 2006 3:34 am
Location: Vienna


Return to Kofax Transformation Modules General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron