Hi,
first i'd like to thank you all for helping me with my problem.
I took your suggestions and get a solution using the event change of
viewstack.
Code:
<mx:ViewStack id="viewstack1" selectedIndex="0" left="10" right="10"
top="10" bottom="10" width="100%" height="100%"
change="onViewChange(event)">
<mx:Box width="100%" height="100%" show="{reloadident();}"
id="boxidentificacao">
<identificacao:identificacao width="100%"
height="100%" id="identificacao"/>
< /mx:Box>
<mx:Box width="100%" height="100%" show="{reloadpais()}"
id="boxpais">
<pais:pais width="100%" height="100%" name="pais"
id="pais"/>
</mx:Box>
<mx:ViewStack/>
//onViewChange
*public* *function* onViewChange(event: IndexChangedEvent):*void
*
{
* var* box:Box;
* var* i: *identificacao*;
* var* p:pais;
box = viewstack1.getChildAt(event.newIndex) *as* Box;
* switch*(box.id)
{
* case* *"*boxidentificacao*"* : i =
box.getChildByName(*"identificacao"*) *as* identificacao;
i.refresh();
* break*;
* case* *"boxpais"* : p = box.getChildByName(*
"pais"*) *as* pais;
p.refresh();
* break*;
}
}
Once, thanks a lot.
2010/1/29 Jitendra Jain <[email protected]>
> Try with mx:States. Read about States in Flex. It will be helpful. You can
> also fire methods when the component is shown.
>
>
> On Fri, Jan 29, 2010 at 10:16 AM, Raghunathan Mohan <
> [email protected]> wrote:
>
>> Hi,
>>
>> Try to create a seperate Component for the ViewStack and then in the
>> parent application create object for it and add it to the parent
>> application. So whenever u open it will be automatically reloaded and also
>> when you are moving out or closing it remove that object from the parent
>> application ( this is for memory utilization).
>>
>> Regards,
>> Raghunathan. M
>>
>> On Thu, Jan 28, 2010 at 9:40 PM, Fausto Vaz <[email protected]
>> > wrote:
>>
>>> Hi everyone,
>>>
>>> i need some help with viewstacks.
>>> Im implementing an application where i have a viewstack and i'd like to
>>> refresh or reload the information of my viewstack's child everytime this
>>> child is shown.
>>>
>>> My ViewStack:
>>>
>>>
>>> <mx:ViewStack id="viewstack1" selectedIndex="0" left="10" right="10"
>>> top="10" bottom="10" width="100%" height="100%"
>>> change="onViewChange(event)">
>>>
>>> <mx:Box width="100%" height="100%">
>>>
>>> <identificacao:identificacao width="100%"
>>> height="100%"/>
>>>
>>> < /mx:Box>
>>>
>>> <mx:Box width="100%" height="100%">
>>>
>>> <pais:pais width="100%" height="100%" name="pais"
>>> />
>>>
>>> </mx:Box>
>>>
>>> I tried implementing a function that check for the selected item from
>>> viewstack but unsuccessfuly.
>>>
>>> Any ideias?
>>>
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Flex India Community" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected]<flex_india%[email protected]>
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/flex_india?hl=en.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Flex India Community" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected]<flex_india%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/flex_india?hl=en.
>>
>
>
>
> --
> Thanks and Regards,
> JJain,
>
> If you have knowledge, let others light their candles in it --Margaret
> Fuller:
>
> --
> You received this message because you are subscribed to the Google Groups
> "Flex India Community" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<flex_india%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/flex_india?hl=en.
>
--
You received this message because you are subscribed to the Google Groups "Flex
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/flex_india?hl=en.