[flexcoders] Flex 3.3 SDK and DataVisualization

2009-08-18 Thread Annette Spooner
Hi,

Is it possible to use the Flex 3.3 SDK on its own, without Flex Builder 3,
and use the Data Visualization components such as AdvancedDataGrid?

I have followed the installation instructions at
http://www.adobe.com/support/documentation/en/flex/3/releasenotes_flex3_sdk.
html#Datavisualization and placed the datavisualization files in the
required places.  I have added the following to my CLASSPATH:
$FLEX_HOME\frameworks\libs\datavisualization.swc. However, when I try to
compile some code using jrun4 I get the following error message: Could not
resolve mx:AdvancedDataGrid to a component implementation.

What else do I need to do? How do I tell it to use Flex 3 and not Flex 2.0.1
if I am not using Flex Builder?

Thanks,

Annette



[flexcoders] Flex 2.0.1 constraint based layout

2009-03-22 Thread Annette Spooner
Hi,

I am trying to use constraint based layout to have a datagrid adjust in size
as the browser window is resized. I have put together a simplified example
below, but it is not working. When the application is first displayed, the
datagrid does not stretch to fill the width or height of the window. When I
resize the window to be smaller then the datagrid, the datagrid simply
disappears off the edge. Can you tell me what I am doing wrong please?

Thanks,

Annette

 

?xml version=1.0 encoding=utf-8?



mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; 

layout=absolute 

horizontalAlign=left

horizontalScrollPolicy=off 

creationComplete=initApp();



mx:Script

![CDATA[

import
mx.collections.ArrayCollection;

import
ascomponents.City;



private var
cities:Array;

[Bindable]
public var citiesView1: ArrayCollection;

  

public
function initApp():void 

{

 
cities = new Array();

 
cities[0] = new City(Sydney, NSW, 2000, Australia);

 
cities[1] = new City(Melbourne, VIC, 3000, Australia);

 
cities[2] = new City(Brisbane, QLD, 4000, Australia);



 
citiesView1 = new ArrayCollection(cities);

}

  

]]

/mx:Script

 

mx:HBox

mx:DataGrid id=testdg1
dataProvider={citiesView1} editable=true rowCount=5 width=100%
height=100% left=0 right=0 top=0 bottom=0 

mx:columns

 
mx:DataGridColumn headerText=Name dataField=name editable=false/

 
mx:DataGridColumn headerText=State/Pcode dataField=state
editable=true  /

 
mx:DataGridColumn headerText=Country dataField=country
editable=true/

 
mx:DataGridColumn headerText=Name dataField=name editable=false/

 
mx:DataGridColumn headerText=State/Pcode dataField=state
editable=true  /

 
mx:DataGridColumn headerText=Country dataField=country
editable=true/

/mx:columns

/mx:DataGrid

/mx:HBox

/mx:Application

 

 

package ascomponents

{

public class City

{

public var name: String;

public var state: String;

public var postcode:String;

public var country:String;



public function
City(n:String, s:String, p:String, c:String)

{

name = n;

state = s;

postcode =
p;

country = c;

}

}

}



[flexcoders] Multiple views of same data

2009-02-05 Thread Annette Spooner
Hi,

I have an application that requires multiple views of the same data. Thus,
in practice, I would ideally like to have two DataGrids, each with the same
ArrayCollection as dataProvider, but each sorted differently. I know that
sorting a DataGrid sorts the underlying dataProvider, so is there any way to
achieve this without having two copies of the data and having to update the
second when changes are made to the first.

Thanks for your help.

Regards,

Annette



[flexcoders] Tabbing in custom item editor in datagrid

2008-04-18 Thread Annette Spooner
I have a datagrid, with a custom item editor that contains two text input
fields. When the user tabs into the column using this tem editor, I would
like focus to be set on the first text field. Tabbing again should move
focus to the second text field and tabbing a third time should move focus
out of the custom item editor and on to the next column. Is this possible in
Flex 2?

 

My custom item editor (see code below) implements the
IDropInListItemRenderer and the IFocusManagerComponent classes. I gather I
have to create and activate a new focus manager instance when the component
is created, and deactivate the focus manager for the main application. But I
do not know how to access the focus manager for the main application. Is
there anything else I should be doing as well? Do I have to set
focusEnabled, tabEnabled or tabChildren, or will the default values be
sufficient? And how do I decide when to destroy the item editor and move
focus back to the main application?

 

Thanks in advance for your help.

Annette

 

 

?xml version=1.0 encoding=utf-8?

 

mx:VBox xmlns:mx=http://www.adobe.com/2006/mxml; 

height=100% width=100% 

paddingBottom=0 paddingLeft=0 paddingRight=0
paddingTop=0

horizontalScrollPolicy=off

creationComplete=initRenderer()

implements=mx.controls.listClasses.IDropInListItemRenderer,
mx.managers.IFocusManagerComponent



mx:Script

![CDATA[

import
mx.controls.listClasses.ListData;

import
mx.controls.dataGridClasses.DataGridListData;

 import
mx.controls.listClasses.BaseListData;

 import
mx.controls.dataGridClasses.DataGridItemRenderer

import
mx.managers.IFocusManager;

import
mx.managers.FocusManager;

import mx.controls.Alert;



[Bindable] public var
actionValue:Object;// Property for returning the new
value to the cell 

[Bindable] public var
progressValue:Object;   // Property for returning the new value to
the cell 

 

private var
_fm:FocusManager;

 private var
_listData:DataGridListData;

 


public function
initRenderer(): void

{

_fm = new
FocusManager(this);

 
_fm.activate();

 
action.setFocus();

}

 

 override public function
get data():Object 

{

 return
super.data;

}

 

override public function set
data(value:Object):void 

{

if
(value.actions[_listData.dataField] != null)

{

 
action.text = String(value.actions[_listData.dataField]);

 
progress.text = String(value.progress[_listData.dataField]);

}

else

{

 
action.text = ;

 
progress.text = ;

}

 } 



public function get
listData():BaseListData

{

return
_listData;

 }

 

 public function set
listData(value:BaseListData):void

 {

  _listData
= DataGridListData(value);

}   



// Implement the drawFocus()
method for the VBox.