·
FIELDS/Function
·
FIELDS/Control (Will contain the control name
of the combo on which the new item will be added)
·
FIELDS/Method
·
FIELDS/Param1
·
FIELDS/Param2
·
FIELDS/Param3
·
FIELDS/Param4
·
FIELDS/Param5
·
FIELDS/RetValue
·
InternalValue (contains the key value of the
new item)
·
ExternalValue (contains the description of the
new item)
Add this
code to your “AddComboValue” source code
object:
Object x = new Object();
ObComboData myobj = (ObComboData)ObUserAPI.callMethod(getFunction(), &(1:), &(2:), &(3:), &(4:), &(5:), &(6:), &(7:), &(8:), x);
myobj.addValuePair(&(11:).getValue(), new
ObCharFld(&(10:).getValue()) );
Open the
Action Diagram from your function that uses the combo box and add the following
fields on any of your local variables:
· Control+
· Method_
· FIELDS/RetValue
· InternalValue
· ExternalValue
In the Action
Diagram, to add a new item on the combo box you just need call your
“AddComboValue” source code after set the values of the fields “Control+”, “ExternalValue”
and “InternalValue”.
Example:
For
the values of the other parameters please use the same values we defined in the
following image
NOTE:
REMEMBER that the value of the “Control (Control+)”
parameter must be the same value of the control name from the combo box in your
function, otherwise the API function cannot find the control on which the new
item must be added. In our test function we configured the control name with
the same value of the “name” triple assigned to the field that we used as combo
box, this way we can use the “Name” statement in the Action Diagram to set the
same value of the control name in the “Control” parameter, please see the
following images to see how we used this, remember that this is just an example
and you can use any other method to achieve the same result:
Generate your
function and test it: