actionscript 3 - Flex ItemRender Not Updating Data Source -


First of all, the mass and horrible coding of code, it's been a while since I have done AS3 / Flex And I miss that I can not remember how to get an Item Renderer inside the motherrander to update item source. For example, GymButton2.mxml adds a button with data that is clicked smoothly, when a button is clicked and it updates the original data source activation, but ..Isn't it and I think this is because the binding is not working as expected?

The main. Mxml

  & lt; Fx: script & gt; & Lt ;! [CDATA [Import mx.collections.ArrayCollection; Import mx.events.FlexEvent; [BinDable] Public Works Active Gym: Jim 2; ]] & Gt; & Lt; / Fx: script & gt; & Lt; S: Data group x = "33" y = "56" width = "200" height = "200" datataprador = "{activeGym.sets}" itemRenderer = "GymSetRenderer" & gt; & Lt; S: layout & gt; & Lt; S: Vertical layout / & gt; & Lt; / S: Layout & gt; & Lt; / S: Datagroup & gt; & Lt; / S: WindowedApplication & gt;  

Gym2.as

  package {import flash.events.EventDispatcher; Import Flash.events.IEventDispatcher; Import mx.collections.ArrayCollection; [BinDable] Public Class Gym 2 Event Dispatcher {Public Priority Set: Araaculation = New Archequency (); Public Function Gym2 (Target: IEventDispatcher = null) {Super (Target); } Public Function addSet (Set: GymSet): Zero {sets.addItem (set); }}}  

GymSetRenderer.mxml

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; S: item renderer xmlns: fx = "http://ns.adobe.com/mxml/2009" xmlns: s = "library: //ns.adobe.com/flex/spark" xmlns: mx = "library: / /ns.adobe.com/flex/mx "autoDrawBackground =" false "xmlns: local =" * "& gt; & Lt; S: layout & gt; & Lt; S: Vertical layout / & gt; & Lt; / S: Layout & gt; & Lt; S: Label FontSize = "27" text = "{data.title}" /> & Lt; S: Data Group Detector = "{data.data}" item renderer = "Gymbutton 2" & gt; & Lt; S: layout & gt; & Lt; S: horizontal layout / & gt; & Lt; / S: Layout & gt; & Lt; / S: Datagroup & gt; & Lt; / S: ItemRenderer & gt;  

GymButton2.mxml

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; S: item renderer xmlns: fx = "http://ns.adobe.com/mxml/2009" xmlns: s = "library: //ns.adobe.com/flex/spark" xmlns: mx = "library: / /ns.adobe.com/flex/mx "autoDrawBackground =" true "& gt; & Lt; Fx: script & gt; & Lt ;! [CDATA [Secure Function Onclick (Event: Mouse Event): Zero {Data = Data + 1; }] & Gt; & Lt; / Fx: script & gt; & Lt; S: Button label = "{data}" height = "70" click = "onclick (event)" /> & Lt; / S: ItemRenderer & gt;  


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -