Is there a way to bind back to where the original databind came from?
Not sure if thats the correct terminology for what I'm trying to
say...so here is my simple example.

In the example below it "kinda" happens, but only if you expand/close
a node after.  The list editor should also update the tree, and vice
versa.  I'm sure I'm missing a simple step here...

<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal">

<mx:Script>
      <![CDATA[
     
      [Bindable] public var fileSystemStructure:Object =
          {label:"mx", children: [
              {label:"Containers", children: [
                  {label:"Accordian", children:[]},
                  {label:"DividedBox", children: [
                      {label:"BoxDivider.as", data:"BoxDivider.as"},
                      {label:"BoxUniter.as", data:"BoxUniter.as"}]},
                  {label: "Grid", children:[]}]},
              {label: "Controls", children: [
                  {label: "Alert", data: "Alert.as"},
                  {label: "Styles", children: [
                      {label: "AlertForm.as", data:"AlertForm.as"}]},
                  {label: "Tree", data: "Tree.as"},
                  {label: "Button", data: "Button.as"}]},
              {label: "Core", children:[]}
          ]};
     

      ]]>
</mx:Script>

<mx:Panel>
      <mx:Tree id="tree" width="300" height="200"
dataProvider="{fileSystemStructure}"/>
      <mx:Form>
            <mx:FormItem label="label">
                  <mx:TextInput id="lbl" text="{tree.selectedItem.label}"/>
                  <mx:Button label="update" click="{tree.selectedItem.label=lbl.text}"/>
            </mx:FormItem>
      </mx:Form>
      <mx:Text text="tree: {tree.selectedItem.label}  form: {lbl.text}"
width="300"/>
</mx:Panel>

<mx:Panel>
      <mx:List id="list" dataProvider="{fileSystemStructure.children}"
width="300" height="200"/>
      <mx:Form>
            <mx:FormItem label="label">
                  <mx:TextInput id="lbl2" text="{list.selectedItem.label}"/>
                  <mx:Button label="update" click="{list.selectedItem.label=lbl2.text}"/>
            </mx:FormItem>
      </mx:Form>
      <mx:Text text="list: {list.selectedItem.label}  form: {lbl2.text}"
width="300"/>
</mx:Panel>     

</mx:Application>


--
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
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to