[flexcoders] Re: Databinding on an XML node via node index

2006-10-27 Thread ben.clinkinbeard
XMLListCollection is the XML-based equivalent of ArrayCollection and
provides a getItemAt() method as well.

HTH,
Ben


--- In flexcoders@yahoogroups.com, iko_knyphausen [EMAIL PROTECTED] wrote:

 
 I am binding a text control to an XML (e4x) node via index. Looks
 something like
 
 mx:Text htmlText = {myXml.myNodes[0].uniqueItem.toString()} /
 
 This works well as a unidirectional binding from a data source, however,
 the compiler throws a warning saying Databinding will not be able to
 detect changes when using square bracket operator. For Array please use
 ArrayCollection.getItemAt().
 
 I was looking for a method that would allow node access via index,
 basically an equivalent of the getItemAt() method, but could not find
 anything. Could not cast to mx.collections.ArrayCollection either.
 
 Has someone done this before? thx.






--
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] Re: Databinding on an XML node via node index

2006-10-27 Thread iko_knyphausen



Thanks Ben.
I may be trying the wrong thing here, but this is the only workingway I came up with:
mx:XMLListCollection id="xlcReportGrid" source="{XMLList(cbReportInfoName.selectedItem.lineItems.columns.column)}"/ and then the Text control that binds to it:mx:TexthtmlText="{xlcReportGrid.getItemAt(0).content}" /
cbReportInfoName is a dropdown combo (the last in a chain)that gets its data from another combo which gets its data from an HTTPService (e4x). It seems, whenever the data gets "thru" thedataprovider of a ComboBox, its selectedItem object is nota XMLListCollection anymore (I think this was different with an ArrayCollection - before I used e4x as resultFormat from the HTTPService). 
The problem with the aboveis that I cannot use the following (I would like to bind to nodes on different levels): 
mx:XMLListCollection id="xlcReportGrid" source="{XMLList(cbReportInfoName.selectedItem)}"/ and thenbindit like this:mx:TexthtmlText="{xlcReportGrid.lineItems.columns.column.getItemAt(0).content}" /
This throws a compile error of "access to a possibly undefined property 'lineitems'..." Any ideas? thx -Iko
--- In flexcoders@yahoogroups.com, "ben.clinkinbeard" [EMAIL PROTECTED] wrote: XMLListCollection is the XML-based equivalent of ArrayCollection and provides a getItemAt() method as well.  HTH, Ben   --- In flexcoders@yahoogroups.com, "iko_knyphausen" iko@ wrote: I am binding a text control to an XML (e4x) node via index. Looks  something likemx:Text htmlText = "{myXml.myNodes[0].uniqueItem.toString()}" /This works well as a unidirectional binding from a data source, however,  the compiler throws a warning saying "Databinding will not be able to  detect changes when using square bracket operator. For Array please use  ArrayCollection.getItemAt()".I was looking for a method that would allow node access via index,  basically an equivalent of the getItemAt() method, but could not find  anything. Could not cast to mx.collections.ArrayCollection either.Has someone done this before? thx. 

__._,_.___





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

  




__,_._,___