Skip navigation
Home/Support/

Forums

33 Views 4 Replies Latest reply: Mar 10, 2010 10:32 PM by TanweerHq RSS
GeorgeWS User 476 posts since
Oct 9, 2002
Currently Being Moderated

Mar 9, 2010 2:00 PM

OnChange

I have a combobox on my main when I select a supplier I want the Supplier Component to Run its init() with the new supplier number. I cannot figure out how the componet knows when/how to fire the init() that would fire of my RO with the new SupplierID.

 

My main has a combobox and this local, to bring in the component:

 

<local:SupplierContent/>

 

So change the Combobox and the above would reload with the new supplier number. The RO and init() are all in the SupplierContent.

 

Any thoughts?

Thanks

 

George

  • Arun Lal User 27 posts since
    Dec 17, 2007
    Currently Being Moderated
    1. Mar 9, 2010 10:30 PM (in response to GeorgeWS)
    Re: OnChange

    in the change handler of your combobox you can create new instance of SupplierContent with the new selected supplier number.

     

    private function changeHandler():void{

         var supplierContentObj:SupplierContent = new SupplierContent();

         this.addChild(supplierContentObj)

    }

  • Arun Lal User 27 posts since
    Dec 17, 2007
    Currently Being Moderated
    3. Mar 10, 2010 9:38 PM (in response to GeorgeWS)
    Re: OnChange

    private function changeHandler():void{

         if(supplierContentObj){

              this.removeChild(supplierContentObj);

              supplierContentObj = null;

         }

         var supplierContentObj:SupplierContent = new SupplierContent();

         this.addChild(supplierContentObj);

    }

     

    Whenever a new instance of a component is created, the creationComplete event is dispatched. So, assuming that init() is the creationComplete eventHandler, this will also be called on every new instance creation.

  • TanweerHq User 52 posts since
    Oct 6, 2009
    Currently Being Moderated
    4. Mar 10, 2010 10:32 PM (in response to GeorgeWS)
    Re: OnChange

    Simple...

     

    private function comboChangehandler():void

    {

             this.addChild(s1)

             s1.init();

    }

     

    <local:SupplierContent id ="s1"/>

     

     

    thats it...

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points