[1227] | 1 | <?xml version="1.0" encoding="utf-8"?>
|
---|
| 2 | <mx:Button xmlns:mx="http://www.adobe.com/2006/mxml"
|
---|
| 3 | click="selectPatient()">
|
---|
| 4 |
|
---|
| 5 | <mx:Metadata>
|
---|
| 6 | [Event(name="selectPatient", type="gov.va.med.edp.pt.demog.view.SelectPatientEvent")]
|
---|
| 7 | </mx:Metadata>
|
---|
| 8 |
|
---|
| 9 | <mx:Script>
|
---|
| 10 | <![CDATA[
|
---|
| 11 | import gov.va.med.edp.pt.demog.model.PatientChecksModel;
|
---|
| 12 | import gov.va.med.edp.pt.demog.IPatientChecksController;
|
---|
| 13 | import gov.va.med.edp.pt.demog.model.PatientSelectVO;
|
---|
| 14 |
|
---|
| 15 | private var _patient: PatientSelectVO;
|
---|
| 16 | private var _open:Boolean = false;
|
---|
| 17 |
|
---|
| 18 | [Bindable]
|
---|
| 19 | public var ptSelectController:IPatientChecksController;
|
---|
| 20 |
|
---|
| 21 | [Bindable]
|
---|
| 22 | public var patientChecksModel:PatientChecksModel;
|
---|
| 23 |
|
---|
| 24 | [Bindable]
|
---|
| 25 | public var centered: Boolean = false;
|
---|
| 26 |
|
---|
| 27 | [Bindable]
|
---|
| 28 | public function get patient():PatientSelectVO {
|
---|
| 29 | return _patient;
|
---|
| 30 | }
|
---|
| 31 |
|
---|
| 32 | public function set patient(value: PatientSelectVO): void
|
---|
| 33 | {
|
---|
| 34 | _patient = value;
|
---|
| 35 | }
|
---|
| 36 |
|
---|
| 37 | private function selectPatient(): void {
|
---|
| 38 | if (_open) return;
|
---|
| 39 | _open = true;
|
---|
| 40 | SelectPatientDialog.show(ptSelectController, patientChecksModel, patient, this, closeHandler, centered);
|
---|
| 41 | }
|
---|
| 42 |
|
---|
| 43 | private function closeHandler(event:SelectPatientEvent):void {
|
---|
| 44 | if (event.patient != null) {
|
---|
| 45 | var forwardEvent: SelectPatientEvent =
|
---|
| 46 | new SelectPatientEvent(SelectPatientEvent.EVENT_SELECT_PATIENT);
|
---|
| 47 | forwardEvent.patient = event.patient;
|
---|
| 48 | dispatchEvent(forwardEvent);
|
---|
| 49 | }
|
---|
| 50 | _open = false;
|
---|
| 51 | }
|
---|
| 52 | ]]>
|
---|
| 53 | </mx:Script>
|
---|
| 54 |
|
---|
| 55 | </mx:Button>
|
---|