Hello. I need to bind a fairly complex form to a matching XML structure. The form has text fields, lots of check-boxes and some radio-buttons.
I'd like to pre-load values into some of the form fields with an XML file pulled down from the server, and then after the user SUBMITs, upload the modified XML back to the server. I'd like to take advantage of two-way binding and E4X. It seems like it ought to be easy, but I have run into problems. How do I get two-way binding with an XML structure? I can make one-way binding (from XML to Form) work, but the changes to the form are not reflected back into the XML structure. I think I have to convert the XML to an XMLListCollection, but then I can't make E4X work for simple things like CheckBox? How do I bind a CheckBox to the XML data? I tried something like: <mx:checkbox selected="{xdata.item.selected}" /> where the XML looked like this: <root> <item> <selected>false</selected> </item> </root> but it didn't work (always shows as selected, even when "false") Of course I can convert the XML to a custom object structure and manually map everything, but then I have to give up the power of E4X and automatic binding. Am I missing something? Thanks in advance!