[flexcoders] Re: Passing parameter to component
Actually you are correct, it is not assigned untill later. The reason my little test with the label didn't work was because I forgot the [Bindable] tag in the actionscript. --- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote: > > It might get assigned to null at startup and then to something else > later as the binding expression becomes valid > > > > > > From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On > Behalf Of Cathal > Sent: Saturday, July 26, 2008 3:36 PM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] Passing parameter to component > > > > Hi, > > I'm trying to pass the selected item on a combo box in one component > to another component. > > If i bind it to a label it works fine, > > code: > > > but passing it into another component it doesn't work. > > code: > > strProjectName="{headerComp.cbProject.selectedItem.projectname}" /> > > While in debugging mode strProjectName seems to be null, so it doesn't > see to be assigned anything. > > Any suggestions? >
[flexcoders] Re: Passing parameter to component
I've tried to just display the contents of this variable to test it, but nothing gets printed to the screen. code inside the component: If I replace the selectedItem code with a string "Hello", this prints to the screen correctly. --- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote: > > It might get assigned to null at startup and then to something else > later as the binding expression becomes valid > > > > > > From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On > Behalf Of Cathal > Sent: Saturday, July 26, 2008 3:36 PM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] Passing parameter to component > > > > Hi, > > I'm trying to pass the selected item on a combo box in one component > to another component. > > If i bind it to a label it works fine, > > code: > > > but passing it into another component it doesn't work. > > code: > > strProjectName="{headerComp.cbProject.selectedItem.projectname}" /> > > While in debugging mode strProjectName seems to be null, so it doesn't > see to be assigned anything. > > Any suggestions? >
[flexcoders] Passing parameter to component
Hi, I'm trying to pass the selected item on a combo box in one component to another component. If i bind it to a label it works fine, code: but passing it into another component it doesn't work. code: While in debugging mode strProjectName seems to be null, so it doesn't see to be assigned anything. Any suggestions?
[flexcoders] Re: Populate label with item from combobox
Thanks Alex that works perfect. --- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote: > > In MXML, you might have > > > > > > > > > > > > From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On > Behalf Of Cathal > Sent: Monday, July 21, 2008 3:40 PM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] Re: Populate label with item from combobox > > > > Hi Alex, > > How do I achieve this? > > I've tryed doing lbl.text = selectedItem.projectname but I beleave > this needs an event first, no? Any suggestions? > > Thanks, > Cathal > > --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> > , "Alex Harui" wrote: > > > > Tyr binding the label to the combobox's selectedItem.projectname > > >
[flexcoders] Re: Populate label with item from combobox
Hi Alex, How do I achieve this? I've tryed doing lbl.text = selectedItem.projectname but I beleave this needs an event first, no? Any suggestions? Thanks, Cathal --- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote: > > Tyr binding the label to the combobox's selectedItem.projectname >
[flexcoders] Populate label with item from combobox
Hi, I have a combobox which is populate by an XML file and works fine. code: Once, the combo box is changed it fills a label with the value selected. code: private function setCompanyName(evt:Event):void { lblCompanyName.text = evt.currentTarget.selectedItem.projectname; } The problem is what if only one item exists in the combobox. There cannot be any change. I want the label to be filled by default item in the combobox and also on any chnage, I've tryed with selectedItem and selectedIndex but with no luck. Any suggestions is appreciated. Kind Regards, Cathal O'Brien