Data binding question
Got a bit of an XML puzzle here.
I've got a sample XML file called clothes.xml, which looks like this:
I've got a TextArea called nameTA, a CheckBox called swellCB, and a DataGrid called clothesGrid.
I've also got a DataSet called clothesDS.
I've set the myXMLCon URL to clothes.xml, and the direction to receive. I start out the code with myMXLCon.trigger().
I've bound myXMLCon's results.person.ljname to the TextField, and results.person.swell_guy to the CheckBox. I've bound the results.person.clothes.article array to the DataSet's dataProvider, and linked that to the DataGrid's dataProvider. All the bindings are "in/out."
After I run the SWF, the TextArea, ComboBox, and DataGrid populate just fine... the XML is being read, triggered, and all the data went through the bindings.
If I change what's in the TextArea, and I trace the XML using trace(myXMLCon.results), the XML has changed to reflect the new value... the binding is two-way. Likewise, if I check and uncheck the CheckBox and trace the XML, the value has changed. However, if I change the DataSet (adding or deleting a record, or changing a value in one of the records already there), the DataGrid changes to reflect the new values... but not the XML. The binding is only working one-way, but I'm trying to make it two-way.
The sample is here. The XML file is here. The source is here.
I know it's the weekend... thanks everyone for your help!
I've got a sample XML file called clothes.xml, which looks like this:
<?xml version="1.0" ?>In Flash 8, I've got an XMLConnector called myXMLCon.
<person>
<ljname>pauljtaylor</ljname>
<swell_guy>true</swell_guy>
<clothes>
<article type="hat" color="red" size="6" />
<article type="shoes" color="black" size="11" />
<article type="shirt" color="blue" size="17" />
</clothes>
</person>
I've got a TextArea called nameTA, a CheckBox called swellCB, and a DataGrid called clothesGrid.
I've also got a DataSet called clothesDS.
I've set the myXMLCon URL to clothes.xml, and the direction to receive. I start out the code with myMXLCon.trigger().
I've bound myXMLCon's results.person.ljname to the TextField, and results.person.swell_guy to the CheckBox. I've bound the results.person.clothes.article array to the DataSet's dataProvider, and linked that to the DataGrid's dataProvider. All the bindings are "in/out."
After I run the SWF, the TextArea, ComboBox, and DataGrid populate just fine... the XML is being read, triggered, and all the data went through the bindings.
If I change what's in the TextArea, and I trace the XML using trace(myXMLCon.results), the XML has changed to reflect the new value... the binding is two-way. Likewise, if I check and uncheck the CheckBox and trace the XML, the value has changed. However, if I change the DataSet (adding or deleting a record, or changing a value in one of the records already there), the DataGrid changes to reflect the new values... but not the XML. The binding is only working one-way, but I'm trying to make it two-way.
The sample is here. The XML file is here. The source is here.
I know it's the weekend... thanks everyone for your help!
