Flex Mobile - DropDownList/ComboBox Issue

1149
1
07-29-2013 06:57 AM
RoryBiggadike
New Contributor II
Quick question on the dropdownlist issue in Mobile Flex. We've added the codedValueDomainField into our AttributeInspectorSkin.as:

if (!codedValueDomainField)
{
 codedValueDomainField = new ClassFactory(com.esri.ags.skins.fieldClasses.CodedValueDomainField);
}


We'd like to use the eskimo combobox component com.pialabs.eskimo.components.ComboBox (unless somebody has a better suggestion) in the application. Just wondering if I could get some quick help on what I need to add to the AttributeInspectorRenderer.as. I was using the following:

    private function swapNonMobileFriendlyComponent(renderer:UIComponent):UIComponent
    {
        var result:UIComponent;
        if (renderer is spark.components.DropDownList)
        {
            renderer.visible = false;
            m_originalRenderer = renderer;
            addChild(renderer);
   
   var dropDownList:spark.components.DropDownList = renderer as spark.components.DropDownList;
   var newDropDownList:ComboBox = new com.pialabs.eskimo.components.ComboBox();
   newDropDownList.dataProvider = dropDownList.dataProvider;
   newDropDownList.addEventListener(DropDownEvent.CLOSE, dropDownListCloseHandler);
   newDropDownList.addEventListener(ItemClickEvent.ITEM_CLICK, dropDownListChangeHandler); 
   newDropDownList.selectedItem = dropDownList.selectedItem;
   if(dropDownList.selectedItem != undefined)
   {
    newDropDownList.prompt = dropDownList.selectedItem.name;
   }
   newDropDownList.labelField = "name";
   newDropDownList.enabled = dropDownList.enabled;
   result = newDropDownList;
        }
        else
        {
            result = renderer;
        }
        return result;
    }


Thanks

--Rory
Tags (2)
0 Kudos
1 Reply
AaronNash1
Occasional Contributor II
you could look through this project, they have a lot of custom skins built with drop down menus and date spinners. They built a nice pop-up window for editing a feature webservice.
0 Kudos