Ah, left that meta in there by accident,
was messing around. It’s not being dispatched. As for the ModelLocator, yes, formSection
is typed as a FormSection. IsValid property registers as “false”
when the view is initialized (as it should) yet when the property changes to “true”.
Da button, she’s broke, won’t enable. public static var selectedFormSection :FormSection =
new FormSection(); From:
flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Matt Chotin Who’s dispatching the
“change” event? And does ModelLocator have formSection typed
as a FormSection? Or is it just a static variable of unknown type? From:
flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Stacy Young Is it not possible to bind the enabled
attribute of a button to a property? As the property changes the state of the
button remains disabled i.e. <mx:Button id="saveButton"
label="Create Section" height="22" enabled="{ModelLocator.formSection.isValid}"
click="sectionViewHelper.submitForm()" /> FormSection reference: import
org.nevis.cairngorm.vo.ValueObject; class com.optimal.raven.vo.FormSection implements ValueObject { public static var regClass = Object.registerClass( "com.optimal.raven.application.resource.data.FormSection", com.optimal.raven.vo.FormSection
); public var code : String
= ""; public var description : String
= ""; public var languageDetails : Array = new Array(); public var active : Boolean
= true; public function FormSection() { } //---------------------------------------------------------------------------- [ChangeEvent("change")] public function get isValid() :Boolean {
if(description.length &&
languageDetails.length)
{
for(var i:Number=0; i <
languageDetails.length; i++)
{
if(!languageDetails[i].isValid){
trace("FormSection
FALSE DETAIL");
return false;
}
}
trace("FormSection
TRUE");
return true;
} else {
trace("FormSection
FALSE");
return false;
} } } Cheers, Stace
|
- RE: [flexcoders] Binding to properties? Stacy Young
- RE: [flexcoders] Binding to properties? Matt Chotin