Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 618075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:30:19+00:00 2026-05-13T18:30:19+00:00

ok guy I really need you super brain on this, I had pull out

  • 0

ok guy I really need you super brain on this, I had pull out all my hair now, I just want to throw the towel on this one, ok, I have an itemrender component, which you can see below

<?xml version="1.0" encoding="utf-8"?>
<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" horizontalScrollPolicy="off"
   creationComplete="hbox1_creationCompleteHandler(event)">
 <mx:Script>
  <![CDATA[
   import events.ColorsEvent;

   import mx.binding.utils.BindingUtils;
   import mx.binding.utils.ChangeWatcher;
   import mx.events.ColorPickerEvent;
   import mx.events.FlexEvent;
   import mx.utils.ObjectProxy;

   import utils.BindingUniform;

   private var _op:ObjectProxy;
   private var cw:ChangeWatcher;

   public function get value():String
   {
    return data.color;
   }

   override public function set data(value:Object):void
   {
    super.data = value;
    cp.selectedColor = data.color;
   }

   protected function cp_changeHandler(event:ColorPickerEvent):void
   {
    _op[data.id] = event.color;
   }

   protected function hbox1_creationCompleteHandler(event:FlexEvent):void
   {
    if(_op == null){
     _op = BindingUniform.op;
     cw = BindingUtils.bindSetter(dispatchColorChange, _op, data.id);
    }
   }

   protected function dispatchColorChange(color:uint):void
   {
    cp.selectedColor = color;
    dispatchEvent(new ColorsEvent("colorChanged", color, data.id, true, true));
   }

  ]]>
 </mx:Script>
 <mx:Text width="145"><mx:text>{data.value}</mx:text></mx:Text>
 <mx:ColorPicker id="cp" dataProvider="{parentDocument.colorsDP}" 
     valueCommit="{data.color = cp.selectedColor}"
     change="cp_changeHandler(event)" editable="false"/>
 <mx:Label id="colorLb" text="{cp.selectedItem.label}"/>
</mx:HBox>

the idea is when I change a color in one of the colorpicker then the change event must change a dynamic variable in my _op objectProxy object.

Ok when I scroll the list the colors remains in their respective colorpicker, which is ok, my problem comes in the binding, when the itemRender creationcomplete event fire, I make a bindsetter to the variable so I can dispatch an event when the property change.

The reason why I’m need the bind is because some times the user will load a previous saved model and I want the variables to remain bind so the colorpicker will select the color correctly, hope make sense.

Ok the thing is the first visible rows work just ok, but when I scroll the list, and try to change the color the color change in the colorpicker but my bind is gone, and if I scroll back to the top the first ones also aren’t bind no more, I really don’t know what else to do, I’m just hopping somebody has done something similar or just have the solution to this, please help me if you can, I really need it, I think my brain is going to explode, why binding is so hard in Flex? thanks!!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T18:30:19+00:00Added an answer on May 13, 2026 at 6:30 pm

    An itemRenderer should not reach outside itself to pull in data and especially not set values or participate in bindings or events. It should only act on the data passed to it. It can read values out of data or set values on data which can then be broadcast out to other components.

    Programming this way, making your itemRenderer components fully encapsulated little black boxes, will greatly simplify development and generally work much better and avoid hard-to-find-and-debug problems like memory leaks and dangling item renderer references which can respond to evens even after you’ve long since thought they vanished.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm an IIS guy and know its as simple as just using the http://[computername]/path
I am taking an assembly course now, and the guy who checks our home
Using SubSonic3, I have this generic method (thanks to linq guy, James Curran): public
I'm predominately a Java guy, which is why I need some assistance on what
INITIAL NOTE: This is just for a personal tinkering project; I'm not writing enterprise
So I was doing a refresher on Ruby and I saw this guy's blog
Some guy called one of my Snipplr submissions crap because I used if ($_SERVER['REQUEST_METHOD']
I'm a web-guy stuck in application world in VS 2005. I created my windows
As a UI guy (coding and designing user interfaces) I often find myself in
I'm a php guy, but I have to do some small project in JSP.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.