[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 PS: Is there any Flex 2 user here, who could help me out? I'm able to pay a bit money, as I'm on a very thight deadline and must get that app done in the next 14 days. Please contact me. I would just need an expert, who I may ask some questions, when I'm off the track again. -- 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 * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * Your email settings: Individual Email | Traditional * To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) * To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[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 Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * Your email settings: Individual Email | Traditional * To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) * To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
RE: [flexcoders] Accessing methods in nested components
Your theory looks ok. Can you successfully access anything in the main application scope using parentDocument? If not, try using Application.application instead. Once you can hit the application level members, work your way down to whre you need to be. Tracy From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Pascal Schrafl Sent: Monday, October 23, 2006 7:26 PM To: flexcoders@yahoogroups.com 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 __,_._,___
RE: [flexcoders] Accessing methods in nested components
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: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Pascal Schrafl Sent: Monday, October 23, 2006 4:26 PM To: flexcoders@yahoogroups.com 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 __,_._,___
Re: [flexcoders] Accessing methods in nested components
Hi Tracy, Thanks for your answer. And sorry for the trippe posting. I used the mx.core.Application.application approach too, but I always get an error #1069. I have no clue, why it doesn't work. From the nested component (addressBook) I can access the sessionID by using parentDocument.parentDocument.parentDocument.sessionID but not vice-versa. Best regards, Pascal Tracy Spratt wrote: Your theory looks ok. Can you successfully access anything in the main application scope using parentDocument? If not, try using Application.application instead. Once you can hit the application level members, work your way down to whre you need to be. -- 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 * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * Your email settings: Individual Email | Traditional * To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) * To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [flexcoders] Accessing methods in nested components
Hello Gordon, Thanks for the hint. I will try this. I didn't know, that the parentDocument must be cast, because I use it also (parentDocument.currentState='') and there it works. I will try it and give you a feedback, if it solved my problem. Best regards, Pascal Gordon Smith wrote: 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 -- 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 * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * Your email settings: Individual Email | Traditional * To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) * To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [flexcoders] Accessing methods in nested components
Hi Gordon, My main application is called main.mxml and I have tried to cast it: main(parentDocument).filenet.sidebar.addressbookTab.addressBook.getAddressBookEntries(); I still get the Error #1069. Thanks for the 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 Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * Your email settings: Individual Email | Traditional * To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) * To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
RE: [flexcoders] Accessing methods in nested components
What is the message for Error #1069? Try tracing expressions like main(parentDocument).filenet, main(parentDocument).filenet.sidebar and see what you get. - Gordon From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Pascal Schrafl Sent: Tuesday, October 24, 2006 2:39 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Accessing methods in nested components Hi Gordon, My main application is called main.mxml and I have tried to cast it: main(parentDocument).filenet.sidebar.addressbookTab.addressBook.getAddressBookEntries(); I still get the Error #1069. Thanks for the 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 __,_._,___
RE: [flexcoders] Accessing methods in nested components
It doesn't HAVE to be cast. It will execute fine without it, if the _expression_ is correct. But casting will enable the compiler to catch an incorrect _expression_ and also make it execute faster, because looking up properties and methods on a non-dynamic type is faster than looking them up on a dynamic one. - Gordon From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Pascal Schrafl Sent: Tuesday, October 24, 2006 2:15 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Accessing methods in nested components Hello Gordon, Thanks for the hint. I will try this. I didn't know, that the parentDocument must be cast, because I use it also (parentDocument.currentState='') and there it works. I will try it and give you a feedback, if it solved my problem. Best regards, Pascal Gordon Smith wrote: 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 __._,_.___ -- 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 __,_._,___