The <mx:component> tag creates a new scope block.  You can use outerDocument
to reference outer scoped variables.

See
http://livedocs.macromedia.com/labs/1/flex20beta3/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000857.html

Darren




>--- In flexcoders@yahoogroups.com, [EMAIL PROTECTED] wrote:
> >
> > Greetings -
> >
> > Here's an Item renderer that turns name into a link. That link
>should
> > simply lead to a different view state (named 'edit'):
> >
> > <mx:DataGridColumn headerText="Name" dataField="Name">
> >       <mx:itemRenderer>
> >             <mx:Component>
> >             <mx:LinkButton
> >                   label="{data.Name}"
> >                   click="currentState='edit'"
> >                   enabled="true"
> >                   textAlign="left"
> >                   color="#2c6e9f">
> >             </mx:LinkButton>
> >       </mx:Component>
> >       </mx:itemRenderer>
> > </mx:DataGridColumn>
> >
> > (the 'edit' state exists further down in the mxml.)
> >
> > The link buttons render properly but clicking the links produces
>this
> > error:
> >
> > ArgumentError: Undefined state 'edit'.
> >       at mx.core::UIComponent/::getState()
> >       at mx.core::UIComponent/::findCommonBaseState()
> >       at mx.core::UIComponent/::commitCurrentState()
> >       at mx.core::UIComponent/setCurrentState()
> >       at mx.core::UIComponent/set currentState()
> >       at ProspectStates_inlineComponent1/___LinkButton1_click()
> >
> >
> > A button however (just below the data grid containing the
> > itemRenderer above) does work. Here's the markup for the button:
> >
> > <mx:Button label="Edit" click="currentState='edit'" id="button9"/>
> >
> > How is it that the same click syntax works for the button but
>fails
> > for the linkButton in the Item Renderer?
> >
> > (Note that all the markup above is within a custom component;
>these
> > view states are not states of the application tag.
> >
> > cheers, ethan
> >
>
>
>
>
>
>
>
>
>--
>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
>
>
>
>
>
>




--
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




Reply via email to