Re: [flexcoders] Another DataGrid itemEditor ComboBox challenge

2006-10-19 Thread Aaron West
Good to know and thanks for posting.  I wasn't aware of that keyword but there
are others like parentDocument you can use in custom MXML components.  And
of course in custom components built using AS3 there's the Application.application.*
reference available after importing mx.core.Application.


|  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 11:39 PM, Iko Knyphausen wrote:

Finally figured it out: It was a scope problem. mx:component> has its own scope which explains why nothing beyond your parents (editor host) “data” object is visible. If you want to use an inline itemEditor that is data bound to other dynamic sources than the hosting component’s dataProvider, such as an XML for example, you just use the “outerDocument” keyword as a prefix. The following is an example for an inline itemEditor combobox that gets its own data independently from the host (hope this helps someone to learn faster than me ;-) )
 
x-tad-bigger    mx:Component id=inlineEditor>/x-tad-bigger
x-tad-biggermx:ComboBox labelField=lastName dataProvider={/x-tad-biggerx-tad-biggerouterDocument/x-tad-biggerx-tad-bigger.userInfo.lastResult.users.user}/>/x-tad-bigger
x-tad-bigger    /mx:Component>  /x-tad-bigger
 

[flexcoders] Another DataGrid itemEditor ComboBox challenge

2006-10-18 Thread iko_knyphausen

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/
 



RE: [flexcoders] Another DataGrid itemEditor ComboBox challenge

2006-10-18 Thread Iko Knyphausen












Finally figured it out: It was a scope problem. mx:component
has its own scope which explains why nothing beyond your parents (editor host) data
object is visible. If you want to use an inline itemEditor that is data bound
to other dynamic sources than the hosting components dataProvider, such
as an XML for example, you just use the outerDocument keyword as
a prefix. The following is an example for an inline itemEditor combobox that
gets its own data independently from the host (hope this helps someone to
learn faster than me ;-) )




mx:Component id=inlineEditor

mx:ComboBox labelField=lastName dataProvider={outerDocument.userInfo.lastResult.users.user}/


/mx:Component 









From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Aaron West
Sent: Wednesday, October 18, 2006
12:17 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Another
DataGrid itemEditor ComboBox challenge





I ran into this same
problem with item renderers and item editors and
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):
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; 
 } 
 
  } 
}

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/






__._,_.___





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

  




__,_._,___