Appframe Knowledge Base

1 hits

Binding ComboBox in a form to show items from a custom data object

// For how to define an array data object, see:

// For this to work properly, the field must be defined without LookupID and ListBoxID
// in the form panel designer in the app designer.

// Get a reference to the field
var vMyField = formMain.getFields("IssueType");

// Define the ComboBox instance and pass in the data object
vMyField.comboBox = new af.controls.ComboBox({
    input: vMyField.getInput(),
    limitToList: true,
    dropdown: af.controls.DropdownList,
    dataObject: vDataObject,
    displayMember: "Type",
    valueMember: "Type",
    clearable: false

// Push the selected value into the form's data object, or call the form's callback
vMyField.comboBox.attachEvent("onValueChanged", function (pValue) {
    if (vMyField.validDataObjectField) {
        vDO.currentRow(, pValue);
    } else if (typeof vMyField.callback === "function") {

// Makes the ComboBox not broken
$(vMyField.getInput()).attr("type", "afComboBox");

components web · Perma link post comment Posted by: Jan Henrik Endsjø Høiland (13-nov-2013)