i have the component below. and in the VGroup component,are two Form components, one in the ‘initial’ state and the other in the ‘onlyVariable’ state.yet i get the error:
"Component cannot be realized within state 'onlyVariable' because an ancestor is
excluded from 'onlyVariable".
Anyone cares to tell me what this error means?
Thanks
<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>
You see how you have that s:Form element?
That’s one of the ancestors (parent, grandparent, all the way up to root) of the s:FormItem element. Your s:FormItem is set only to be included in the “onlyVariable” state, but the ancestor is set only to be included in the “initial” state. To fix this, change your s:Form element to be included in both initial and onlyVariable states.