source: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/YesNoRenderer.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.3 KB
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<mx:Label
3 xmlns:mx="http://www.adobe.com/2006/mxml"
4 textAlign="center">
5
6 <mx:Script>
7 <![CDATA[
8 import mx.controls.listClasses.ListBase;
9 import mx.controls.dataGridClasses.DataGridListData;
10
11 private var _data: Object;
12
13 override public function set data(value: Object): void {
14 _data = value;
15 if (value == null) return;
16
17 if (value[DataGridListData(listData).dataField] == true) {
18 this.text = "yes";
19 } else {
20 this.text = "no";
21 }
22 }
23
24 override public function get data(): Object {
25 return _data;
26 }
27
28 override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
29 {
30 super.updateDisplayList(unscaledWidth, unscaledHeight);
31
32 if(owner is mx.controls.DataGrid && mx.controls.DataGrid(owner).isItemSelected(data)) { //figure out if this itemRenderer is selected
33 setStyle('color', 0xFFFFFF); // FIXME: anyway to discover this value from the theme?
34 } else { //otherwise, return the label to its regular state
35 setStyle('color', 0x000000); // FIXME: anyway to discover this value from the theme?
36 }
37 }
38 ]]>
39 </mx:Script>
40
41</mx:Label>
Note: See TracBrowser for help on using the repository browser.