Thursday, 9 August 2012

spark combobox dataprovider validator for dependency dropdowns


<mx:FormItem label="School" styleName="formLabel">
<s:ComboBox id="schoolNameOtherInfo" width="150"
labelField="displayValue"
dataProvider="{getSchoolMappings(leadDetails.studentInfo.studentPersonalInfo.district)}"
selectedIndex="{AppUtil.getSelectedIndex(getSchoolMappings(leadDetails.studentInfo.studentPersonalInfo.district), leadDetails.studentInfo.studentPersonalInfo.school)}"
textInput="schoolNameOtherInfo_textInputHandler(event)"
change="schoolNameOtherInfo_onChangeEvent(event)"
focusOut="schoolNameOtherInfo_focusOutHandler(event)" buttonMode="true" />
</mx:FormItem>
<mx:FormItem label="Eligibility" styleName="formLabel">
<s:DropDownList id="eligibility"
width="150"
dataProvider="{getSchoolEligibleMappings(leadDetails.studentInfo.studentPersonalInfo.school)}"
labelField="displayValue"
selectedIndex="{AppUtil.getSelectedIndex(getSchoolEligibleMappings(leadDetails.studentInfo.studentPersonalInfo.school), leadDetails.studentInfo.studentPersonalInfo.eligibility)}"/>
</mx:FormItem>




protected function schoolNameOtherInfo_onChangeEvent(event:IndexChangeEvent):void
{
if (schoolNameOtherInfo.selectedIndex >= 0 )
filterSchoolEligible(event);
else
{
schoolNameOtherInfo.selectedIndex=-1;
eligibility.selectedIndex=-1;
}
}

protected function schoolNameOtherInfo_focusOutHandler(event:FocusEvent):void
{

if (schoolNameOtherInfo.selectedIndex >= 0 )
filterSchoolEligible(event);
else
{
schoolNameOtherInfo.selectedIndex=-1;
eligibility.selectedIndex=-1;
}
}

public var schoolName:String;
protected function schoolNameOtherInfo_textInputHandler(event:TextEvent):void
{
schoolName=event.text;
}







Thanks for Visiting........................

No comments:

Post a Comment