source: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/WhenRenderer.mxml@ 1227

Last change on this file since 1227 was 1227, checked in by George Lilly, 13 years ago

initial load of EDIS 1.0

File size: 1.6 KB
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<mx:Label
3 xmlns:mx="http://www.adobe.com/2006/mxml">
4
5 <mx:Script>
6 <![CDATA[
7 import mx.controls.listClasses.ListBase;
8 import mx.controls.dataGridClasses.DataGridListData;
9 import gov.va.med.edp.model.TrackingModelLocator;
10 import gov.va.med.edp.vo.LookupVO;
11 import gov.va.med.edp.util.Vista;
12
13
14 private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
15 private var _data: Object;
16
17 override public function set data(value: Object): void {
18 _data = value;
19 if (value == null) return;
20
21 var when: Number = value[DataGridListData(listData).dataField];
22 var i: int = Vista.locateIndex(model.config.whenList, when);
23 if (i > -1) {
24 this.text = LookupVO(model.config.whenList[i]).label;
25 } else {
26 this.text = "";
27 }
28 }
29
30 override public function get data(): Object {
31 return _data;
32 }
33
34 override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
35 {
36 super.updateDisplayList(unscaledWidth, unscaledHeight);
37
38 if(owner is mx.controls.DataGrid && mx.controls.DataGrid(owner).isItemSelected(data)) { //figure out if this itemRenderer is selected
39 setStyle('color', 0xFFFFFF); // FIXME: anyway to discover this value from the theme?
40 } else { //otherwise, return the label to its regular state
41 setStyle('color', 0x000000); // FIXME: anyway to discover this value from the theme?
42 }
43 }
44 ]]>
45 </mx:Script>
46
47</mx:Label>
Note: See TracBrowser for help on using the repository browser.