The case is I need a combobox showing element partially based on selection of another combobox.
I found a solution from google which manage the element by coding, by building combobox in init of form, so I can remove and insert element of combobox in another combobox.selectionChange.
But so far my understanding is to save a combobox value into datatable, the combobox need to be bound.
So how can I save the unbound combobox value? By setting the value into another non-visible control(bound) in form while selectionChange? Or maybe there is another easier way?
You can override modified() method of an unbound ComboBox and there set a form datasource's cursor field value based on the ComboBox selection.
You can also consider using a bounded field for the enum, then:
- create a table which contains one record per available enum value.
- override the lookup() method to select from the new table, the available selections will be filtered base on your other enum field.
If element of Combobox B limited / filtered by selection of Combobox A, using the method both from above(so far i tested GL00MIE modified method)...
Which mean the value of Combobox B must refer to Combobox A, in order to get the real meaning of value, is it?
Combobox A Enum:
Combobox B Enum(In Total):
After the filter, Combobox B Enum will become:
Condition 1(If Combobox A Enum == 0)
Condition 2(If Combobox B Enum == 1)
This is what I seen now, am I correct?
That's right. Note that when you explicitly fill the list of Combobox' values you also have to explicitly convert the selection() value to your enum value (in the example above: 0 for Apple into 2 for Apple and 1 for Orange into 3 for Orange).
I'm not sure about the "explicitly convert the selection() value to your enum value", which method of combobox I should use for this action?
Also in the modified field method I suppose, when you try to assign the unbound combobox value to the record.
Currently the only method I know to set Combobox value is Combobox.Selection(0).
wjgohI'm not sure about the "explicitly convert the selection() value to your enum value", which method of combobox I should use for this action?
Thanks for your help, I found and figure out this just now, so I verified the answer.
Recently I got error on reply in this community.....Sometimes I gave up to reply......