开发者

Flex 3: Getting error of "Parse error at '<mx:ComboBox>'>." What does it mean?

<mx:List columnCount="5" rowCount="11" width="100%" height="100%" dataProvider="{parentDocument.crewPositionsAC}" useRollOver="false" alternatingItemColors="[0xffffff, 0xe5e5e5]" borderStyle="none">
    <mx:itemRenderer>
        <mx:Component>
            <mx:Text text="{data}" color="#840021" selectable="false" />
            <mx:ComboBox id="studentType">
                <mx:ArrayCollection>
                    <mx:String>BFA1</mx:String>
                    <mx:String>BFA2</mx:String>
                    <mx:String>BFA3</mx:String>
                    <mx:String>MFA1</mx:String>
                    <mx:String>MFA2</mx:String>
                    <mx:String>MFA3</mx:String>
                    <mx:String>MFAw1</mx:String>
                    <mx:String>MFAw2</mx:String>
                    <mx:String>MFAw3</mx:String>
                开发者_开发问答</mx:ArrayCollection>
            </mx:ComboBox>
        </mx:Component>
    </mx:itemRenderer>
</mx:List>

When I try to save it, I get the error:

Parse error at '<mx:ComboBox>'.

Anybody able to see what's causing the error?


You can only have a single component defined as an in-line itemRenderer. You have two defined, a Text and a ComboBox. The solution is to wrap them up in a container. I used an HBox for the purposes of demonstration.

<mx:List columnCount="5" rowCount="11" width="100%" height="100%" dataProvider="{parentDocument.crewPositionsAC}" useRollOver="false" alternatingItemColors="[0xffffff, 0xe5e5e5]" borderStyle="none">
    <mx:itemRenderer>
        <mx:Component>
           <mx:HBox>
            <mx:Text text="{data}" color="#840021" selectable="false" />
            <mx:ComboBox id="studentType">
                <mx:ArrayCollection>
                    <mx:String>BFA1</mx:String>
                    <mx:String>BFA2</mx:String>
                    <mx:String>BFA3</mx:String>
                    <mx:String>MFA1</mx:String>
                    <mx:String>MFA2</mx:String>
                    <mx:String>MFA3</mx:String>
                    <mx:String>MFAw1</mx:String>
                    <mx:String>MFAw2</mx:String>
                    <mx:String>MFAw3</mx:String>
                </mx:ArrayCollection>
            </mx:ComboBox>
           </mx:HBox>
        </mx:Component>
    </mx:itemRenderer>
</mx:List>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜