DataGrid's. The only thing I could think of was the item renderers/editors
only exist in the runtime context and therefore cannot reference any
variables defined in ActionScript in your MXML file. I solved this problem
by _not_ using an inline editor and instead writing my own component
in a separate AS file. If you're more comfortable with MXML you can
write your component in MXML code instead of AS3. You'll get much more
leverage and control if you use AS3.
Here's an example:
// DataGrid column looks like this (showing only relevant attributes):
// The all caps "location name" is the value returned from a Web service
// call bound to the DataGrid itself.
<mx:DataGridColumn dataField="LOCATIONNAME" itemEditor="components.LocationNameComboBox"/>
// LocationNameComboBox.as (stored in the "components" directory):
<x-tad-smaller>package components {
import mx.controls.ComboBox;
import mx.core.Application;
public class LocationNameComboBox extends ComboBox
{
public function LocationNameComboBox()
{
super();
dataProvider = Application.application.overrideLocationList;
enabled = false;
}
}
}</x-tad-smaller>
In the AS3 code, notice I import mx.core.Application and then use the appropriate
code to reference an ArrayCollection (overrideLocationList) that exists in the main
MXML application code. This means my custom ComboBox component is
tightly coupled to my main application but this was the best I could come up with.
I'm sure someone with more experience could offer a better way.
| Aaron West
| aaron AT trajiklyhip DOT com
| http://www.trajiklyhip.com/blog/
| Certified Advanced Adobe ColdFusion MX 7 Developer
| Certified Macromedia FlashMX Developer
| Adobe Community Expert
On Oct 18, 2006, at 1:32 PM, iko_knyphausen wrote:
I am trying to use a drop-down combo as itemEditor for a datagrid
column. Everything is honkey-dory when the itemEditor is defined as a
component (like the inlineEditor example in the docs) with static array
of strings (or objects, if you want). Trouble comes into paradise when
you want to have the itemEditor itself retrieve its data dynamically via
dataProvider binding to a different source, such as XML, etc. All my
attempts lead to a compile error 1120: Access of undefined property.
Any ideas - 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
<*> 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/

