If you cast parentDocument to your application class, the compiler can tell you whether you've constructed the right _expression_ or not. For example, if your app is MyApp.mxml, then do

 

    MyApp(parentDocument).filenet...

 

Without the cast, it can't typecheck anything because parentDocument is a generic Object on which you can access anything dynamically, including things that don't exist.

 

- Gordon

 


From: [email protected] [mailto:[email protected]] On Behalf Of Pascal Schrafl
Sent: Monday, October 23, 2006 4:26 PM
To: [email protected]
Subject: [flexcoders] Accessing methods in nested components

 

Hi all,

I'm new to Flex but used OpenLaszlo before. I must now build an
application to use with Zinc for my studies and as OpenLaszlo is not
supported by Zinc, I decided to use Flex 2.

I have several components and would like to call some methods in other
components.

Here's my application structure:

main Application

<component: login> which is a panel
<component: filenet> which is a canvas

within the filenet component I have several different components:

<component: sidebar> which is a accordion.

within the sidebar, there is a component called:
<component: addressBookTab> which is a canvas
and in this component there is an other component called:
<component: addressBook> which is a canvas

in the addressBook component, I want to call a HTTPService, but I must
call it, after the user has authenticated himself (using the login
component). I use the getAddressBookEntries() Function to call the
HTTPService.

I therefore have a function, that handles the login. If the server gives
back a true, then I would like to call the HTTPService and load the user
specific data.

I use the following command:

parentDocument.filenet.sidebar.addressbookTab.addressBook.getAddressBookEntries();

I use the parentDocument property to get out of the login component and
then try to go all the way down to the addressBook component and call
the appropriate function.

Unfortunately, I don't have any success, as the method doesn't get
called. Am I doing something wrong?

There must be some way to call a method from a component within an other
component. Perhaps I use to many components, and this causes the error?
I have ensured, that all id's assigned are unique within the whole
application.

I hope you can help me solve this problem. If it is useful to post the
source code, just let me know.

Thanks a lot for your help.

Best regards,

Pascal

__._,_.___

--
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
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to