I am extend the button component to be use in repeater loop that will disabled if an mtutorColList arraycollection contain an exist value.
When I click the button, it will disabled and add a value '10011' to mtutorColList, I try to do pagination test to page 2, all button are enabled since there no button contain '10011' but when I go back to page 1 where I couldn't get the button contain '10011' to be disabled.
The dispatch did not called labelHandler.
package com {
import flash.events.Event;
import flash.events.MouseEvent;
import mx.controls.LinkButton;
import mx.core.Application;
public class Btn extends LinkButton{
public function Btn(){
super();
super.enabled = true;
this.addEventListener(MouseEvent.CLICK, labelHandler);
this.addEventListener("enableChanged", labelHandler);
}
private function labelHandler(event:Event):void{
trace("Set button disable");
super.label = "Added";
super.enabled = false;
validateNow();
}
override public function set enabled(value:Boolean):void {
if (Application.application.mtutorColList != '' && Application.application.increment < Application.application.lop) {
if(Application.application.productsDP[Application.application.increment][1] == Application.application.mtutorColList) {
super.dispatchEvent(new Event("enableChanged"))
trace("Disable button");
} else {
super.enabled = true;
trace("Normal button");
}
Application.application.increment++;
}
}
}
}