ошибка: компонент не может быть реализован в состоянии «onlyVariable», так как предок исключен из «onlyVariable»? - PullRequest
1 голос
/ 25 июля 2011

У меня есть компонент ниже. и в компоненте VGroup находятся два компонента Form, один в исходном состоянии, а другой в состоянии onlyVariable. Однако я получаю сообщение об ошибке:

"Component cannot be realized within state 'onlyVariable' because an ancestor is     
excluded from 'onlyVariable".

Кто-нибудь хочет сказать мне, что означает эта ошибка?

Спасибо

<s:VGroup width="217" height="270" gap="3">

        <s:Form width="334" height="235" includeIn="initial">
            <s:layout>
                <s:FormLayout gap="0" />
            </s:layout>
            <s:FormItem width="137" label="Description:" height="25">
                <s:TextInput id="descTI" width="228" height="23"/>
            </s:FormItem>
            <s:FormItem width="137" label="Name:" height="25">
                <s:TextInput id="nameTI" width="227"/>
            </s:FormItem>
            <s:FormItem width="193" label="ModelType:">
                <s:DropDownList id="modelDDL" width="153"></s:DropDownList>
            </s:FormItem>
            <s:FormItem >
                <s:CheckBox x="-35" y="-32" width="92" id="chkBoxId" label="All variables" click="checkbox_clickHandler(event)"/>
            </s:FormItem>



            <s:FormItem label="Only variable:" includeIn="onlyVariable">

                <datasheet:SparkDataSheet
                    id="geoTableDG"
                    selectionMode="multipleRows"
                    width="226"
                    height="100"
                    dataFactory="{new ClassFactory(XML)}"
                    editable="true"
                    >
                    <datasheet:rendererMap>
                        <datasheet:CellMap>
                            <datasheet:types>
                                <datasheet:TypeMap
                                    type="text">
                                    <datasheet:rendererFactory>
                                        <cells:CellFactory productClass="{DefaultGridItemRenderer}"/>
                                    </datasheet:rendererFactory>
                                    <datasheet:editorFactory>
                                        <cells:CellFactory productClass="{XmlItemEditor}"/>
                                    </datasheet:editorFactory>  
                                </datasheet:TypeMap>
                                <datasheet:TypeMap
                                    type="text">
                                    <datasheet:rendererFactory>
                                        <cells:CellFactory productClass="{DefaultGridItemRenderer}"/>
                                    </datasheet:rendererFactory>
                                    <datasheet:editorFactory>
                                        <cells:CellFactory productClass="{XmlItemEditor}"/>
                                    </datasheet:editorFactory>  
                                </datasheet:TypeMap>
                            </datasheet:types>
                        </datasheet:CellMap>
                    </datasheet:rendererMap>
                    <datasheet:dataDescriptor>
                        <descriptor:ComplexVarDescriptor id="geoTabDescriptor">
                            <descriptor:properties>
                                <descriptor:TextVarDescriptor name="variable" type="text" >
                                    <descriptor:groupOptions>
                                        <descriptor:Option name="headerText" value="{resourceManager.getString('modelChainUI','variable')}"/>
                                    </descriptor:groupOptions>
                                </descriptor:TextVarDescriptor>
                                <descriptor:TextVarDescriptor name="level" type="text" >
                                    <descriptor:groupOptions>
                                        <descriptor:Option name="headerText" value="{resourceManager.getString('modelChainUI','level')}"/>
                                    </descriptor:groupOptions>
                                </descriptor:TextVarDescriptor>
                            </descriptor:properties>
                        </descriptor:ComplexVarDescriptor>
                    </datasheet:dataDescriptor>
                </datasheet:SparkDataSheet>
            </s:FormItem>

        </s:Form>   
    </s:VGroup>

1 Ответ

1 голос
/ 14 октября 2011

Вы видите, как у вас есть элемент s: Form?

<s:Form width="334" height="235" includeIn="initial">

Это один из предков (родитель, дедушка, вплоть до корня) элемента s: FormItem. Ваш s: FormItem установлен только для включения в состояние "onlyVariable", но предок установлен только для включения в состояние "initial" Чтобы это исправить, измените элемент s: Form, чтобы он включался как в начальное, так и в только переменное состояние.

<s:Form width="334" height="235" includeIn="initial,onlyVariable">
...