profilView.as 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606
  1. import com.imt.intimamedia.events.user.ExportDataEvent;
  2. import com.imt.intimamedia.events.user.SearchCitiesEvent;
  3. import com.imt.intimamedia.events.user.SearchZipCodesEvent;
  4. import com.imt.intimamedia.events.user.TermsAgreedEvent;
  5. import com.imt.intimamedia.events.user.UpdateUserEvent;
  6. import com.imt.intimamedia.helpers.ComboBoxHelper;
  7. import com.imt.intimamedia.helpers.WindowShadeButton;
  8. import com.imt.intimamedia.model.ApplicationModelLocator;
  9. import com.imt.intimamedia.views.common.ImtToaster;
  10. import com.imt.intimamedia.views.general.register.ApplicationTermsPopUp;
  11. import com.imt.intimamedia.vo.HospitalVo;
  12. import com.imt.intimamedia.vo.PersonVo;
  13. import com.imt.intimamedia.vo.ProbeVo;
  14. import com.imt.intimamedia.vo.UltraSoundScannerVo;
  15. import com.imt.intimamedia.vo.UserVo;
  16. import flash.events.Event;
  17. import flash.events.MouseEvent;
  18. import flash.net.URLLoader;
  19. import flash.net.URLRequest;
  20. import flash.net.URLStream;
  21. import mx.collections.ArrayCollection;
  22. import mx.containers.FormItem;
  23. import mx.controls.Alert;
  24. import mx.controls.ComboBox;
  25. import mx.controls.Menu;
  26. import mx.events.ListEvent;
  27. import mx.events.MenuEvent;
  28. import mx.events.ValidationResultEvent;
  29. import mx.managers.PopUpManager;
  30. import mx.resources.ResourceManager;
  31. import mx.utils.ObjectUtil;
  32. import mx.validators.Validator;
  33. import org.alivepdf.display.Display;
  34. [Bindable]
  35. private var _model : ApplicationModelLocator = ApplicationModelLocator.getInstance();
  36. [Bindable]
  37. private var _maxYear : int = new Date().fullYear;
  38. [Bindable]
  39. private var _otherActivityActive : Boolean = false;
  40. private var _updateAddressManually : Boolean = false;
  41. private var _conditionsAreRead : Boolean = false;
  42. [Bindable]
  43. private var _partOneValid : Boolean = false;
  44. [Bindable]
  45. private var _partTwoValid : Boolean = false;
  46. [Bindable]
  47. private var _partThreeValid : Boolean = false;
  48. private function showView() : void
  49. {
  50. countryComboBox.selectedIndex = ComboBoxHelper.findIndex(_model.connectedUser.hospital.country, _model.countries );
  51. }
  52. private function actionOnZonesFromErrors( event : Event, zone : String ) : void
  53. {
  54. switch( zone )
  55. {
  56. case "ZoneOne":
  57. organization.opened = false;
  58. user.opened = false;
  59. scanner.opened = false;
  60. vatContainer.opened = false;
  61. mathContainer.opened = false;
  62. break;
  63. case "ZoneTwo":
  64. organization.opened = !organization.opened;
  65. user.opened = !user.opened;
  66. scanner.opened = !scanner.opened;
  67. if( organization.opened )
  68. {
  69. vatContainer.opened = false;
  70. mathContainer.opened = false;
  71. }
  72. break;
  73. }
  74. }
  75. private function actionOnZones( event : Event, zone : String ) : void
  76. {
  77. if( event.target is WindowShadeButton )
  78. {
  79. switch( zone )
  80. {
  81. case "ZoneOne":
  82. organization.opened = false;
  83. user.opened = false;
  84. scanner.opened = false;
  85. vatContainer.opened = false;
  86. mathContainer.opened = false;
  87. break;
  88. case "ZoneTwo":
  89. organization.opened = !organization.opened;
  90. user.opened = !user.opened;
  91. scanner.opened = !scanner.opened;
  92. if( organization.opened )
  93. {
  94. vatContainer.opened = false;
  95. mathContainer.opened = false;
  96. }
  97. break;
  98. case "ZoneThree":
  99. vatContainer.opened = !vatContainer.opened;
  100. mathContainer.opened = !mathContainer.opened;
  101. if( vatContainer.opened )
  102. {
  103. organization.opened = false;
  104. user.opened = false;
  105. scanner.opened = false;
  106. }
  107. break;
  108. }
  109. }
  110. }
  111. private function displayShippingAddress( selected : Boolean ) : void
  112. {
  113. _updateAddressManually = selected;
  114. shippingAddressTextInput.text = "";
  115. shippingAddressLabel.visible = selected;
  116. shippingAddressLabel.includeInLayout = selected;
  117. copyAddress( invoiceAddressTextInput.text );
  118. }
  119. private function copyAddress( address : String ) : void
  120. {
  121. if( !_updateAddressManually )
  122. shippingAddressTextInput.text = address;
  123. }
  124. private function searchCityWithZipCode() : void
  125. {
  126. if( countryComboBox.selectedIndex != -1 )
  127. {
  128. _model.cities = new ArrayCollection();
  129. new SearchCitiesEvent( zipCodeTextInput.text, countryComboBox.selectedItem.code ).dispatch();
  130. var menuZipCode : Menu = Menu.createMenu( null, _model.cities, false );
  131. menuZipCode.addEventListener( MenuEvent.ITEM_CLICK, citySelected );
  132. menuZipCode.width = cityTextInput.width;
  133. menuZipCode.show( 258, 307 );
  134. }
  135. else {
  136. var toastMessage : ImtToaster = new ImtToaster();
  137. toastMessage.titleMessage = ResourceManager.getInstance().getString( 'labels', 'register.searchImpossibleTitle' );
  138. toastMessage.message = ResourceManager.getInstance().getString( 'labels', 'register.searchImpossibleZip' );
  139. toastMessage.level = ImtToaster.WARNING;
  140. ApplicationModelLocator.getInstance().toaster.toast( toastMessage );
  141. }
  142. }
  143. private function searchZipCodeWithCity() : void
  144. {
  145. if( countryComboBox.selectedIndex != -1 )
  146. {
  147. _model.zipCodes = new ArrayCollection();
  148. new SearchZipCodesEvent( cityTextInput.text, countryComboBox.selectedItem.code ).dispatch();
  149. var menuZipCode : Menu = Menu.createMenu( null, _model.zipCodes, false );
  150. menuZipCode.addEventListener( MenuEvent.ITEM_CLICK, zipCodeSelected );
  151. menuZipCode.width = cityTextInput.width;
  152. menuZipCode.show( 258, 279 );
  153. } else {
  154. var toastMessage : ImtToaster = new ImtToaster();
  155. toastMessage.titleMessage = ResourceManager.getInstance().getString( 'labels', 'register.searchImpossibleTitle' );
  156. toastMessage.message = ResourceManager.getInstance().getString( 'labels', 'register.searchImpossibleCity' );
  157. toastMessage.level = ImtToaster.WARNING;
  158. ApplicationModelLocator.getInstance().toaster.toast( toastMessage );
  159. }
  160. }
  161. private function zipCodeSelected( event : MenuEvent ) : void
  162. {
  163. zipCodeTextInput.text = event.item.toString();
  164. }
  165. private function citySelected( event : MenuEvent ) : void
  166. {
  167. cityTextInput.text = event.item.toString();
  168. }
  169. private function changeQuestion( event : ListEvent, comboBox : ComboBox ) : void
  170. {
  171. var newSelection : Object = ( event.currentTarget as ComboBox ).selectedItem;
  172. var otherListSelection : Object = comboBox.selectedItem;
  173. var index : int = 0;
  174. comboBox.dataProvider = ObjectUtil.copy( _model.questions ) as ArrayCollection;
  175. for( index = 0; index < comboBox.dataProvider.length; index++ )
  176. {
  177. if( comboBox.dataProvider[ index ].code == newSelection.code )
  178. {
  179. ( comboBox.dataProvider as ArrayCollection ).removeItemAt( index );
  180. break;
  181. }
  182. }
  183. for( index = 0; index < comboBox.dataProvider.length; index++ )
  184. {
  185. if( otherListSelection != null && comboBox.dataProvider[ index ].code == otherListSelection.code )
  186. {
  187. comboBox.selectedIndex = index;
  188. break;
  189. }
  190. }
  191. }
  192. private function onChangeActivity( event : ListEvent ) : void
  193. {
  194. if( event.currentTarget.selectedItem.code == "S09" )
  195. _otherActivityActive = true;
  196. else
  197. _otherActivityActive = false;
  198. }
  199. private function checkTextInputEntry (textInputWithSkin : *, formItem : FormItem) : void
  200. {
  201. if (textInputWithSkin.errorString)
  202. {
  203. formItem.setStyle("color", "#7c0b13");
  204. formItem.setStyle("fontWeight", "bold");
  205. }
  206. else
  207. {
  208. formItem.setStyle("color", "#555557");
  209. formItem.setStyle("fontWeight", "normal");
  210. }
  211. }
  212. private function checkComboBoxEntry (comboBox : ComboBox, formItem : FormItem) : void
  213. {
  214. if (!comboBox.selectedItem)
  215. {
  216. formItem.setStyle("color", "#7c0b13");
  217. formItem.setStyle("fontWeight", "bold");
  218. }
  219. else
  220. {
  221. formItem.setStyle("color", "#555557");
  222. formItem.setStyle("fontWeight", "normal");
  223. }
  224. }
  225. private function update( event : MouseEvent ) : void
  226. {
  227. var toastMessage : ImtToaster = new ImtToaster();
  228. var validatorsPartOne : Array = [];
  229. var validatorsPartTwo : Array = [ countryValidator, phoneCenterValidator, lastNameValidator, firstNameValidator,
  230. phoneValidator, activityValidator, cityValidator, zipCodeValidator,
  231. invoiceAddressValidator, shippingAddressValidator, hospitalValidator,
  232. frequencyValidator, brandValidator ];
  233. var validatorsPartThree : Array = [ ];
  234. var validators : Array = [ countryValidator,
  235. phoneCenterValidator, lastNameValidator, firstNameValidator, phoneValidator,
  236. activityValidator,cityValidator, zipCodeValidator,
  237. invoiceAddressValidator, shippingAddressValidator, hospitalValidator,
  238. frequencyValidator, brandValidator
  239. ];
  240. if( _otherActivityActive )
  241. {
  242. validatorsPartTwo.push( otherActivityValidator );
  243. validators.push( otherActivityValidator );
  244. }
  245. var validatorsError : Array = Validator.validateAll( validators );
  246. var validatorsPartOneError : Array = Validator.validateAll( validatorsPartOne );
  247. var validatorsPartTwoError : Array = Validator.validateAll( validatorsPartTwo );
  248. var validatorsPartThreeError : Array = Validator.validateAll( validatorsPartThree );
  249. _partOneValid = true;
  250. _partTwoValid = true;
  251. _partThreeValid = true;
  252. if( validatorsPartTwoError.length != 0 )
  253. partTwo.enabled = true;
  254. else
  255. partTwo.enabled = false;
  256. if( validatorsPartThreeError.length != 0 )
  257. partThree.enabled = true;
  258. else
  259. partThree.enabled = false;
  260. var textInputWithSkinList : Array = [ hospitalTextInput, invoiceAddressTextInput, shippingAddressTextInput,
  261. cityTextInput, zipCodeTextInput, phoneCenterTextInput, lastNameTextInput, firstNameTextInput, phoneTextInput,
  262. otherActivityTextInput, brandTextInput ];
  263. var textInputLabel : Array = [ hospitalLabel, invoiceAddressLabel, shippingAddressLabel,
  264. cityLabel, zipCodeLabel, phoneCenterLabel, lastNameLabel, firstNameLabel, phoneLabel,
  265. otherActivityLabel, brandLabel ];
  266. var comboBoxList : Array = [ countryComboBox, activityComboBox ];
  267. var comboBoxLabel : Array = [ countryLabel, activityLabel ];
  268. for (var i : int = 0; i < textInputWithSkinList.length; i++)
  269. checkTextInputEntry(textInputWithSkinList[i], textInputLabel[i]);
  270. for (i = 0; i < comboBoxList.length; i++)
  271. checkComboBoxEntry(comboBoxList[i], comboBoxLabel[i]);
  272. if( validatorsError.length != 0 )
  273. {
  274. toastMessage = new ImtToaster();
  275. toastMessage.titleMessage = ResourceManager.getInstance().getString('labels', 'error.allFieldsTitle');
  276. toastMessage.timeToLive = 7;
  277. toastMessage.message = ResourceManager.getInstance().getString('labels', 'error.allFields');
  278. toastMessage.level = ImtToaster.WARNING;
  279. _model.toaster.toast( toastMessage );
  280. }
  281. else
  282. {
  283. var newProbeVo : ProbeVo = new ProbeVo();
  284. newProbeVo.id = ApplicationModelLocator.getInstance().connectedUser.probe.id;
  285. newProbeVo.frequency = frequencyNumericStepper.value
  286. var newUltraSoundScannerVo : UltraSoundScannerVo = new UltraSoundScannerVo();
  287. newUltraSoundScannerVo.id = ApplicationModelLocator.getInstance().connectedUser.ultraSoundScanner.id;
  288. newUltraSoundScannerVo.name = nameTextInput.text;
  289. newUltraSoundScannerVo.brand = brandTextInput.text;
  290. newUltraSoundScannerVo.type = typeTextInput.text;
  291. newUltraSoundScannerVo.age = new Date(ageNumericStepper.value);
  292. newUltraSoundScannerVo.probes.push( newProbeVo );
  293. var newHospitalVo : HospitalVo = new HospitalVo();
  294. newHospitalVo.id = ApplicationModelLocator.getInstance().connectedUser.hospital.id;
  295. newHospitalVo.name = hospitalTextInput.text;
  296. newHospitalVo.addressInvoicing = invoiceAddressTextInput.text;
  297. newHospitalVo.addressShipping = shippingAddressTextInput.text;
  298. newHospitalVo.city = cityTextInput.text;
  299. newHospitalVo.zipCode = zipCodeTextInput.text;
  300. newHospitalVo.country = countryComboBox.selectedItem.code;
  301. newHospitalVo.phone = phoneCenterTextInput.text;
  302. newHospitalVo.fax = faxCenterTextInput.text;
  303. // update for ethnic group (avalaible for all countries but France)
  304. _model.connectedUser.hospital.country = newHospitalVo.country;
  305. var newPersonVo : PersonVo = new PersonVo();
  306. newPersonVo.id = ApplicationModelLocator.getInstance().connectedUser.person.id;
  307. newPersonVo.lastName = lastNameTextInput.text;
  308. newPersonVo.firstName = firstNameTextInput.text;
  309. newPersonVo.phone = phoneTextInput.text;
  310. newPersonVo.fax = faxTextInput.text;
  311. newPersonVo.activity = (otherActivityTextInput.text ? otherActivityTextInput.text : activityComboBox.selectedLabel);
  312. var userVo : UserVo = new UserVo();
  313. userVo.hospital = newHospitalVo;
  314. userVo.ultraSoundScanner = newUltraSoundScannerVo;
  315. userVo.person = newPersonVo;
  316. userVo.buyer = buyer.selected;
  317. userVo.id = _model.connectedUser.id;
  318. if ( activityComboBox.selectedItem.code == 9 )
  319. newPersonVo.activity = otherActivityTextInput.text;
  320. else
  321. newPersonVo.activity = activityComboBox.selectedLabel;
  322. new UpdateUserEvent( userVo, "PHYSICIAN", this ).dispatch();
  323. registerButton.enabled = false;
  324. }
  325. }
  326. private function resetLabels() : void
  327. {
  328. var formItemList : Array = [ hospitalTextInput, invoiceAddressTextInput, shippingAddressTextInput,
  329. cityTextInput, zipCodeTextInput, countryComboBox,
  330. phoneCenterTextInput, lastNameTextInput, firstNameTextInput, phoneTextInput, activityComboBox,
  331. otherActivityTextInput, brandTextInput ];
  332. var formLabelList : Array = [ hospitalLabel, invoiceAddressLabel, shippingAddressLabel,
  333. cityLabel, zipCodeLabel, countryLabel,
  334. phoneCenterLabel, lastNameLabel, firstNameLabel, phoneLabel, activityLabel,
  335. otherActivityLabel, brandLabel ];
  336. for (var i : int = 0; i < formItemList.length; i++)
  337. {
  338. formLabelList[i].setStyle("color", "#555557");
  339. formLabelList[i].setStyle("fontWeight", "normal");
  340. formItemList[i].errorString = "";
  341. }
  342. }
  343. public function reset() : void
  344. {
  345. hospitalValidator.enabled = false;
  346. invoiceAddressValidator.enabled = false;
  347. shippingAddressValidator.enabled = false;
  348. cityValidator.enabled = false;
  349. zipCodeValidator.enabled = false;
  350. countryValidator.enabled = false;
  351. phoneCenterValidator.enabled = false;
  352. lastNameValidator.enabled = false;
  353. firstNameValidator.enabled = false;
  354. phoneValidator.enabled = false;
  355. activityValidator.enabled = false;
  356. brandValidator.enabled = false;
  357. frequencyValidator.enabled = false;
  358. otherActivityValidator.enabled = false;
  359. hospitalTextInput.text = "";
  360. invoiceAddressTextInput.text = "";
  361. shippingAddressTextInput.text = "";
  362. cityTextInput.text = "";
  363. zipCodeTextInput.text = "";
  364. countryComboBox.selectedIndex = -1;
  365. phoneCenterTextInput.text = "";
  366. faxCenterTextInput.text = "";
  367. lastNameTextInput.text = "";
  368. firstNameTextInput.text = "";
  369. phoneTextInput.text = "";
  370. faxTextInput.text = "";
  371. activityComboBox.selectedIndex = -1;
  372. activityComboBox.prompt = ResourceManager.getInstance().getString('labels', 'chooseActivity');
  373. brandTextInput.text = "";
  374. typeTextInput.text = "";
  375. frequencyNumericStepper.value = 0;
  376. ageNumericStepper.value = 0;
  377. otherActivityTextInput.text = "";
  378. hospitalValidator.enabled = true;
  379. invoiceAddressValidator.enabled = true;
  380. shippingAddressValidator.enabled = true;
  381. cityValidator.enabled = true;
  382. zipCodeValidator.enabled = true;
  383. countryValidator.enabled = true;
  384. phoneCenterValidator.enabled = true;
  385. lastNameValidator.enabled = true;
  386. firstNameValidator.enabled = true;
  387. phoneValidator.enabled = true;
  388. activityValidator.enabled = true;
  389. brandValidator.enabled = true;
  390. frequencyValidator.enabled = true;
  391. otherActivityValidator.enabled = true;
  392. resetLabels();
  393. }
  394. public function returnToHome() : void
  395. {
  396. this.parentDocument.selectedIndex = 0;
  397. }
  398. public function exportData() : void
  399. {
  400. var userVo : UserVo = new UserVo();
  401. userVo.id = _model.connectedUser.id;
  402. new ExportDataEvent( userVo, this ).dispatch();
  403. }
  404. public function onDisplayConditions() : void
  405. {
  406. new TermsAgreedEvent(_model.connectedUser, this).dispatch();
  407. }
  408. public function displayConditions( idterms : int, urlterms : String ) : void
  409. {
  410. var loader:URLLoader = new URLLoader();
  411. loader.addEventListener(Event.COMPLETE, displayConditionsCompleteHandler);
  412. loader.load(new URLRequest(urlterms));
  413. }
  414. private function displayConditionsCompleteHandler(event:Event) : void
  415. {
  416. var loader:URLLoader = URLLoader(event.target);
  417. var _applicationTermsPopUp : ApplicationTermsPopUp = new ApplicationTermsPopUp();
  418. _applicationTermsPopUp.setTermsAndConditions(loader.data);
  419. PopUpManager.addPopUp( _applicationTermsPopUp, this, true );
  420. PopUpManager.centerPopUp( _applicationTermsPopUp );
  421. }
  422. private function setFieldError() : void
  423. {
  424. hospitalValidator.requiredFieldError = ResourceManager.getInstance().getString('labels', 'required');
  425. invoiceAddressValidator.requiredFieldError = ResourceManager.getInstance().getString('labels', 'required');
  426. shippingAddressValidator.requiredFieldError = ResourceManager.getInstance().getString('labels', 'required');
  427. cityValidator.requiredFieldError = ResourceManager.getInstance().getString('labels', 'required');
  428. zipCodeValidator.requiredFieldError = ResourceManager.getInstance().getString('labels', 'required');
  429. countryValidator.requiredFieldError = ResourceManager.getInstance().getString('labels', 'required');
  430. phoneCenterValidator.requiredFieldError = ResourceManager.getInstance().getString('labels', 'required');
  431. lastNameValidator.requiredFieldError = ResourceManager.getInstance().getString('labels', 'required');
  432. firstNameValidator.requiredFieldError = ResourceManager.getInstance().getString('labels', 'required');
  433. phoneValidator.requiredFieldError = ResourceManager.getInstance().getString('labels', 'required');
  434. activityValidator.requiredFieldError = ResourceManager.getInstance().getString('labels', 'required');
  435. brandValidator.requiredFieldError = ResourceManager.getInstance().getString('labels', 'required');
  436. frequencyValidator.requiredFieldError = ResourceManager.getInstance().getString('labels', 'required');
  437. otherActivityValidator.requiredFieldError = ResourceManager.getInstance().getString('labels', 'required');
  438. }
  439. private function initListeners() : void
  440. {
  441. setFieldError();
  442. hospitalValidator.addEventListener(ValidationResultEvent.VALID, stringValidatorHandler);
  443. invoiceAddressValidator.addEventListener(ValidationResultEvent.VALID, stringValidatorHandler);
  444. shippingAddressValidator.addEventListener(ValidationResultEvent.VALID, stringValidatorHandler);
  445. cityValidator.addEventListener(ValidationResultEvent.VALID, stringValidatorHandler);
  446. zipCodeValidator.addEventListener(ValidationResultEvent.VALID, stringValidatorHandler);
  447. countryValidator.addEventListener(ValidationResultEvent.VALID, numberValidatorHandler);
  448. phoneCenterValidator.addEventListener(ValidationResultEvent.VALID, stringValidatorHandler);
  449. lastNameValidator.addEventListener(ValidationResultEvent.VALID, stringValidatorHandler);
  450. firstNameValidator.addEventListener(ValidationResultEvent.VALID, stringValidatorHandler);
  451. phoneValidator.addEventListener(ValidationResultEvent.VALID, stringValidatorHandler);
  452. activityValidator.addEventListener(ValidationResultEvent.VALID, numberValidatorHandler);
  453. brandValidator.addEventListener(ValidationResultEvent.VALID, stringValidatorHandler);
  454. frequencyValidator.addEventListener(ValidationResultEvent.VALID, numberValidatorHandler);
  455. otherActivityValidator.addEventListener(ValidationResultEvent.VALID, stringValidatorHandler);
  456. }
  457. public function updateErrorStrings() : void
  458. {
  459. setFieldError();
  460. if (hospitalTextInput.errorString)
  461. hospitalTextInput.errorString = ResourceManager.getInstance().getString('labels', 'errorField');
  462. if (invoiceAddressTextInput.errorString)
  463. invoiceAddressTextInput.errorString = ResourceManager.getInstance().getString('labels', 'errorField');
  464. if (shippingAddressTextInput.errorString)
  465. shippingAddressTextInput.errorString = ResourceManager.getInstance().getString('labels', 'errorField');
  466. if (cityTextInput.errorString)
  467. cityTextInput.errorString = ResourceManager.getInstance().getString('labels', 'errorField');
  468. if (zipCodeTextInput.errorString)
  469. zipCodeTextInput.errorString = ResourceManager.getInstance().getString('labels', 'errorField');
  470. if (countryComboBox.errorString)
  471. countryComboBox.errorString = ResourceManager.getInstance().getString('labels', 'errorField');
  472. if (phoneCenterTextInput.errorString)
  473. phoneCenterTextInput.errorString = ResourceManager.getInstance().getString('labels', 'errorField');
  474. if (lastNameTextInput.errorString)
  475. lastNameTextInput.errorString = ResourceManager.getInstance().getString('labels', 'errorField');
  476. if (firstNameTextInput.errorString)
  477. firstNameTextInput.errorString = ResourceManager.getInstance().getString('labels', 'errorField');
  478. if (phoneTextInput.errorString)
  479. phoneTextInput.errorString = ResourceManager.getInstance().getString('labels', 'errorField');
  480. if (activityComboBox.errorString)
  481. activityComboBox.errorString = ResourceManager.getInstance().getString('labels', 'errorField');
  482. if (otherActivityTextInput.errorString)
  483. otherActivityTextInput.errorString = ResourceManager.getInstance().getString('labels', 'errorField');
  484. if (brandTextInput.errorString)
  485. brandTextInput.errorString = ResourceManager.getInstance().getString('labels', 'errorField');
  486. if (frequencyNumericStepper.errorString)
  487. frequencyNumericStepper.errorString = ResourceManager.getInstance().getString('labels', 'errorField');
  488. }
  489. private function stringValidatorHandler(event : ValidationResultEvent) : void
  490. {
  491. if (event.target.errorString)
  492. event.target.errorString = null;
  493. }
  494. private function numberValidatorHandler(event : ValidationResultEvent) : void
  495. {
  496. if (event.target.errorString)
  497. event.target.errorString = null;
  498. }