[flexcoders] Custom Component Instantiation Sequencing?

2005-09-12 Thread Tariq Ahmed






 Hey all.

I'm not really sure what to accurately name the topic of this
relatively simple question - but I'll roll with Custom Component
Instantiation Sequencing.

- Got a Tab Navigator.
- I have a generic component I made which I use in various locations.
It generates a summary of some information depending on information
passed to it. On Initialize it takes a username and calls a remote
object to get back the appropriate data. This works fine when the main
mxml file calls it, but when a custom component calls it the Initialize
seems to occur before the databinding occurs.

The problem I'm having is related to the timing of how this component
is initialized.

This works fine:

mx:Canvas label="Canv1"/
 comp:Summary id="s1" myUserName=""/
/mx:Canvas

mx:Canvas label="Canv2"/
 comp:MyComp/
 comp:Summary id="s2" myUserName="{someVar}"/
/mx:Canvas

S2 calls the remote object with the appropriate username, and gets back
the data...

This doesn't work fine:

mx:Canvas label="Canv1"/
 comp:Summary id="s1" myUserName=""/
/mx:Canvas

mx:Canvas label="Canv2"/
 comp:MyComp/ --- This component has comp:Summary
id="s2" myUserName="{someVar}"/ inside it
/mx:Canvas

What happens is that the remote object is called before myUserName is
set. myUserName in the S2 does get set appropriately, but not before
the RO is called - hence returning back the wrong data. 

I tried playing around with creation policy settings, but no luck. Any
thoughts? thanks!










--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Software design and development
  
  
Macromedia flex
  
  


Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  










Re: [flexcoders] Custom Component Instantiation Sequencing?

2005-09-12 Thread Tariq Ahmed






Man... everytime I post to the list, I figure it out a few minutes
later.

Using creationComplete instead of initialize did the trick. What threw
me off is it working fine being called from the main app, and the
behavior changing when called from another component.




Tariq Ahmed wrote:

  
  
 Hey all.
  
I'm not really sure what to accurately name the topic of this
relatively simple question - but I'll roll with Custom Component
Instantiation Sequencing.
  
- Got a Tab Navigator.
- I have a generic component I made which I use in various locations.
It generates a summary of some information depending on information
passed to it. On Initialize it takes a username and calls a remote
object to get back the appropriate data. This works fine when the main
mxml file calls it, but when a custom component calls it the Initialize
seems to occur before the databinding occurs.
  
The problem I'm having is related to the timing of how this component
is initialized.
  
  This works fine:
  
mx:Canvas label="Canv1"/
 comp:Summary id="s1" myUserName=""/
/mx:Canvas
  
mx:Canvas label="Canv2"/
 comp:MyComp/
 comp:Summary id="s2" myUserName="{someVar}"/
/mx:Canvas
  
S2 calls the remote object with the appropriate username, and gets back
the data...
  
  This doesn't work fine:
  
mx:Canvas label="Canv1"/
 comp:Summary id="s1" myUserName=""/
/mx:Canvas
  
mx:Canvas label="Canv2"/
 comp:MyComp/ --- This component has comp:Summary
id="s2" myUserName="{someVar}"/ inside it
/mx:Canvas
  
What happens is that the remote object is called before myUserName is
set. myUserName in the S2 does get set appropriately, but not before
the RO is called - hence returning back the wrong data. 
  
I tried playing around with creation policy settings, but no luck. Any
thoughts? thanks!
  
  
  
  









--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





  




  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.