DropDown.enabled bug in Omnicore App SDK

There seams to be bug in javascript library with "enabled" property of DropDown component. It will generate error on html page:
"Document Load event routine failed. >>> TypeError: Unable to get property '_enabled' of undefined or null reference"
Code in Load event, that generates it, is following:

                drpLoggingLevel = new FPComponents.Dropdown_A();
                drpLoggingLevel.model = 
                {
                    items: 
                    [
                        "Silent",
                        "Brief",
                        "Verbose",
                        "Debug",
                    ]
                };
                drpLoggingLevel.selected = 2;
                drpLoggingLevel.onselection = doOnLoggingLevelChange;
                drpLoggingLevel.enabled = false; // bug in API ? - will generate error
                drpLoggingLevel.attachToId("LoggingLevelDropdown");


Comments

  • Fritz
    Fritz Tallinn
    OK, solved it immediately by myself.
    Writing "enabled" property must be AFTER attaching component to DIV element:

    drpLoggingLevel.attachToId("LoggingLevelDropdown");
    drpLoggingLevel.enabled = false;

    It might be still bug, as all other components will work either way.
    But at least workaround for now.