[flexcoders] Sorting in AdvancedDataGrid happens only once, please help

2009-06-01 Thread yossi.baram
Hi guys,
My AdvancedDataGrid shows a tree, 
I set sortableColumns=true sortExpertMode=true,
But when I click on one of the columns, they are sorted in descending way, when 
I click again  - Nothing happens,
Why
Why doesnt the default sorting work in my AdvancedDataGrid?
Do I need a custom sorter? and if so, what functions should I override?

Thanks for the help
Jo



[flexcoders] Re: Sorting in AdvancedDataGrid happens only once, please help

2009-06-01 Thread yossi.baram
Did any one came across this scenario? :(
--- In flexcoders@yahoogroups.com, yossi.baram yossi.ba...@... wrote:

 Hi guys,
 My AdvancedDataGrid shows a tree, 
 I set sortableColumns=true sortExpertMode=true,
 But when I click on one of the columns, they are sorted in descending way, 
 when I click again  - Nothing happens,
 Why
 Why doesnt the default sorting work in my AdvancedDataGrid?
 Do I need a custom sorter? and if so, what functions should I override?
 
 Thanks for the help
 Jo





[flexcoders] UIComponent doesnt catch TOOLTIP event

2009-05-13 Thread yossi.baram
Hi,
My Tree Table renderer extends UIComponent.
I cannot catch the Tooltip event by using
component.addEventListener(ToolTipEvent.TOOL_TIP_CREATE,tooltipDetailCreate);

why?

this is part of the data my renderer override:
(myComponent is a class that extends UIComponent)
public function set data(value:Object):void
{

if(value != null)
{
_data = value; 
this.removeAllChildren();   
 invalidateProperties();
 dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));   ...
...

myComponent.addEventListener(ToolTipEvent.TOOL_TIP_CREATE,tooltipDetailCreate); 

var innerCellDisplay:DisplayObject = myComponent as DisplayObject;
this.addChild(innerCellDisplay);

}
}

// create the tooltip
private function tooltipDetailCreate(event:ToolTipEvent):void { 
  var tt:PanelToolTip  = new PanelToolTip();
  var innerImage:Object = event.currentTarget;
  var myString:String = ;
 myString = myString + width:  + \n;   
 myString = myString + width:  + \n;
 tt.width  = 190; 
 tt.height = 100;
 tt.bodyText = myString;
tt.titleText = Title -  ; 
event.toolTip = tt; 
}   

Please advise

Jo




[flexcoders] Re: Dynamicaly shrink expand flex application

2009-05-12 Thread yossi.baram
Thanks for the reply man,
I'm missing something here,
I created my Tree as a tag:

%@ tag import=com.mercury.topaz.webinfra.WebInfraApplicationFactory %
%@ tag import=com.mercury.topaz.webinfra.WebInfraApplication %
%@ tag description=Display Flex Treetable pageEncoding=UTF-8 %
%@ taglib prefix=c uri=/tags/jstl-core %
%@ taglib prefix=fn uri=/functions/jstl %
%@ taglib prefix=utils tagdir=/WEB-INF/tags/act/utils %
%@ taglib prefix=actfn uri=/functions/act %
%@ attribute name=treeTableId type=java.lang.String required=true 
description=The id of the Treetable. %
%@ attribute name=width type=java.lang.Integer required=true 
description=The TreeTable width. %
%@ attribute name=height type=java.lang.Integer required=true 
description=The TreeTable height. %
%@ attribute name=treeTableServiceId type=java.lang.String required=true 
description=The service function name. %

utils:includeScript page=/rfw/static/js/AC_OETags.js /  

c:if test=${empty width}
  c:set var=width value=600/c:set
/c:if

c:if test=${empty height}
  c:set var=height value=400/c:set
/c:if
%
WebInfraApplication webConf = WebInfraApplicationFactory.getInstance();
%
script type=text/javascript
baseUrl =  %=webConf.getBase(request)%;
AC_FL_RunContent(
src, baseUrl + /Charts/TreeTableRenderer,
flashVars, 
treeTableServiceId=${treeTableServiceId}reportStateId=${rfw_state_id}presentationModelName=${renderRequest.presentationModel.name}userUniqueKey=${userUniqueKey}baseURL=
 + baseUrl,
width, ${width},
height, ${height},
align, middle,
id, ${treeTableId},
quality, high,
name, Flex TreeTable,
allowScriptAccess,sameDomain
);

/script

The jsp that wrapps it:

%@ taglib prefix=flex tagdir=/WEB-INF/tags/act/flex %
%@ taglib prefix=c uri=/tags/jstl-core %

c:if test=${createNewDocument}
%@ page import=com.mercury.topaz.webinfra.WebInfraApplicationFactory %
%@ page import=com.mercury.topaz.webinfra.WebInfraApplication %
%
WebInfraApplication webConf = WebInfraApplicationFactory.getInstance();
String baseURL = webConf.getBase(request);
%
html
head
BASE HREF=%=baseURL%
/head
body
/c:if

div id=treeContent_${treeTableId} style= 

/div
flex:TreeTable
  treeTableId = ${treeTableId}
  width = ${treeTableWidth}
  height = ${treeTableHeight}
  treeTableServiceId = ${treeTableServiceId}
/

c:if test=${createNewDocument}
/body
/html
/c:if

As you can see the width  height is sent to the flex engin as attributs in 
pixels :((

If I drop the width  height, the swf doesnt generated.

In my flex AdvancedDataGrid i set the width  height to 100%

Where should I set the percentage???

Thanks man



--- In flexcoders@yahoogroups.com, Tracy Spratt tr...@... wrote:

 Yes, you can set the height and width to percentages and the DataGrid will
 expand and shrink with its container.
 
  
 
 Changing  the swf size in the html wrapper will take some javascript.
 
  
 
 Tracy Spratt,
 
 Lariat Services, development services available
 
   _  
 
 From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
 Behalf Of yossi.baram
 Sent: Monday, May 11, 2009 4:19 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Dynamicaly shrink  expand flex application
 
  
 
 
 
 
 
 
 Hi helper,
 
 Can I set my DataGrid to dynamicaly shrink  expand as the browser changes
 its width?
 The flex engine expect width  height in pixels when building the swf and
 not in %,
 thats what makes the swf static size,
 Can I make the swf to be of percentage size in the page?
 
 Thanks
 
 Jo





[flexcoders] Re: Dynamicaly shrink expand flex application

2009-05-12 Thread yossi.baram
I think the problem is that the AdvancedDataGrid set its columns width to 100px 
by default.
I add my columns dynamically using AdvancedDataGridColumn,
Can I sett some columns to be percentage width and some not?

Thanks 

--- In flexcoders@yahoogroups.com, yossi.baram yossi.ba...@... wrote:

 Thanks for the reply man,
 I'm missing something here,
 I created my Tree as a tag:
 
 %@ tag import=com.mercury.topaz.webinfra.WebInfraApplicationFactory %
 %@ tag import=com.mercury.topaz.webinfra.WebInfraApplication %
 %@ tag description=Display Flex Treetable pageEncoding=UTF-8 %
 %@ taglib prefix=c uri=/tags/jstl-core %
 %@ taglib prefix=fn uri=/functions/jstl %
 %@ taglib prefix=utils tagdir=/WEB-INF/tags/act/utils %
 %@ taglib prefix=actfn uri=/functions/act %
 %@ attribute name=treeTableId type=java.lang.String required=true 
 description=The id of the Treetable. %
 %@ attribute name=width type=java.lang.Integer required=true 
 description=The TreeTable width. %
 %@ attribute name=height type=java.lang.Integer required=true 
 description=The TreeTable height. %
 %@ attribute name=treeTableServiceId type=java.lang.String 
 required=true description=The service function name. %
 
 utils:includeScript page=/rfw/static/js/AC_OETags.js /  
 
 c:if test=${empty width}
   c:set var=width value=600/c:set
 /c:if
 
 c:if test=${empty height}
   c:set var=height value=400/c:set
 /c:if
 %
 WebInfraApplication webConf = WebInfraApplicationFactory.getInstance();
 %
 script type=text/javascript
 baseUrl =  %=webConf.getBase(request)%;
 AC_FL_RunContent(
 src, baseUrl + /Charts/TreeTableRenderer,
 flashVars, 
 treeTableServiceId=${treeTableServiceId}reportStateId=${rfw_state_id}presentationModelName=${renderRequest.presentationModel.name}userUniqueKey=${userUniqueKey}baseURL=
  + baseUrl,
 width, ${width},
 height, ${height},
 align, middle,
 id, ${treeTableId},
 quality, high,
 name, Flex TreeTable,
 allowScriptAccess,sameDomain
 );
 
 /script
 
 The jsp that wrapps it:
 
 %@ taglib prefix=flex tagdir=/WEB-INF/tags/act/flex %
 %@ taglib prefix=c uri=/tags/jstl-core %
 
 c:if test=${createNewDocument}
 %@ page import=com.mercury.topaz.webinfra.WebInfraApplicationFactory %
 %@ page import=com.mercury.topaz.webinfra.WebInfraApplication %
 %
 WebInfraApplication webConf = 
 WebInfraApplicationFactory.getInstance();
 String baseURL = webConf.getBase(request);
 %
 html
 head
 BASE HREF=%=baseURL%
 /head
 body
 /c:if
 
 div id=treeContent_${treeTableId} style= 
 
 /div
 flex:TreeTable
   treeTableId = ${treeTableId}
   width = ${treeTableWidth}
   height = ${treeTableHeight}
   treeTableServiceId = ${treeTableServiceId}
 /
 
 c:if test=${createNewDocument}
 /body
 /html
 /c:if
 
 As you can see the width  height is sent to the flex engin as attributs in 
 pixels :((
 
 If I drop the width  height, the swf doesnt generated.
 
 In my flex AdvancedDataGrid i set the width  height to 100%
 
 Where should I set the percentage???
 
 Thanks man
 
 
 
 --- In flexcoders@yahoogroups.com, Tracy Spratt tracy@ wrote:
 
  Yes, you can set the height and width to percentages and the DataGrid will
  expand and shrink with its container.
  
   
  
  Changing  the swf size in the html wrapper will take some javascript.
  
   
  
  Tracy Spratt,
  
  Lariat Services, development services available
  
_  
  
  From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
  Behalf Of yossi.baram
  Sent: Monday, May 11, 2009 4:19 AM
  To: flexcoders@yahoogroups.com
  Subject: [flexcoders] Dynamicaly shrink  expand flex application
  
   
  
  
  
  
  
  
  Hi helper,
  
  Can I set my DataGrid to dynamicaly shrink  expand as the browser changes
  its width?
  The flex engine expect width  height in pixels when building the swf and
  not in %,
  thats what makes the swf static size,
  Can I make the swf to be of percentage size in the page?
  
  Thanks
  
  Jo
 





[flexcoders] Dynamicaly shrink expand flex application

2009-05-11 Thread yossi.baram
Hi helper,

Can I set my DataGrid to dynamicaly shrink  expand as the browser changes its 
width?
The flex engine expect width  height in pixels when building the swf and not 
in %,
thats what makes the swf static size,
Can I make the swf to be of percentage size in the page?

Thanks

Jo



[flexcoders] Re: Can I set specific AdvancedDataGridColumn to be draggable false?

2009-04-01 Thread yossi.baram
Does anybody knows if a specific ADvancedDataGridColumn can be freezed? not 
using lockedColumnCount, because it doesnt work for me :(

Thanks
--- In flexcoders@yahoogroups.com, Tom Chiverton tom.chiver...@... wrote:

 On Tuesday 31 Mar 2009, yossi.baram wrote:
  columns in an AdvancedDataGrid, Can i set it to be false for specific
  columns and true for the rest?
 
 Is a suitable property listed on the live docs ?
 
 -- 
 Tom Chiverton
 Helping to heterogeneously syndicate real-time low-risk content as part of 
 the 
 IT team of the year, '09 and '08
 
 
 
 This email is sent for and on behalf of Halliwells LLP.
 
 Halliwells LLP is a limited liability partnership registered in England and 
 Wales under registered number OC307980 whose registered office address is at 
 Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB.  A list 
 of members is available for inspection at the registered office together with 
 a list of those non members who are referred to as partners.  We use the word 
 ?partner? to refer to a member of the LLP, or an employee or consultant with 
 equivalent standing and qualifications. Regulated by the Solicitors 
 Regulation Authority.
 
 CONFIDENTIALITY
 
 This email is intended only for the use of the addressee named above and may 
 be confidential or legally privileged.  If you are not the addressee you must 
 not read it and must not use any information contained in nor copy it nor 
 inform any person other than Halliwells LLP or the addressee of its existence 
 or contents.  If you have received this email in error please delete it and 
 notify Halliwells LLP IT Department on 0870 365 2500.
 
 For more information about Halliwells LLP visit www.halliwells.com.





[flexcoders] Can I set specific AdvancedDataGridColumn to be draggable false?

2009-03-31 Thread yossi.baram
Hi,
We have the draggableColumns attribute that disable/enable dragging for all 
columns in an AdvancedDataGrid,
Can i set it to be false for specific columns and true for the rest?

Thanks guys

Jo



[flexcoders] using lockedColumnCount doesnt freez my column..

2009-03-26 Thread yossi.baram
Hi,
I set lockedColumnCount=1 in my AdvancedDataGrid tag and I can see the first 
column is marked with vertical line but when I Horizontally scroll its not 
freeded and remains inplace :(
The first column dissapear with the rest of the other columns,
What am I doing wrong?

Thanks

Jo 




[flexcoders] Re: using lockedColumnCount doesnt freez my column..

2009-03-26 Thread yossi.baram
So, I guess it doesnt work for you still...
Any way, thanks for you reply man :)

--- In flexcoders@yahoogroups.com, grg_blls grg_b...@... wrote:

 Hi,
 
 This is an old issue. I have no answer but I can point you to the following 
 older posts, 
 (message numbers: 130147, 129920, 129917, 129219, 118902)
 
 I hope this will be working in the new version.
 
 Thank you
 George
 
 --- In flexcoders@yahoogroups.com, yossi.baram yossi.baram@ wrote:
 
  Hi,
  I set lockedColumnCount=1 in my AdvancedDataGrid tag and I can see the 
  first column is marked with vertical line but when I Horizontally scroll 
  its not freeded and remains inplace :(
  The first column dissapear with the rest of the other columns,
  What am I doing wrong?
  
  Thanks
  
  Jo
 





[flexcoders] Re: Using ItemRenderer with IHierarchicalData DataProvider

2009-03-23 Thread yossi.baram
Guys,
There mast be somebody knows how to preserve hierarchy and to allow the 
TreeGrid to look the same with parents and childrens, 
using the ItemRenderer

Sorry for the resending the question. I realy need
a clue here,

Thanks
--- In flexcoders@yahoogroups.com, yossi.baram yossi.ba...@... wrote:

 Hi,
 My problem is simple,
 In my TreeTable The ItemRenderer show me only one level.
 When I click the parent it will show only the level beneath it,
 although it has childrens, WHY??? 
 When I use depth, I can see the tree but it doesnt activate the ItemRenderer.
 How can I set the Itemrenderer to manipulate and show ALL branches?
 
 Please advice guys, I have been looking every where but couldnt find a 
 solution.
 
 Thanks in advance
 
 
 
 --- In flexcoders@yahoogroups.com, yossi.baram yossi.baram@ wrote:
 
  Hi,
  There is a greate example in the following link that allows us to create 
  simple hirarchical grid with AdvancedDataGrid, implementing 
  IHierarchicalData.
  
  http://inovativeflexdevolopment.blogspot.com/2008/07/flex3-dynamic-population-of-data-in.html
  
  I couldnt find a way to include ItemRenderer using this kind of 
  dataProvider,
  I tried everything but all I get when using a simple ItemRenderer is a flat 
  tree with no hirarchy :(
  
  Please please advice
  
  Thanks
  
  Jo
 





[flexcoders] Re: Using ItemRenderer with IHierarchicalData DataProvider

2009-03-23 Thread yossi.baram
No,
Lets say I have parent1 and he has a child1 which is a parent also,
when I click on parent1 I should see the child1 as a parent(with icon) to allow 
me drill deeper but now I see child1 as text,
The hierarchy:
parent1
| 
  child1
   |
child-child  text


please advise if Im not understud

Thanks for your help man

--- In flexcoders@yahoogroups.com, Wesley Acheson wesley.ache...@... wrote:

 Sorry I'm not really understanding.  Are you saing that you want all
 children nodes automatically expanded?-
 
 On Mon, Mar 23, 2009 at 8:55 AM, yossi.baram yossi.ba...@... wrote:
 
  Guys,
  There mast be somebody knows how to preserve hierarchy and to allow the
  TreeGrid to look the same with parents and childrens,
  using the ItemRenderer
 
  Sorry for the resending the question. I realy need
  a clue here,
 
  Thanks
  --- In flexcoders@yahoogroups.com, yossi.baram yossi.baram@ wrote:
  
   Hi,
   My problem is simple,
   In my TreeTable The ItemRenderer show me only one level.
   When I click the parent it will show only the level beneath it,
   although it has childrens, WHY???
   When I use depth, I can see the tree but it doesnt activate the
  ItemRenderer.
   How can I set the Itemrenderer to manipulate and show ALL branches?
  
   Please advice guys, I have been looking every where but couldnt find a
  solution.
  
   Thanks in advance
  
  
  
   --- In flexcoders@yahoogroups.com, yossi.baram yossi.baram@ wrote:
   
Hi,
There is a greate example in the following link that allows us to
  create simple hirarchical grid with AdvancedDataGrid, implementing
  IHierarchicalData.
   
   
  http://inovativeflexdevolopment.blogspot.com/2008/07/flex3-dynamic-population-of-data-in.html
   
I couldnt find a way to include ItemRenderer using this kind of
  dataProvider,
I tried everything but all I get when using a simple ItemRenderer is a
  flat tree with no hirarchy :(
   
Please please advice
   
Thanks
   
Jo
   
  
 
 
 
 
  
 
  --
  Flexcoders Mailing List
  FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
  Alternative FAQ location:
  https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
  Search Archives:
  http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups
  Links
 
 
 
 





[flexcoders] Re: Using ItemRenderer with IHierarchicalData DataProvider

2009-03-23 Thread yossi.baram
Thanks,
Well, I tried extending AdvancedDataGridItemRenderer  IDropInListItemRenderer

and my set data I'm overriding:
override public function set data(value:Object):void {
 
   super.data = value;
  if (this.listData)
  {
  //  get the owner AdvnacedDataGrid
  var listOwner:AdvancedDataGrid = AdvancedDataGrid(this.listData.owner);   
 
if (listData!=null  data != null)
{ 
   this.background = true;
   this.backgroundColor = 0xFFB6B6;
}
}   
}

As you can see for the example its just should paint the rows.

But still the data is flat I cannot see child1 as the parent :(((

can you give me simple example how should set data() should look like to allow 
me manipulation on the data but still preserve the hierarchy?

I tried many things but nothing

Thanks

--- In flexcoders@yahoogroups.com, Gregor Kiddie gkid...@... wrote:

 You are losing the indentation and icon because the item renderer
 handles all that for you.
 
 Either extend the AdvancedDataGridItemRenderer
 (http://livedocs.adobe.com/flex/3/langref/mx/controls/advancedDataGridCl
 asses/AdvancedDataGridGroupItemRenderer.html ) and include what you
 need, or see if the renderer provider can give you any help
 (http://livedocs.adobe.com/flex/3/langref/mx/controls/advancedDataGridCl
 asses/AdvancedDataGridRendererProvider.html ).
 
 If neither of these do, you will have to implement the indentation and
 icon stuff yourself.
 
  
 
 Gk.
 
 Gregor Kiddie
 Senior Developer
 INPS
 
 Tel:   01382 564343
 
 Registered address: The Bread Factory, 1a Broughton Street, London SW8
 3QJ
 
 Registered Number: 1788577
 
 Registered in the UK
 
 Visit our Internet Web site at www.inps.co.uk
 blocked::http://www.inps.co.uk/ 
 
 The information in this internet email is confidential and is intended
 solely for the addressee. Access, copying or re-use of information in it
 by anyone else is not authorised. Any views or opinions presented are
 solely those of the author and do not necessarily represent those of
 INPS or any of its affiliates. If you are not the intended recipient
 please contact is.helpd...@...
 
 
 
 From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
 Behalf Of yossi.baram
 Sent: 23 March 2009 08:58
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: Using ItemRenderer with IHierarchicalData
 DataProvider
 
  
 
 No,
 Lets say I have parent1 and he has a child1 which is a parent also,
 when I click on parent1 I should see the child1 as a parent(with icon)
 to allow me drill deeper but now I see child1 as text,
 The hierarchy:
 parent1
 | 
 child1
 |
 child-child text
 
 please advise if Im not understud
 
 Thanks for your help man
 
 --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
 , Wesley Acheson wesley.acheson@ wrote:
 
  Sorry I'm not really understanding. Are you saing that you want all
  children nodes automatically expanded?-
  
  On Mon, Mar 23, 2009 at 8:55 AM, yossi.baram yossi.baram@ wrote:
  
   Guys,
   There mast be somebody knows how to preserve hierarchy and to allow
 the
   TreeGrid to look the same with parents and childrens,
   using the ItemRenderer
  
   Sorry for the resending the question. I realy need
   a clue here,
  
   Thanks
   --- In flexcoders@yahoogroups.com
 mailto:flexcoders%40yahoogroups.com , yossi.baram yossi.baram@
 wrote:
   
Hi,
My problem is simple,
In my TreeTable The ItemRenderer show me only one level.
When I click the parent it will show only the level beneath it,
although it has childrens, WHY???
When I use depth, I can see the tree but it doesnt activate the
   ItemRenderer.
How can I set the Itemrenderer to manipulate and show ALL
 branches?
   
Please advice guys, I have been looking every where but couldnt
 find a
   solution.
   
Thanks in advance
   
   
   
--- In flexcoders@yahoogroups.com
 mailto:flexcoders%40yahoogroups.com , yossi.baram yossi.baram@
 wrote:

 Hi,
 There is a greate example in the following link that allows us
 to
   create simple hirarchical grid with AdvancedDataGrid, implementing
   IHierarchicalData.


  
 http://inovativeflexdevolopment.blogspot.com/2008/07/flex3-dynamic-popul
 ation-of-data-in.html
 http://inovativeflexdevolopment.blogspot.com/2008/07/flex3-dynamic-popu
 lation-of-data-in.html 

 I couldnt find a way to include ItemRenderer using this kind of
   dataProvider,
 I tried everything but all I get when using a simple
 ItemRenderer is a
   flat tree with no hirarchy :(

 Please please advice

 Thanks

 Jo

   
  
  
  
  
   
  
   --
   Flexcoders Mailing List
   FAQ:
 http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
 http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt 
   Alternative FAQ location:
  
 https://share.acrobat.com/adc/document.do?docid=942dbdc8

[flexcoders] Re: Using ItemRenderer with IHierarchicalData DataProvider

2009-03-23 Thread yossi.baram
It make sense what you asked,
Yes it looks good, with hierarchy, when I eliminate the Itemrenderer call, my 
data structure is as in the example:
http://inovativeflexdevolopment.blogspot.com/2008/07/flex3-dynamic-population-of\-data-in.html

I am building a flat data (a list of rows) with parentId and type 
(child/parent) in my java server using blazeds i send it by RemoteObject to the 
Flex app.
Then I use;
ohd = new ObjectHierarchicalData(rows);
adg.dataProvider = ohd;

If I dont use the Itemrenderer the Treegrid looks good with all data and 
correct hierarchy,

Please advise if you need some thing else,

Thanks for your time :)
 

--- In flexcoders@yahoogroups.com, Gregor Kiddie gkid...@... wrote:

 Not to be funny, but does the structure look right when you aren't using
 a custom renderer? I.e. is your data correct?
 
  
 
 Gk.
 
 Gregor Kiddie
 Senior Developer
 INPS
 
 Tel:   01382 564343
 
 Registered address: The Bread Factory, 1a Broughton Street, London SW8
 3QJ
 
 Registered Number: 1788577
 
 Registered in the UK
 
 Visit our Internet Web site at www.inps.co.uk
 blocked::http://www.inps.co.uk/ 
 
 The information in this internet email is confidential and is intended
 solely for the addressee. Access, copying or re-use of information in it
 by anyone else is not authorised. Any views or opinions presented are
 solely those of the author and do not necessarily represent those of
 INPS or any of its affiliates. If you are not the intended recipient
 please contact is.helpd...@...
 
 
 
 From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
 Behalf Of yossi.baram
 Sent: 23 March 2009 09:30
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: Using ItemRenderer with IHierarchicalData
 DataProvider
 
  
 
 Thanks,
 Well, I tried extending AdvancedDataGridItemRenderer 
 IDropInListItemRenderer
 
 and my set data I'm overriding:
 override public function set data(value:Object):void {
 
 super.data = value;
 if (this.listData)
 {
 // get the owner AdvnacedDataGrid
 var listOwner:AdvancedDataGrid = AdvancedDataGrid(this.listData.owner); 
 if (listData!=null  data != null)
 { 
 this.background = true;
 this.backgroundColor = 0xFFB6B6;
 }
 } 
 }
 
 As you can see for the example its just should paint the rows.
 
 But still the data is flat I cannot see child1 as the parent :(((
 
 can you give me simple example how should set data() should look like to
 allow me manipulation on the data but still preserve the hierarchy?
 
 I tried many things but nothing
 
 Thanks





[flexcoders] Re: Using ItemRenderer with IHierarchicalData DataProvider

2009-03-23 Thread yossi.baram
The link I sent may be incorrect,
look at http://inovativeflexdevolopment.blogspot.com/
(Flex3 Dynamic population of data in Advanced datagrid with customn header...) 
example


--- In flexcoders@yahoogroups.com, yossi.baram yossi.ba...@... wrote:

 It make sense what you asked,
 Yes it looks good, with hierarchy, when I eliminate the Itemrenderer call, my 
 data structure is as in the example:
 http://inovativeflexdevolopment.blogspot.com/2008/07/flex3-dynamic-population-of\-data-in.html
 
 I am building a flat data (a list of rows) with parentId and type 
 (child/parent) in my java server using blazeds i send it by RemoteObject to 
 the Flex app.
 Then I use;
 ohd = new ObjectHierarchicalData(rows);
 adg.dataProvider = ohd;
 
 If I dont use the Itemrenderer the Treegrid looks good with all data and 
 correct hierarchy,
 
 Please advise if you need some thing else,
 
 Thanks for your time :)
  
 
 --- In flexcoders@yahoogroups.com, Gregor Kiddie gkiddie@ wrote:
 
  Not to be funny, but does the structure look right when you aren't using
  a custom renderer? I.e. is your data correct?
  
   
  
  Gk.
  
  Gregor Kiddie
  Senior Developer
  INPS
  
  Tel:   01382 564343
  
  Registered address: The Bread Factory, 1a Broughton Street, London SW8
  3QJ
  
  Registered Number: 1788577
  
  Registered in the UK
  
  Visit our Internet Web site at www.inps.co.uk
  blocked::http://www.inps.co.uk/ 
  
  The information in this internet email is confidential and is intended
  solely for the addressee. Access, copying or re-use of information in it
  by anyone else is not authorised. Any views or opinions presented are
  solely those of the author and do not necessarily represent those of
  INPS or any of its affiliates. If you are not the intended recipient
  please contact is.helpdesk@
  
  
  
  From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
  Behalf Of yossi.baram
  Sent: 23 March 2009 09:30
  To: flexcoders@yahoogroups.com
  Subject: [flexcoders] Re: Using ItemRenderer with IHierarchicalData
  DataProvider
  
   
  
  Thanks,
  Well, I tried extending AdvancedDataGridItemRenderer 
  IDropInListItemRenderer
  
  and my set data I'm overriding:
  override public function set data(value:Object):void {
  
  super.data = value;
  if (this.listData)
  {
  // get the owner AdvnacedDataGrid
  var listOwner:AdvancedDataGrid = AdvancedDataGrid(this.listData.owner); 
  if (listData!=null  data != null)
  { 
  this.background = true;
  this.backgroundColor = 0xFFB6B6;
  }
  } 
  }
  
  As you can see for the example its just should paint the rows.
  
  But still the data is flat I cannot see child1 as the parent :(((
  
  can you give me simple example how should set data() should look like to
  allow me manipulation on the data but still preserve the hierarchy?
  
  I tried many things but nothing
  
  Thanks
 





[flexcoders] Re: Using ItemRenderer with IHierarchicalData DataProvider

2009-03-23 Thread yossi.baram
 function set listData(value:BaseListData):void
//{
// _listData = DataGridListData(value);
//} 

 
//  override protected function commitProperties():void{
//  super.commitProperties();
//  }

}
}


Thats it.

If you run it, you will see a TreeGreed,

If you remark the following lines the ItemRenderer should be disabled and the 
Tree will be revealed:

var rendererProviders:Array = new Array();
rendererProviders = setRendererProvider();  
for each(var Item:AdvancedDataGridRendererProvider in rendererProviders){
this.resultTBLADG.rendererProviders.push(Item);
}


Just make a new project and copy it, then I think you will understand better.

I must use this kind of flat data structure

Thanks a lot


--- In flexcoders@yahoogroups.com, Gregor Kiddie gkid...@... wrote:

  Looking at the renderers source, it is a bit manky internally, though
 what you've posted shouldn't cause too many problems. Is your renderer
 doing anything else? Can you post the whole class?
 
  
 
 Gk.
 
 Gregor Kiddie
 Senior Developer
 INPS
 
 Tel:   01382 564343
 
 Registered address: The Bread Factory, 1a Broughton Street, London SW8
 3QJ
 
 Registered Number: 1788577
 
 Registered in the UK
 
 Visit our Internet Web site at www.inps.co.uk
 blocked::http://www.inps.co.uk/ 
 
 The information in this internet email is confidential and is intended
 solely for the addressee. Access, copying or re-use of information in it
 by anyone else is not authorised. Any views or opinions presented are
 solely those of the author and do not necessarily represent those of
 INPS or any of its affiliates. If you are not the intended recipient
 please contact is.helpd...@...
 
 
 
 From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
 Behalf Of yossi.baram
 Sent: 23 March 2009 09:57
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: Using ItemRenderer with IHierarchicalData
 DataProvider
 
  
 
 The link I sent may be incorrect,
 look at http://inovativeflexdevolopment.blogspot.com/
 http://inovativeflexdevolopment.blogspot.com/ 
 (Flex3 Dynamic population of data in Advanced datagrid with customn
 header...) example
 
 --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
 , yossi.baram yossi.baram@ wrote:
 
  It make sense what you asked,
  Yes it looks good, with hierarchy, when I eliminate the Itemrenderer
 call, my data structure is as in the example:
 
 http://inovativeflexdevolopment.blogspot.com/2008/07/flex3-dynamic-popul
 ation-of
 http://inovativeflexdevolopment.blogspot.com/2008/07/flex3-dynamic-popu
 lation-of \-data-in.html
  
  I am building a flat data (a list of rows) with parentId and type
 (child/parent) in my java server using blazeds i send it by RemoteObject
 to the Flex app.
  Then I use;
  ohd = new ObjectHierarchicalData(rows);
  adg.dataProvider = ohd;
  
  If I dont use the Itemrenderer the Treegrid looks good with all data
 and correct hierarchy,
  
  Please advise if you need some thing else,
  
  Thanks for your time :)
  
  
  --- In flexcoders@yahoogroups.com
 mailto:flexcoders%40yahoogroups.com , Gregor Kiddie gkiddie@
 wrote:
  
   Not to be funny, but does the structure look right when you aren't
 using
   a custom renderer? I.e. is your data correct?
   
   
   
   Gk.
   
   Gregor Kiddie
   Senior Developer
   INPS
   
   Tel: 01382 564343
   
   Registered address: The Bread Factory, 1a Broughton Street, London
 SW8
   3QJ
   
   Registered Number: 1788577
   
   Registered in the UK
   
   Visit our Internet Web site at www.inps.co.uk
   blocked::http://www.inps.co.uk/ http://www.inps.co.uk/  
   
   The information in this internet email is confidential and is
 intended
   solely for the addressee. Access, copying or re-use of information
 in it
   by anyone else is not authorised. Any views or opinions presented
 are
   solely those of the author and do not necessarily represent those of
   INPS or any of its affiliates. If you are not the intended recipient
   please contact is.helpdesk@
   
   
   
   From: flexcoders@yahoogroups.com
 mailto:flexcoders%40yahoogroups.com
 [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
 ] On
   Behalf Of yossi.baram
   Sent: 23 March 2009 09:30
   To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
 
   Subject: [flexcoders] Re: Using ItemRenderer with IHierarchicalData
   DataProvider
   
   
   
   Thanks,
   Well, I tried extending AdvancedDataGridItemRenderer 
   IDropInListItemRenderer
   
   and my set data I'm overriding:
   override public function set data(value:Object):void {
   
   super.data = value;
   if (this.listData)
   {
   // get the owner AdvnacedDataGrid
   var listOwner:AdvancedDataGrid =
 AdvancedDataGrid(this.listData.owner); 
   if (listData!=null  data != null

[flexcoders] Re: Using ItemRenderer with IHierarchicalData DataProvider

2009-03-23 Thread yossi.baram
Hi Gregor,
Dont want to bother, but I'll do a little :)
Any success with what I sent?

--- In flexcoders@yahoogroups.com, yossi.baram yossi.ba...@... wrote:

 Sure,
 This is the example I'm based on, you can just copy/paste to a new project 
 and it should work...
 
 temp1.mxml:
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; width=800 
 height=400
 creationComplete=init()
 mx:RemoteObject
 /mx:RemoteObject
 mx:Script
 ![CDATA[
 include general.as
 
 ]]
 /mx:Script
 mx:HBox paddingBottom=0 paddingLeft=0 paddingRight=0 
 paddingTop=0 width=100% height=100%   
 mx:AdvancedDataGrid id=resultTBLADG dataProvider={ohd} width=700 
 height=300
 mx:columns
 !-- all we want to display of the object is the name, the ADG 
 will
 take care of displaying the parent child relationship --
 mx:AdvancedDataGridColumn dataField=name/
 /mx:columns
 /mx:AdvancedDataGrid
 /mx:HBox
 /mx:Application
 
 
 The ObjectHierarchicalData class exactly as in the link I sent
 
 general.as:
 
 import mx.collections.*;
 import mx.controls.advancedDataGridClasses.AdvancedDataGridColumn;
 import mx.controls.advancedDataGridClasses.AdvancedDataGridColumnGroup;
 import mx.controls.advancedDataGridClasses.AdvancedDataGridRendererProvider;
 
 
 [Bindable]
 private var ohd:ObjectHierarchicalData;
 [Bindable]
 private var ohdTHeader:ObjectHierarchicalData;
 [Bindable]
 private var hCollView:HierarchicalCollectionView;
 
 /* here's the huge object that we're going to use to populate our
 ObjectHierarchicalData object */
 private var largeObject:Object =
 [
 { id:1, name:Misc, type:parent,quantity:32, parentTask:0},
 {id:2, name:Clean the kitchen, type:parent, parentTask:0},
 {id:3, name:Pay the bills, type:parent, parentTask:0},
 {id:4, name:Paint the shed, type:parent, parentTask:1},
 {id:5, name:Get ready for party, type:parent,parentTask:1},
 {id:6, name:Do the dishes, type:child,op1:1, 
 op2:2,parentTask:2},
 {id:7, name:Take out trash, type:child, 
 op1:11,parentTask:2},
 {id:8, name:Gas Bill, type:child, op3:23,parentTask:3},
 {id:9, name:Registration, type:child, op1:2,parentTask:3},
 {id:10, name:Fix the car, type:parent, parentTask:0},
 {id:11, name:New tires, type:child,op4:14,op1:3 
 ,parentTask:10},
 {id:12, name:Emissions test, type:child,op1:4, 
 parentTask:10},
 {id:13, name:Get new paint, 
 type:child,quantity:33::44,op1:5, parentTask:4},
 {id:14, name:Buy brushes, type:child, 
 op1:6,quantity:32::42,revenue:rev,sale:sal,parentTask:4},
 {id:15, name:Buy Drinks, type:child,op1:7, parentTask:5},
 {id:16, name:clean living room, type:child,op1:8, 
 parentTask:5},
 {id:17, name:finish invitations, 
 type:parent,op1:9,parentTask:5},{id:18, name:sub finish, 
 type:parent,parentTask:17},{id:19, name:sub sub finish, 
 type:child,parentTask:18}];
 
 private var columns:ArrayCollection = new ArrayCollection();
 
 
 public var headerObj:Object=
 [
 {id:1,name:Africa,type:parent ,parentTask:0},
 {id:2,name:somalia,type:parent, parentTask:1},
 {id:3,name:Macro,type:parent, parentTask:1},
 {id:4,name:op1,type:child,parentTask:2},
 {id:4,name:op2,type:child,parentTask:2},
 {id:5,name:Europe,type:parent ,parentTask:0},
 {id:6,name:Itly,type:parent, parentTask:5},
 {id:7,name:Japan,type:parent, parentTask:5},
 {id:8,name:op3,type:child, parentTask:6},
 {id:9,name:op4,type:child, parentTask:6},
 {id:10,name:op5,type:child, parentTask:7}
 ];
 
 private var colGroup:AdvancedDataGridColumnGroup;
 
 private var columnGroup2:AdvancedDataGridColumnGroup;
 
 public var colsArray:Array=[];
 
 
 private var columnGroup3:AdvancedDataGridColumnGroup;
 
 [Bindable]
 private var flag:Boolean = false;
 
 private function buildHeader():void
 {
 if(!flag){
 flag = true;
 var advancedDGCol:AdvancedDataGridColumn = new AdvancedDataGridColumn();
 ohdTHeader = new ObjectHierarchicalData(headerObj);
 resultTBLADG.expandAll();
 var colsArray1:Array=[];
 hCollView = new HierarchicalCollectionView(ohdTHeader);
 advancedDGCol.dataField = name;
 advancedDGCol.width=300;
 advancedDGCol.headerText='';
 colsArray.push(advancedDGCol);
 for each(var hObj:Object in headerObj)
 { 
 if(hObj.parentTask==0)
 {
 var 
 children:ICollectionView=hCollView.getChildren(hCollView.source.getData({id:hObj.id}));
 var cursor:IViewCursor=children.createCursor();
 colGroup = new AdvancedDataGridColumnGroup();
 colGroup.headerText = hObj.name;
 prepareColumns(cursor,colGroup);
 colsArray.push(colGroup);
 }
 
 }
 
 this.resultTBLADG.groupedColumns=colsArray;
 this.resultTBLADG.validateNow();
   // here I load the Item renderer
   var rendererProviders:Array = new Array();
   rendererProviders = setRendererProvider();  
 
   for each(var 
 Item:AdvancedDataGridRendererProvider in rendererProviders

[flexcoders] Re: Using ItemRenderer with IHierarchicalData DataProvider

2009-03-23 Thread yossi.baram
Greate, its working like a charm..
The solution was to put the renderer inside the AdvancedDataGrid tag
in the mxml.

I created an IFactory var:
public var  renderer_:IFactory= new ClassFactory(ItemRenderer);

Initialized it with the relevant property I need to send 
to the renderer:

(renderer_ as ClassFactory).properties = 
{tableDataProvider_:tableDataProvider};

and then put this variable inside the AdvancedDataGrid tag:
mx:AdvancedDataGrid id=adg  styleName=grid height=100% 
itemRenderer={renderer_}

Thanks Amy, your article helped me grasping things,
and Gregorg of course :

Jo

--- In flexcoders@yahoogroups.com, Amy amyblankens...@... wrote:

 --- In flexcoders@yahoogroups.com, yossi.baram yossi.baram@ wrote:
 
  Thanks,
  Well, I tried extending AdvancedDataGridItemRenderer  
  IDropInListItemRenderer
 
 Try reading my series on how to make AdvancedDataGrid accept background 
 colors in the styleFunction
 
 http://flexdiary.blogspot.com/2008/06/musings-on-advanceddatagrid-part-2.html





[flexcoders] Re: Using ItemRenderer with IHierarchicalData DataProvider

2009-03-23 Thread yossi.baram
Thanks :)
I have progress,
When I put my renderer in the AdvancedDataGrid Tag 
mx:AdvancedDataGrid id=adg  styleName=grid height=100% 
itemRenderer=cellValueRenderer

I get the Tree with all hierarchy and values, and I can manipulate the cells 
and thats great..

But what I cant find a way to send a property to this renderer this way.

I sent it before when I called this function:

[Bindable]
private function createRendererProvider():void{
var rendererProvider:AdvancedDataGridRendererProvider;
var rendererProviders:Array = new Array();
var columns:ArrayCollection = tableDataProvider.columnNames as 
ArrayCollection;
for (var i:int = 0; i  columns.length; i++){
var colName:String = columns.getItemAt(i) as String;
rendererProvider = new AdvancedDataGridRendererProvider();
rendererProvider.columnIndex=i; 
var renderer_:IFactory= new ClassFactory(ItemRenderer);
// Sending variables to the renderer constructor
   (renderer_ as ClassFactory).properties 
  =  {tableDataProvider_:tableDataProvider};
   rendererProvider.renderer= renderer_;
   rendererProvider.dataField=colName;
   rendererProviders.push(rendererProvider);
}
for each(var Item:AdvancedDataGridRendererProvider in 
rendererProviders){
adg.rendererProviders.push(Item);
}
}

But using that, produce my problem again not showing the hierarchy :(

Is there a way to put the renderer in AdvancedDataGrid tag and still
use the ClassFactory to send proerties??

Thanks



--- In flexcoders@yahoogroups.com, Amy amyblankens...@... wrote:

 --- In flexcoders@yahoogroups.com, yossi.baram yossi.baram@ wrote:
 
  Thanks,
  Well, I tried extending AdvancedDataGridItemRenderer  
  IDropInListItemRenderer
 
 Try reading my series on how to make AdvancedDataGrid accept background 
 colors in the styleFunction
 
 http://flexdiary.blogspot.com/2008/06/musings-on-advanceddatagrid-part-2.html





[flexcoders] Using ItemRenderer with IHierarchicalData DataProvider

2009-03-22 Thread yossi.baram
Hi,
There is a greate example in the following link that allows us to create simple 
hirarchical grid with AdvancedDataGrid, implementing IHierarchicalData.

http://inovativeflexdevolopment.blogspot.com/2008/07/flex3-dynamic-population-of-data-in.html

I couldnt find a way to include ItemRenderer using this kind of dataProvider,
I tried everything but all I get when using a simple ItemRenderer is a flat 
tree with no hirarchy :(

Please please advice

Thanks

Jo 



[flexcoders] Re: Using ItemRenderer with IHierarchicalData DataProvider

2009-03-22 Thread yossi.baram
Hi,
My problem is simple,
In my TreeTable The ItemRenderer show me only one level.
When I click the parent it will show only the level beneath it,
although it has childrens, WHY??? 
When I use depth, I can see the tree but it doesnt activate the ItemRenderer.
How can I set the Itemrenderer to manipulate and show ALL branches?

Please advice guys, I have been looking every where but couldnt find a solution.

Thanks in advance



--- In flexcoders@yahoogroups.com, yossi.baram yossi.ba...@... wrote:

 Hi,
 There is a greate example in the following link that allows us to create 
 simple hirarchical grid with AdvancedDataGrid, implementing IHierarchicalData.
 
 http://inovativeflexdevolopment.blogspot.com/2008/07/flex3-dynamic-population-of-data-in.html
 
 I couldnt find a way to include ItemRenderer using this kind of dataProvider,
 I tried everything but all I get when using a simple ItemRenderer is a flat 
 tree with no hirarchy :(
 
 Please please advice
 
 Thanks
 
 Jo





[flexcoders] Activate ItemRenderer in AdvancedDataGrid

2009-03-20 Thread yossi.baram
Hi helper,
I have an Hirarchy data grid, I actualy took the adobe sample
http://inovativeflexdevolopment.blogspot.com/
What is does is creating ObjectHierarchicalData that implements 
IHierarchicalData.
the dataprovider is set accordingly and all looks great.
In my grid I can see the parents and all its sub parent and childrens.
My problem is when I want to use columns ItemRenderer(cellValueRenderer).

public class cellValueRenderer extends HBox implements IDropInListItemRenderer
{   
private var _listData:DataGridListData;
private var updatedDP:ArrayCollection;
public var adg:AdvancedDataGrid=new AdvancedDataGrid();
private var ohd:ObjectHierarchicalData;
public function cellValueRenderer():void{

super();

}

override public function set data(value:Object):void
{
if(value != null)
{
super.data = value;
removeAllChildren();

var label:Label =new Label();
label.text = 
value[DataGridListData(listData).dataField];
addChild(label);



}
}
override public function get data():Object {
return super.data;
}

public function get listData():BaseListData
{
return _listData;
}
 
public function set listData(value:BaseListData):void
{   
 _listData = DataGridListData(value);
} 
 
override protected function commitProperties():void{
super.commitProperties();
}
 
}
}

I add this to my AS:

var rendererProviders:Array = new Array();
rendererProviders = setRendererProvider();  
for each(var ItemRenderer:AdvancedDataGridRendererProvider in 
rendererProviders){   
this.resultTBLADG.rendererProviders.push(ItemRenderer);
}

columns.addItem(name);
columns.addItem(op1);
columns.addItem(op2);
columns.addItem(op3);
columns.addItem(op4);
columns.addItem(op5);
var rendererProvider:AdvancedDataGridRendererProvider;
var rendererProviders:Array = new Array();
for (var i:int = 0; i  columns.length; i++){
var colName:String = columns.getItemAt(i) as String;
rendererProvider = new AdvancedDataGridRendererProvider();
rendererProvider.columnIndex=i; 

var renderer_:IFactory= new ClassFactory(cellValueRenderer);

rendererProvider.renderer= renderer_;  

rendererProvider.dataField=colName;
rendererProviders.push(rendererProvider);
}
return rendererProviders;
}


On my grid I can see the parent folder, but when I click (the Itemrenderer is 
activated)
I see the children but flat without the hirarchy:( although the parent have sub 
parents, it doesnt show it.
I guess its because I added a Label each time.

How can I use the set data() that will show me all hirarchy of the tree?
Label is no good here.

I need to use the exact DataSource in the example (with parent  child 
attributes)

I realy need your help.

Thanks a lot

Jo



[flexcoders] Re: row colors in AdvancedDataGrid

2009-03-19 Thread yossi.baram
Yep, the Apllication background I guess,
I created the grid as a Tag and sent the with  height values for the 
Application.
I set width=100% and height=100% for the grid and the height is showing 
great with no padding but on the sides of the grid I get 20px of blue 
background on each side althogh I set width to 100%
Why is that?

Thanks man

--- In flexcoders@yahoogroups.com, Romeo Obane ro...@... wrote:

 You mean changing the Application's or Data Grid default background?
 
 On Thu, Mar 19, 2009 at 1:28 PM, yossi.baram yossi.ba...@... wrote:
 
Greate man :)
 
  I missed that Thanks a lot,
 
  One more :),
  Do you know how can I eliminate the blue background of the application
  containing my greed?
  I just need to show the grid in an area without the colored background
 
  thanks again
 
 
  --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Romeo
  Obane romeo@ wrote:
  
   You can go and see for the style property of AdvancedDataGrid 
   alternatingItemColors.
  
  http://livedocs.adobe.com/flex/3/langref/mx/controls/AdvancedDataGrid.html
  
   On Thu, Mar 19, 2009 at 7:00 AM, yossi.baram yossi.baram@ wrote:
  
Hi helper,
In Adobe developer guid in all examples of treeGrid every second row
  has a
background greyed color
   
  http://livedocs.adobe.com/flex/3/html/help.html?content=advdatagrid_10.html
I need the same thing, 2 colors alternatly,
How do I do it?
   
Thanks
Jo
   
   
   
  
 
   
 





[flexcoders] Re: row colors in AdvancedDataGrid

2009-03-19 Thread yossi.baram
Hi,
I miss led you a bit,
I use a css and I can eliminate the background color of the application to 
white so I can see only the grid.
I set the height of the grid to 100% BUT not the width because I create the 
colums dynamically and set width for each column.
in my mxml:
script
// this is the function the sets the columns
private function setColumnProperties(columnId:String,

columns:Object):AdvancedDataGridColumn{
var tableColumn:TableColumn = columns[columnId] as TableColumn;
var dgc:AdvancedDataGridColumn = null;  
if(tableColumn.visible){

dgc = new AdvancedDataGridColumn(); 
dgc.dataField = columnId;
dgc.width = tableColumn.width;
dgc.headerText = tableColumn.header;
dgc.sortable = tableColumn.sortable;
}
return dgc; 

}
/script
mx:AdvancedDataGrid id=adg  styleName=grid height=100% 
folderClosedIcon={null} folderOpenIcon={null} 
defaultLeafIcon={null}
paddingBottom=0 paddingLeft=0 paddingRight=0 
paddingTop=0



The result I get is the grid with horizontal scroll bar (because the 
application width is greater then my grid)
turning the scroll bar off doesnt solve the issue that the app is greater in 
width then my grid, why cant I match the width size of the app and the grid? 

I hope I'm understud :)

--- In flexcoders@yahoogroups.com, Romeo Obane ro...@... wrote:

 One of the simple ways to change your Application Background default color,
 is thru your css. Below is the sample codes.
 
 e.g. 1
 
 // For gradient colors
 
 Application
 {
 backgroundGradientAlphas: 1.0, 0.59;
 backgroundGradientColors: #00, #4D91BF;
 }
 
 e.g. 1
 // For Solid colors
 
 Application
 {
  background-color: blue;
 }
 
 
 Regarding the Grid, I tried the same way that you did, but it does occupy
 the whole width and height of my application space.
 Did you placed your grid inside the container aside of the main application
 itself?
 
 Maybe if you could share some of the codes that could help me understand
 more.
 
 On Thu, Mar 19, 2009 at 2:57 PM, yossi.baram yossi.ba...@... wrote:
 
Yep, the Apllication background I guess,
  I created the grid as a Tag and sent the with  height values for the
  Application.
  I set width=100% and height=100% for the grid and the height is showing
  great with no padding but on the sides of the grid I get 20px of blue
  background on each side althogh I set width to 100%
  Why is that?
 
  Thanks man
 
 
  --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Romeo
  Obane romeo@ wrote:
  
   You mean changing the Application's or Data Grid default background?
  
   On Thu, Mar 19, 2009 at 1:28 PM, yossi.baram yossi.baram@ wrote:
  
Greate man :)
   
I missed that Thanks a lot,
   
One more :),
Do you know how can I eliminate the blue background of the application
containing my greed?
I just need to show the grid in an area without the colored background
   
thanks again
   
   
--- In flexcoders@yahoogroups.com 
flexcoders%40yahoogroups.comflexcoders%
  40yahoogroups.com, Romeo
Obane romeo@ wrote:

 You can go and see for the style property of AdvancedDataGrid 
 alternatingItemColors.

   
  http://livedocs.adobe.com/flex/3/langref/mx/controls/AdvancedDataGrid.html

 On Thu, Mar 19, 2009 at 7:00 AM, yossi.baram yossi.baram@ wrote:

  Hi helper,
  In Adobe developer guid in all examples of treeGrid every second
  row
has a
  background greyed color
 
   
  http://livedocs.adobe.com/flex/3/html/help.html?content=advdatagrid_10.html
  I need the same thing, 2 colors alternatly,
  How do I do it?
 
  Thanks
  Jo
 
 
 

   
   
   
  
 
   
 





[flexcoders] Re: row colors in AdvancedDataGrid

2009-03-19 Thread yossi.baram
oh, if you mean by fixed that all column have the same width, then the answer 
is no,
each column can be with different size, so dividing the width of the 
Application to num columns wont be relevant.
Is there a simple way to match the size of the grid with the application? very 
strange :(

Thanks

--- In flexcoders@yahoogroups.com, Romeo Obane ro...@... wrote:

 If the column of your grid is fixed, then it would be okay, we just need to
 know how many columns do you have.
 
 I don't know if this simple code below could help, try to run and see.
 
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute
 horizontalScrollPolicy=off
 mx:Script
 ![CDATA[
 import
 mx.controls.advancedDataGridClasses.AdvancedDataGridColumn;
 
 private function getCols():Array
 {
 var col:AdvancedDataGridColumn;
 var cols:Array = new Array();
 
 // let's say we have 10 cols
 for(var i:int = 0; i  10; i++)
 {
 col = new AdvancedDataGridColumn();
 col.headerText = A;
 col.width = getColWidth();
 cols.push(col);
 }
 
 return cols;
 }
 
 private function getColWidth():int
 {
 var w:int = this.width / 10; // 10 is the number of columns
 return w;
 }
 
 ]]
 /mx:Script
 
 mx:AdvancedDataGrid height=100% columns={getCols()}/
 /mx:Application
 
 On Thu, Mar 19, 2009 at 5:16 PM, yossi.baram yossi.ba...@... wrote:
 
Hey,
  It is fixed when the grid is loded...
  So, what do you think, Can we set the app and the grid to be matched in
  size?
  The padding I get on the size of the grid are a problem because they
  produce horizontal scroll bar.
  Remember, the open area the SWF is presented is the exact size of the grid,
  but you see a scroll bar because the application is wider,
 
  Thanks
 
 
  --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Romeo
  Obane romeo@ wrote:
  
   Oh, thanks for clearing more your concern.
  
   One more thing, your width for each column is fixed?
  
   If yes, we can easily set the width of each column to be flexible of the
  app
   width, BUT if it's dynamic (depends on the data size), it could be more
   tricky since the grid column usually don't have percent width.
  
   On Thu, Mar 19, 2009 at 3:45 PM, yossi.baram yossi.baram@ wrote:
  
Hi,
I miss led you a bit,
I use a css and I can eliminate the background color of the application
  to
white so I can see only the grid.
I set the height of the grid to 100% BUT not the width because I create
  the
colums dynamically and set width for each column.
in my mxml:
script
// this is the function the sets the columns
private function setColumnProperties(columnId:String,
columns:Object):AdvancedDataGridColumn{
var tableColumn:TableColumn = columns[columnId] as TableColumn;
var dgc:AdvancedDataGridColumn = null;
if(tableColumn.visible){
dgc = new AdvancedDataGridColumn();
dgc.dataField = columnId;
dgc.width = tableColumn.width;
dgc.headerText = tableColumn.header;
dgc.sortable = tableColumn.sortable;
}
return dgc;
}
/script
mx:AdvancedDataGrid id=adg styleName=grid height=100%
folderClosedIcon={null} folderOpenIcon={null}
  defaultLeafIcon={null}
paddingBottom=0 paddingLeft=0 paddingRight=0 paddingTop=0

   
The result I get is the grid with horizontal scroll bar (because the
application width is greater then my grid)
turning the scroll bar off doesnt solve the issue that the app is
  greater
in width then my grid, why cant I match the width size of the app and
  the
grid?
   
I hope I'm understud :)
   
   
--- In flexcoders@yahoogroups.com 
flexcoders%40yahoogroups.comflexcoders%
  40yahoogroups.com, Romeo
Obane romeo@ wrote:

 One of the simple ways to change your Application Background default
color,
 is thru your css. Below is the sample codes.

 e.g. 1

 // For gradient colors

 Application
 {
 backgroundGradientAlphas: 1.0, 0.59;
 backgroundGradientColors: #00, #4D91BF;
 }

 e.g. 1
 // For Solid colors

 Application
 {
 background-color: blue;
 }


 Regarding the Grid, I tried the same way that you did, but it does
  occupy
 the whole width and height of my application space.
 Did you placed your grid inside the container aside of the main
application
 itself?

 Maybe if you could share some of the codes that could help me
  understand
 more.

 On Thu, Mar 19, 2009 at 2:57 PM, yossi.baram yossi.baram@ wrote:

  Yep, the Apllication background I guess,
  I created the grid as a Tag and sent

[flexcoders] Re: row colors in AdvancedDataGrid

2009-03-19 Thread yossi.baram
Hey,
It is fixed when the grid is loded...
So, what do you think, Can we set the app and the grid to be matched in size?
The padding I get on the size of the grid are a problem because they produce 
horizontal scroll bar.
Remember, the open area the SWF is presented is the exact size of the grid, but 
you see a scroll bar because the application is wider,

Thanks

--- In flexcoders@yahoogroups.com, Romeo Obane ro...@... wrote:

 Oh, thanks for clearing more your concern.
 
 One more thing, your width for each column is fixed?
 
 If yes, we can easily set the width of each column to be flexible of the app
 width, BUT if it's dynamic (depends on the data size), it could be more
 tricky since the grid column usually don't have percent width.
 
 On Thu, Mar 19, 2009 at 3:45 PM, yossi.baram yossi.ba...@... wrote:
 
Hi,
  I miss led you a bit,
  I use a css and I can eliminate the background color of the application to
  white so I can see only the grid.
  I set the height of the grid to 100% BUT not the width because I create the
  colums dynamically and set width for each column.
  in my mxml:
  script
  // this is the function the sets the columns
  private function setColumnProperties(columnId:String,
  columns:Object):AdvancedDataGridColumn{
  var tableColumn:TableColumn = columns[columnId] as TableColumn;
  var dgc:AdvancedDataGridColumn = null;
  if(tableColumn.visible){
  dgc = new AdvancedDataGridColumn();
  dgc.dataField = columnId;
  dgc.width = tableColumn.width;
  dgc.headerText = tableColumn.header;
  dgc.sortable = tableColumn.sortable;
  }
  return dgc;
  }
  /script
  mx:AdvancedDataGrid id=adg styleName=grid height=100%
  folderClosedIcon={null} folderOpenIcon={null} defaultLeafIcon={null}
  paddingBottom=0 paddingLeft=0 paddingRight=0 paddingTop=0
  
 
  The result I get is the grid with horizontal scroll bar (because the
  application width is greater then my grid)
  turning the scroll bar off doesnt solve the issue that the app is greater
  in width then my grid, why cant I match the width size of the app and the
  grid?
 
  I hope I'm understud :)
 
 
  --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Romeo
  Obane romeo@ wrote:
  
   One of the simple ways to change your Application Background default
  color,
   is thru your css. Below is the sample codes.
  
   e.g. 1
  
   // For gradient colors
  
   Application
   {
   backgroundGradientAlphas: 1.0, 0.59;
   backgroundGradientColors: #00, #4D91BF;
   }
  
   e.g. 1
   // For Solid colors
  
   Application
   {
   background-color: blue;
   }
  
  
   Regarding the Grid, I tried the same way that you did, but it does occupy
   the whole width and height of my application space.
   Did you placed your grid inside the container aside of the main
  application
   itself?
  
   Maybe if you could share some of the codes that could help me understand
   more.
  
   On Thu, Mar 19, 2009 at 2:57 PM, yossi.baram yossi.baram@ wrote:
  
Yep, the Apllication background I guess,
I created the grid as a Tag and sent the with  height values for the
Application.
I set width=100% and height=100% for the grid and the height is
  showing
great with no padding but on the sides of the grid I get 20px of blue
background on each side althogh I set width to 100%
Why is that?
   
Thanks man
   
   
--- In flexcoders@yahoogroups.com 
flexcoders%40yahoogroups.comflexcoders%
  40yahoogroups.com, Romeo
Obane romeo@ wrote:

 You mean changing the Application's or Data Grid default background?

 On Thu, Mar 19, 2009 at 1:28 PM, yossi.baram yossi.baram@ wrote:

  Greate man :)
 
  I missed that Thanks a lot,
 
  One more :),
  Do you know how can I eliminate the blue background of the
  application
  containing my greed?
  I just need to show the grid in an area without the colored
  background
 
  thanks again
 
 
  --- In flexcoders@yahoogroups.com 
  flexcoders%40yahoogroups.comflexcoders%
  40yahoogroups.comflexcoders%
40yahoogroups.com, Romeo
  Obane romeo@ wrote:
  
   You can go and see for the style property of AdvancedDataGrid 
   alternatingItemColors.
  
 
   
  http://livedocs.adobe.com/flex/3/langref/mx/controls/AdvancedDataGrid.html
  
   On Thu, Mar 19, 2009 at 7:00 AM, yossi.baram yossi.baram@
  wrote:
  
Hi helper,
In Adobe developer guid in all examples of treeGrid every
  second
row
  has a
background greyed color
   
 
   
  http://livedocs.adobe.com/flex/3/html/help.html?content=advdatagrid_10.html
I need the same thing, 2 colors alternatly,
How do I do it?
   
Thanks
Jo
   
   
   
  
 
 
 

   
   
   
  
 
   
 





[flexcoders] Creating style for AdvancedDataGridColumn that dded dynamically

2009-03-18 Thread yossi.baram
Hi,
I have an AdvancedDataGrid and I add its  columns dynamically(with new 
instanciate).
I created a css file and I control the DataGrid, but for the columns it doesnt 
respond, why? 

/* CSS file */
AdvancedDataGrid
{
  verticalGridLines: true;
  horizontalGridLines: true;
  border-style: none;
  selectionColor: #a2c2e4;
  rollOverColor: #FF;
  alternating-item-colors: #F4FBFF, #FF;
}
AdvancedDataGridColumn
{
  textAlign:left;
}

Is it because the columns were created dynamically? and not as Flex tags?

I need all the styles to be added inside a css file.

oh, one small qestion if I may:
How can I eliminate the blue background sorounding the grid?
(I created the grid as a Tag and I need to plant it inside a page but without 
the background).

Please advice on both issues if you can...

Thanks  a lot
Jo



[flexcoders] row colors in AdvancedDataGrid

2009-03-18 Thread yossi.baram
Hi helper,
In Adobe developer guid in all examples of treeGrid every second row has a 
background greyed color
http://livedocs.adobe.com/flex/3/html/help.html?content=advdatagrid_10.html
I need the same thing, 2 colors alternatly,
How do I do it?

Thanks
Jo



[flexcoders] Re: row colors in AdvancedDataGrid

2009-03-18 Thread yossi.baram
Greate man :)

I missed that Thanks a lot,

One more :),
Do you know how can I eliminate the blue background of the application 
containing my greed?
I just need to show the grid in an area without the colored background

thanks again




--- In flexcoders@yahoogroups.com, Romeo Obane ro...@... wrote:

 You can go and see for the style property of AdvancedDataGrid 
 alternatingItemColors.
 http://livedocs.adobe.com/flex/3/langref/mx/controls/AdvancedDataGrid.html
 
 On Thu, Mar 19, 2009 at 7:00 AM, yossi.baram yossi.ba...@... wrote:
 
Hi helper,
  In Adobe developer guid in all examples of treeGrid every second row has a
  background greyed color
  http://livedocs.adobe.com/flex/3/html/help.html?content=advdatagrid_10.html
  I need the same thing, 2 colors alternatly,
  How do I do it?
 
  Thanks
  Jo
 
   
 





[flexcoders] Re: Lazy loading in AdvancedDataGrid using RemoteObject

2009-03-08 Thread yossi.baram
Thanks Amy :))
--- In flexcoders@yahoogroups.com, Amy amyblankens...@... wrote:

 --- In flexcoders@yahoogroups.com, yossi.baram yossi.baram@ wrote:
 
  Thanks Amy for your help,
  I'm going your way:), only one question if i may,
  Is it possible to activate ItemRenderer on my columns after fetching 
  childrens from my RemoteObject? How do I do that based on your example?
  I need to manipulate the data (override set data()) based on the various 
  columns, the childrens data is not always plain value.
 
 Implement IDropInListItemRenderer, and that information will be available to 
 your renderer in listData.





[flexcoders] Re: Lazy loading in AdvancedDataGrid using RemoteObject

2009-03-07 Thread yossi.baram
Thanks Amy for your help,
I'm going your way:), only one question if i may,
Is it possible to activate ItemRenderer on my columns after fetching childrens 
from my RemoteObject? How do I do that based on your example?
I need to manipulate the data (override set data()) based on the various 
columns, the childrens data is not always plain value.

Thanks again :)

Jo

--- In flexcoders@yahoogroups.com, Amy amyblankens...@... wrote:

 --- In flexcoders@yahoogroups.com, yossi.baram yossi.baram@ wrote:
 
  one more thing,
  AdvancedDataGrid doesnt support DataDescriptor...
 
 Yes. You asked about general approaches and pointers in the right direction.  
 I showed you an example that will take you part of the way there.  The rest 
 of it is up to you :)





[flexcoders] Re: Lazy loading in AdvancedDataGrid using RemoteObject

2009-03-06 Thread yossi.baram
wow Amy,
Some of your articles helped me a lot, realy thanks you:)
Now I looked at your example and using AdvacedDataModel with RmoteObject, 
getting the data from my Java code, couldnt rally see how can I use it 
(although I would love to), if you can guide me with the adaptations, please 
do...

I actaualy used your advice regards the AsyncToken, and I have some results, I 
get the data from the server, but I have lots of problem controlling the expand 
of the desired branch, when I click the branch, the data is fetched using the 
RemoteObject but childrens expand and collapse immidiatly :( 

My code:

in my mxml: 
1. I load first the data for the dataprovider to show only parents
2. When we click on the closed parentId we activate:

private function onItemOpen(event:AdvancedDataGridEvent ) : void
{
   var remoteService:RemoteObject=getDataFromHandler();
   // getLazyData is the func from my server to get the data
   var news:AsyncToken = remoteService.getLazyData   
(event.item.GroupLabel);
  news.addResponder(new mx.rpc.Responder(setAttributes, onFault));
}

public function getDataFromHandler(): RemoteObject { 
dataService = new RemoteObject(MyHandler1); 
dataService.showBusyCursor = true;  
dataService.destination=DataGridRemote;
return dataService; 
} 

The RemoteObject goes to the server and when its back it activates:
protected function setAttributes(event: ResultEvent): void {
var dm:DataModel;
// my object from the server
dm = DataModel(event.result);   model = 
MatrixDataModel(dm.model.getItemAt(0));
 // my function that converts my Object to DataProvider
remoteDP = createProvider(model);   // 
Create Headers
createHeaders();
// create upper group columns   
setGroupedColumns();

}

It sims that the correct data is on the grid but after a split sec it collapse.
WHY???
Can i use your code to make all better?

Thanks a lot for all your help, really

Jo

--- In flexcoders@yahoogroups.com, Amy amyblankens...@... wrote:

 --- In flexcoders@yahoogroups.com, yossi.baram yossi.baram@ wrote:
 
  Hi guys,
  I am strugeling to figure out lazy loading in my AdvancedDataGrid.
  I didnt find any relevant document on that.
  If I'm using ItemRenderer for my columns to do manipulation on the data, it 
  is executed when I click on the grouped (branch )column.
  This is good if I ahve a dataprovider with all data.
  But if I want lazy loading,
  When or where should I create my RemoteObject to fetch the relevant data 
  from the server? 
 
 I typically create a static class to use for the RemoteObject.  Each custom 
 typed object in the collection has a reference to it and a method that can be 
 called to tell it to load children.
 
  Can I do it in my ItemRenderer?
  Other option, If I catch a click from my AdvancedDataGrid and figure out 
  the parentId, and fetch the relevant data from the server, how can I 
  activate the Itemrenderer that I need to manipulate with this new data?
 
 The dataProvider for your ADG will always be a HierachichalCollectionView, 
 which means you can easily get from parent to child and vice versa.
 
 If you start out with an empty ArrayCollection as the children property on 
 each of your objects, then when that AC is updated (NOT REPLACED) by the 
 result of a Remote Object call, then the AC should generate whatever events 
 the ADG needs to fill itself in.
 
  Many questions regard this Lazy loading, can you guide me here please?
 
 You might find this example helpful:
 
 http://flexdiary.blogspot.com/2009/01/lazy-loading-tree-example-file-posted.html
 
 HTH;
 
 Amy





[flexcoders] Re: Lazy loading in AdvancedDataGrid using RemoteObject

2009-03-06 Thread yossi.baram
one more thing,
AdvancedDataGrid doesnt support DataDescriptor...

--- In flexcoders@yahoogroups.com, yossi.baram yossi.ba...@... wrote:

 wow Amy,
 Some of your articles helped me a lot, realy thanks you:)
 Now I looked at your example and using AdvacedDataModel with RmoteObject, 
 getting the data from my Java code, couldnt rally see how can I use it 
 (although I would love to), if you can guide me with the adaptations, please 
 do...
 
 I actaualy used your advice regards the AsyncToken, and I have some results, 
 I get the data from the server, but I have lots of problem controlling the 
 expand of the desired branch, when I click the branch, the data is fetched 
 using the RemoteObject but childrens expand and collapse immidiatly :( 
 
 My code:
 
 in my mxml: 
 1. I load first the data for the dataprovider to show only parents
 2. When we click on the closed parentId we activate:
 
 private function onItemOpen(event:AdvancedDataGridEvent ) : void
   {
var remoteService:RemoteObject=getDataFromHandler();
// getLazyData is the func from my server to get the data
var news:AsyncToken = remoteService.getLazyData   
 (event.item.GroupLabel);
   news.addResponder(new mx.rpc.Responder(setAttributes, onFault));
 }
 
 public function getDataFromHandler(): RemoteObject { 
   dataService = new RemoteObject(MyHandler1); 
   dataService.showBusyCursor = true;  
 dataService.destination=DataGridRemote;
   return dataService; 
 } 
 
 The RemoteObject goes to the server and when its back it activates:
 protected function setAttributes(event: ResultEvent): void {
   var dm:DataModel;
 // my object from the server  
   dm = DataModel(event.result);   model = 
 MatrixDataModel(dm.model.getItemAt(0));
  // my function that converts my Object to DataProvider
   remoteDP = createProvider(model);   // 
 Create Headers
   createHeaders();
   // create upper group columns   
   setGroupedColumns();
   
   }
 
 It sims that the correct data is on the grid but after a split sec it 
 collapse.
 WHY???
 Can i use your code to make all better?
 
 Thanks a lot for all your help, really
 
 Jo
 
 --- In flexcoders@yahoogroups.com, Amy amyblankenship@ wrote:
 
  --- In flexcoders@yahoogroups.com, yossi.baram yossi.baram@ wrote:
  
   Hi guys,
   I am strugeling to figure out lazy loading in my AdvancedDataGrid.
   I didnt find any relevant document on that.
   If I'm using ItemRenderer for my columns to do manipulation on the data, 
   it is executed when I click on the grouped (branch )column.
   This is good if I ahve a dataprovider with all data.
   But if I want lazy loading,
   When or where should I create my RemoteObject to fetch the relevant data 
   from the server? 
  
  I typically create a static class to use for the RemoteObject.  Each custom 
  typed object in the collection has a reference to it and a method that can 
  be called to tell it to load children.
  
   Can I do it in my ItemRenderer?
   Other option, If I catch a click from my AdvancedDataGrid and figure out 
   the parentId, and fetch the relevant data from the server, how can I 
   activate the Itemrenderer that I need to manipulate with this new data?
  
  The dataProvider for your ADG will always be a HierachichalCollectionView, 
  which means you can easily get from parent to child and vice versa.
  
  If you start out with an empty ArrayCollection as the children property on 
  each of your objects, then when that AC is updated (NOT REPLACED) by the 
  result of a Remote Object call, then the AC should generate whatever events 
  the ADG needs to fill itself in.
  
   Many questions regard this Lazy loading, can you guide me here please?
  
  You might find this example helpful:
  
  http://flexdiary.blogspot.com/2009/01/lazy-loading-tree-example-file-posted.html
  
  HTH;
  
  Amy
 





[flexcoders] Lazy loading in AdvancedDataGrid using RemoteObject

2009-03-05 Thread yossi.baram
Hi guys,
I am strugeling to figure out lazy loading in my AdvancedDataGrid.
I didnt find any relevant document on that.
If I'm using ItemRenderer for my columns to do manipulation on the data, it is 
executed when I click on the grouped (branch )column.
This is good if I ahve a dataprovider with all data.
But if I want lazy loading,
When or where should I create my RemoteObject to fetch the relevant data from 
the server? Can I do it in my ItemRenderer?
Other option, If I catch a click from my AdvancedDataGrid and figure out the 
parentId, and fetch the relevant data from the server, how can I activate the 
Itemrenderer that I need to manipulate with this new data?

Many questions regard this Lazy loading, can you guide me here please?

Thanks a lot

Jo



[flexcoders] Seperate Parent Field Hirarchy Field in AdvancedDataGrid

2009-03-03 Thread yossi.baram
Hi,
I am creating a TreeGrid using the AdvancedDataGrid in Flex 3.

The function that build my group columns is :

private function setGroupedColumns():void
{


var groupingCollection:GroupingCollection=new GroupingCollection()

var grouping:Grouping=new Grouping()
var groupingField:GroupingField

grouping.fields=new Array()

// Set the parents columns
var parentIds:ArrayCollection = properties.parantIdColumns as 
ArrayCollection;

// Setting the Parent field
groupingField=new GroupingField(parent);
grouping.fields.push(groupingField) 


groupingCollection.source=ArrayCollection(remoteDP)

groupingCollection.grouping=grouping
groupingCollection.refresh()
myADG.dataProvider=groupingCollection
}


Here I get a Tree and parent field as its parent.
If I push more fields to 
grouping.fields.push(groupingField)
I get more sub childrens.
Thats not what I need.


How can I set parent field to stay the parent (in the background) but 
to set different field(column) to be the hirarchy column (with the 
folder icon or arrow).

The parent column should look as a normal column but the hirarchy 
will be based on its data. the Tree appearance will be shown in a 
different field.

Can I do it?

Thanks

Jo



[flexcoders] Re: Seperate Parent Field Hirarchy Field in AdvancedDataGrid

2009-03-03 Thread yossi.baram
Please help

--- In flexcoders@yahoogroups.com, yossi.baram yossi.ba...@... wrote:

 Hi,
 I am creating a TreeGrid using the AdvancedDataGrid in Flex 3.
 
 The function that build my group columns is :
 
 private function setGroupedColumns():void
 {
   
 
 var groupingCollection:GroupingCollection=new GroupingCollection()
   
 var grouping:Grouping=new Grouping()
 var groupingField:GroupingField
   
 grouping.fields=new Array()
   
 // Set the parents columns
 var parentIds:ArrayCollection = properties.parantIdColumns as 
 ArrayCollection;
   
 // Setting the Parent field
 groupingField=new GroupingField(parent);
 grouping.fields.push(groupingField)   
 
 
 groupingCollection.source=ArrayCollection(remoteDP)
 
 groupingCollection.grouping=grouping
 groupingCollection.refresh()
 myADG.dataProvider=groupingCollection
 }
 
 
 Here I get a Tree and parent field as its parent.
 If I push more fields to 
 grouping.fields.push(groupingField)
 I get more sub childrens.
 Thats not what I need.
 
 
 How can I set parent field to stay the parent (in the background) but 
 to set different field(column) to be the hirarchy column (with the 
 folder icon or arrow).
 
 The parent column should look as a normal column but the hirarchy 
 will be based on its data. the Tree appearance will be shown in a 
 different field.
 
 Can I do it?
 
 Thanks
 
 Jo





[flexcoders] How to retrive info send as HashMap in ActionScript using blazeds RemoteObject

2009-03-02 Thread yossi.baram
Hi helper, 
I Have a class in java and one of its properties is: 

private MapString,UpperlColumnHeader upperColumnHeaders; 

public HashMapString,UpperlColumnHeader getUpperColumnHeaders() { 
return upperColumnHeaders; 
} 

public void setUpperColumnHeaders(HashMapString,UpperlColumnHeader 
upperColumnHeaders) { 
this.upperColumnHeaders = upperColumnHeaders; 
} 

UpperlColumnHeader is a bean translated to ActionScript class as well.


I am sending the data by RemoteObject to Flex. 

my identical ActionScript class: 

[RemoteClass(alias=PresentationModel.PresentationModel)] 
public class PresentationModel 
{ 
 // How do I link this Object to UpperlColumnHeader class?  
(.. column.UpperlColumnHeader )
 public var upperColumnHeaders:Object; 
} 

I know Map is translated to Object in Flex. 
How do I retrieve all elements from this Object? 
Is my AS is correct? 
remember the key of the map is String and the value is 
UpperlColumnHeader AS class i created. 

Thanks 

Jo 




[flexcoders] Re: How to retrive info send as HashMap in ActionScript using blazeds RemoteObject

2009-03-02 Thread yossi.baram
Ok,
I solved the issue, just by itterating through the Object
key's and values's,

Thanks

--- In flexcoders@yahoogroups.com, yossi.baram yossi.ba...@... 
wrote:

 Hi helper, 
 I Have a class in java and one of its properties is: 
 
 private MapString,UpperlColumnHeader upperColumnHeaders; 
 
 public HashMapString,UpperlColumnHeader getUpperColumnHeaders() { 
 return upperColumnHeaders; 
 } 
 
 public void setUpperColumnHeaders
(HashMapString,UpperlColumnHeader 
 upperColumnHeaders) { 
 this.upperColumnHeaders = upperColumnHeaders; 
 } 
 
 UpperlColumnHeader is a bean translated to ActionScript class as 
well.
 
 
 I am sending the data by RemoteObject to Flex. 
 
 my identical ActionScript class: 
 
 [RemoteClass(alias=PresentationModel.PresentationModel)] 
 public class PresentationModel 
 { 
  // How do I link this Object to UpperlColumnHeader class?  
 (.. column.UpperlColumnHeader )
  public var upperColumnHeaders:Object; 
 } 
 
 I know Map is translated to Object in Flex. 
 How do I retrieve all elements from this Object? 
 Is my AS is correct? 
 remember the key of the map is String and the value is 
 UpperlColumnHeader AS class i created. 
 
 Thanks 
 
 Jo





[flexcoders] Retrieve column name from a DataProvide r -please advice

2009-02-27 Thread yossi.baram
Hi guys,
I have a dataGrid and using RemoteObject to create a TreeGrid.
My problem is retrieving the column names from a DataProvider,
I know its a collection of Objects (HashMap style) but I couldnt find a 
way to get the names of the columns, just their values
please advice,
Thanks
Jo




[flexcoders] Send an object via an ItemRenderer in a DataGrid

2009-02-25 Thread yossi.baram
Hi helper,
In my columns I call my ItemRenderer cellValueRenderer

rendererProvider = new AdvancedDataGridRendererProvider();
rendererProvider.columnIndex=2;
rendererProvider.renderer= new ClassFactory(cellValueRenderer); 
rendererProvider.dataField='col1';

advancedDataGrid.rendererProviders.push(rendererProvider);

I need to send to this renderer and object with properties, to enable 
me use them when I override data() function.

Can It be done?
The only info exposed to me in the renderer is the dataprovider and 
column name  id.


Thanks a lot

Jo



[flexcoders] Building a collection in Java to be set in a DataGrid using blazeds

2009-02-25 Thread yossi.baram
Hi,
I am playing around with remoteObject and displaying string by remote 
using java class.
I need to create a DataGrid and the provider I need to set from my Java 
class, that means an Array of some sort,
using resultHandler(evt:ResultEvent) i think,

Can you help me here?

Thanks a lot



[flexcoders] Re: Send an object via an ItemRenderer in a DataGrid

2009-02-25 Thread yossi.baram
--- In flexcoders@yahoogroups.com, Johannes Nel johannes@... 
wrote:

Thanks man,
Where do i place my variable exactly?
I created the instance:
var renderer:IFactory= new ClassFactory(cellValueRenderer);

my cellValueRenderer contains in its constructor a string let say,
how d I set it in my renderer instance?
This is realy easy I guess, just missed that,
thanks


 instead of passing a class factory to the render pass an instance of
 ifactory, passing the needed variables to the constructer of your 
custom
 factory. then in newInstance of your ifactory set the needed 
variables on
 that new instance. remember that your renderers will get reused, so
 newInstance will not be called during the same invalidation cycles 
as set
 data.
 
 On Wed, Feb 25, 2009 at 3:19 PM, yossi.baram yossi.ba...@... 
wrote:
 
Hi helper,
  In my columns I call my ItemRenderer cellValueRenderer
 
  rendererProvider = new AdvancedDataGridRendererProvider();
  rendererProvider.columnIndex=2;
  rendererProvider.renderer= new ClassFactory(cellValueRenderer);
  rendererProvider.dataField='col1';
 
  advancedDataGrid.rendererProviders.push(rendererProvider);
 
  I need to send to this renderer and object with properties, to 
enable
  me use them when I override data() function.
 
  Can It be done?
  The only info exposed to me in the renderer is the dataprovider 
and
  column name  id.
 
  Thanks a lot
 
  Jo
 
   
 
 
 
 
 -- 
 j:pn
 \\no comment





[flexcoders] Re: Send an object via an ItemRenderer in a DataGrid

2009-02-25 Thread yossi.baram
Ok I got it, just using the properties function,
Thanks man

--- In flexcoders@yahoogroups.com, yossi.baram yossi.ba...@... 
wrote:

 --- In flexcoders@yahoogroups.com, Johannes Nel johannes.nel@ 
 wrote:
 
 Thanks man,
 Where do i place my variable exactly?
 I created the instance:
 var renderer:IFactory= new ClassFactory(cellValueRenderer);
 
 my cellValueRenderer contains in its constructor a string let say,
 how d I set it in my renderer instance?
 This is realy easy I guess, just missed that,
 thanks
 
 
  instead of passing a class factory to the render pass an instance 
of
  ifactory, passing the needed variables to the constructer of your 
 custom
  factory. then in newInstance of your ifactory set the needed 
 variables on
  that new instance. remember that your renderers will get reused, 
so
  newInstance will not be called during the same invalidation 
cycles 
 as set
  data.
  
  On Wed, Feb 25, 2009 at 3:19 PM, yossi.baram yossi.baram@ 
 wrote:
  
 Hi helper,
   In my columns I call my ItemRenderer cellValueRenderer
  
   rendererProvider = new AdvancedDataGridRendererProvider();
   rendererProvider.columnIndex=2;
   rendererProvider.renderer= new ClassFactory(cellValueRenderer);
   rendererProvider.dataField='col1';
  
   advancedDataGrid.rendererProviders.push(rendererProvider);
  
   I need to send to this renderer and object with properties, to 
 enable
   me use them when I override data() function.
  
   Can It be done?
   The only info exposed to me in the renderer is the dataprovider 
 and
   column name  id.
  
   Thanks a lot
  
   Jo
  

  
  
  
  
  -- 
  j:pn
  \\no comment
 





[flexcoders] Creating a DataProvider by dynamic loading

2009-02-24 Thread yossi.baram
Hi helper,
I have a DataGrid and I need to feed its DataProvider dynamically,
I have difficulties doing that.

my columns:
var columns:ArrayCollection = new ArrayCollection();
columns.addItem(parent);  
columns.addItem(cell1);
columns.addItem(date);
columns.addItem(cell2);


and differnt data for each row.

How do I set all this columns and data (that need to be feed into 
ArrayCollections as well) into a main ArrayCollection
that will have the following structure?

parent:'root1',col1:100,date:myObject[0],col2:33
parent:'root1',col1:5,date:myObject[1],col2:21
parent:'root2',col1:11,date:myObject[2],col2:5


Here the column name and values are static, I need all to be dynamic,
to be sent to the DataGrid as the DataProvider,

Thanks

Jo










[flexcoders] Re: Creating a DataProvider by dynamic loading

2009-02-24 Thread yossi.baram
Thanks man,

I am doing something like you mensioned for columns,
my problem is the dataprovider itself that I set to the DataGrid.
Can I set it dynamically without the need to set
columnName:columnValue statically?
To be clear :)
My current dataprovider is set accornigly in an Array:
{parent:'root1',col1:100,date:myObject[0],col2:33},
{parent:'root1',col1:5,date:myObject[1],col2:21},
{parent:'root2',col1:11,date:myObject[2],col2:5}


I need to build it dymanically because the column names(the ones 
before the semicolon) can be different and as I said I get them and 
the values(objects) from Arrays.

Thanks again

Jo



--- In flexcoders@yahoogroups.com, bhaq1972 mbha...@... wrote:

 If you want to add columns dynamically, you need something like this
 
 var colNum:int=5
 for(var i:int=0;icolNum;i++)
 {
   var col:DataGridColumn = new DataGridColumn();
   col.dataField = some value1;
   col.headerText = some value2;
   
   myDataGrid.columns.push(col);
 }
 you'd then generate your dataProvider (could be an ArrayCollection, 
 Array, XML, whatever)
 myDataGrid.dataProvider = myDataProvider;
 
 hope this helps
 bh
 
 
 --- In flexcoders@yahoogroups.com, yossi.baram yossi.baram@ 
 wrote:
 
  Hi helper,
  I have a DataGrid and I need to feed its DataProvider dynamically,
  I have difficulties doing that.
  
  my columns:
  var columns:ArrayCollection = new ArrayCollection();
  columns.addItem(parent);  
  columns.addItem(cell1);
  columns.addItem(date);
  columns.addItem(cell2);
  
  
  and differnt data for each row.
  
  How do I set all this columns and data (that need to be feed into 
  ArrayCollections as well) into a main ArrayCollection
  that will have the following structure?
  
  parent:'root1',col1:100,date:myObject[0],col2:33
  parent:'root1',col1:5,date:myObject[1],col2:21
  parent:'root2',col1:11,date:myObject[2],col2:5
  
  
  Here the column name and values are static, I need all to be 
 dynamic,
  to be sent to the DataGrid as the DataProvider,
  
  Thanks
  
  Jo
 





[flexcoders] Re: Creating a DataProvider by dynamic loading

2009-02-24 Thread yossi.baram
Hi man,
I am very sorry to say that I was not clear :(
myArray is what I need to create, I dont have it (I just gave as 
example of what I need to create).
This is basically my problem,
How to build it based on column array and on data array?
Only then I will assign it to the DataGrid

Thanks for your time, realy

--- In flexcoders@yahoogroups.com, bhaq1972 mbha...@... wrote:

  Can I set it dynamically without the need to set
  columnName:columnValue statically?
 
 Sorry i'm a bit unclear. Another suggestion ...
 
 You want to create DatgridColumns based on whats in the 
DataProvider.
 
 If your dataProvider Array is something like the following
 
 var myArray:Array = 
 [{parent:'root1',col1:100,date:myObject[0],col2:33},
  {parent:'root1',col1:5,date:myObject[1],col2:21},
  {parent:'root2',col1:11,date:myObject[2],col2:5}];
 
 then why not do something like this
 var row:Object = myArray[0];
 
 for(var obj1:Object in row)
 {
   var col:DataGridColumn = new DataGridColumn();
   col.dataField = obj1;
 }
 
 
 
 --- In flexcoders@yahoogroups.com, yossi.baram yossi.baram@ 
 wrote:
 
  Thanks man,
  
  I am doing something like you mensioned for columns,
  my problem is the dataprovider itself that I set to the DataGrid.
  Can I set it dynamically without the need to set
  columnName:columnValue statically?
  To be clear :)
  My current dataprovider is set accornigly in an Array:
  {parent:'root1',col1:100,date:myObject[0],col2:33},
  {parent:'root1',col1:5,date:myObject[1],col2:21},
  {parent:'root2',col1:11,date:myObject[2],col2:5}
  
  
  I need to build it dymanically because the column names(the ones 
  before the semicolon) can be different and as I said I get them 
and 
  the values(objects) from Arrays.
  
  Thanks again
  
  Jo
  
  
  
  --- In flexcoders@yahoogroups.com, bhaq1972 mbhaque@ wrote:
  
   If you want to add columns dynamically, you need something like 
 this
   
   var colNum:int=5
   for(var i:int=0;icolNum;i++)
   {
 var col:DataGridColumn = new DataGridColumn();
 col.dataField = some value1;
 col.headerText = some value2;
 
 myDataGrid.columns.push(col);
   }
   you'd then generate your dataProvider (could be an 
 ArrayCollection, 
   Array, XML, whatever)
   myDataGrid.dataProvider = myDataProvider;
   
   hope this helps
   bh
   
   
   --- In flexcoders@yahoogroups.com, yossi.baram yossi.baram@ 
   wrote:
   
Hi helper,
I have a DataGrid and I need to feed its DataProvider 
 dynamically,
I have difficulties doing that.

my columns:
var columns:ArrayCollection = new ArrayCollection();
columns.addItem(parent);  

columns.addItem(cell1);
columns.addItem(date);
columns.addItem(cell2);


and differnt data for each row.

How do I set all this columns and data (that need to be feed 
 into 
ArrayCollections as well) into a main ArrayCollection
that will have the following structure?

parent:'root1',col1:100,date:myObject[0],col2:33
parent:'root1',col1:5,date:myObject[1],col2:21
parent:'root2',col1:11,date:myObject[2],col2:5


Here the column name and values are static, I need all to be 
   dynamic,
to be sent to the DataGrid as the DataProvider,

Thanks

Jo
   
  
 





[flexcoders] Re: Creating a DataProvider by dynamic loading

2009-02-24 Thread yossi.baram
Hi man,
I am very sorry to say that I was not clear :(
myArray is what I need to create, I dont have it (I just gave as 
example of what I need to create).
This is basically my problem,
How to build it based on column array and on data array?
Only then I will assign it to the DataGrid

Thanks for your time, realy

--- In flexcoders@yahoogroups.com, bhaq1972 mbha...@... wrote:

  Can I set it dynamically without the need to set
  columnName:columnValue statically?
 
 Sorry i'm a bit unclear. Another suggestion ...
 
 You want to create DatgridColumns based on whats in the 
DataProvider.
 
 If your dataProvider Array is something like the following
 
 var myArray:Array = 
 [{parent:'root1',col1:100,date:myObject[0],col2:33},
  {parent:'root1',col1:5,date:myObject[1],col2:21},
  {parent:'root2',col1:11,date:myObject[2],col2:5}];
 
 then why not do something like this
 var row:Object = myArray[0];
 
 for(var obj1:Object in row)
 {
   var col:DataGridColumn = new DataGridColumn();
   col.dataField = obj1;
 }
 
 
 
 --- In flexcoders@yahoogroups.com, yossi.baram yossi.baram@ 
 wrote:
 
  Thanks man,
  
  I am doing something like you mensioned for columns,
  my problem is the dataprovider itself that I set to the DataGrid.
  Can I set it dynamically without the need to set
  columnName:columnValue statically?
  To be clear :)
  My current dataprovider is set accornigly in an Array:
  {parent:'root1',col1:100,date:myObject[0],col2:33},
  {parent:'root1',col1:5,date:myObject[1],col2:21},
  {parent:'root2',col1:11,date:myObject[2],col2:5}
  
  
  I need to build it dymanically because the column names(the ones 
  before the semicolon) can be different and as I said I get them 
and 
  the values(objects) from Arrays.
  
  Thanks again
  
  Jo
  
  
  
  --- In flexcoders@yahoogroups.com, bhaq1972 mbhaque@ wrote:
  
   If you want to add columns dynamically, you need something like 
 this
   
   var colNum:int=5
   for(var i:int=0;icolNum;i++)
   {
 var col:DataGridColumn = new DataGridColumn();
 col.dataField = some value1;
 col.headerText = some value2;
 
 myDataGrid.columns.push(col);
   }
   you'd then generate your dataProvider (could be an 
 ArrayCollection, 
   Array, XML, whatever)
   myDataGrid.dataProvider = myDataProvider;
   
   hope this helps
   bh
   
   
   --- In flexcoders@yahoogroups.com, yossi.baram yossi.baram@ 
   wrote:
   
Hi helper,
I have a DataGrid and I need to feed its DataProvider 
 dynamically,
I have difficulties doing that.

my columns:
var columns:ArrayCollection = new ArrayCollection();
columns.addItem(parent);  

columns.addItem(cell1);
columns.addItem(date);
columns.addItem(cell2);


and differnt data for each row.

How do I set all this columns and data (that need to be feed 
 into 
ArrayCollections as well) into a main ArrayCollection
that will have the following structure?

parent:'root1',col1:100,date:myObject[0],col2:33
parent:'root1',col1:5,date:myObject[1],col2:21
parent:'root2',col1:11,date:myObject[2],col2:5


Here the column name and values are static, I need all to be 
   dynamic,
to be sent to the DataGrid as the DataProvider,

Thanks

Jo
   
  
 





[flexcoders] Re: Creating a DataProvider by dynamic loading

2009-02-24 Thread yossi.baram
Hi,

This is my columns:

var columns:ArrayCollection = new ArrayCollection();
columns.addItem(parent);  
columns.addItem(cell1);
columns.addItem(cell2);
columns.addItem(dummy);


let say 3 rows:

var data_:ArrayCollection = new ArrayCollection;

rowData_ = new Map();
rowData_.put(columns[0],root1);
rowData_.put(columns[1],55);
rowData_.put(columns[2],100);
rowData_.put(columns[3],myObject[0]);
data_.addItem(rowData_);

rowData_ = new Map();
rowData_.put(columns[0],root1);
rowData_.put(columns[1],34);
rowData_.put(columns[2],10);
rowData_.put(columns[3],myObject[1]);
data_.addItem(rowData_);

rowData_ = new Map();
rowData_.put(columns[0],root1);
rowData_.put(columns[1],6);
rowData_.put(columns[2],60);
rowData_.put(columns[3],myObject[2]);
data_.addItem(rowData_);


My Map (which is a HashMap):

package

{

import flash.utils.Dictionary;



public class Map

{

private var keysList:Array = new Array();
  

private var valuesList:Array = new Array();


private var entries:Dictionary = new Dictionary();


public function Map(){

}


public function get length():uint

{

return valuesList.length;

}
   

public function get(key:Object):Object

{

return entries[key];

}

public function getKeyAt(index:uint):Object

{

return keysList[index];

}   

public function getKeysList():Array

{

return keysList.slice();

}

 
public function getValueAt(index:uint):Object

{

return valuesList[index];

}


public function getValuesList():Array

{

return valuesList.slice();

}


public function put(key:Object, value:Object):void

{

entries[key] = value;

keysList.push(key);

valuesList.push(value);

}
   

public function remove(key:Object):void

{

delete entries[key];



var index:int = keysList.indexOf(key);

if (index  -1)

{

keysList.splice(index, 1);

valuesList.splice(index, 1);

}

}

}

} 


The result is data_ ArrayCollection that holds a list of column/value 
hashmap which is good.

How do I take this array and translate it to a dataProvider for the 
DataGrid, or set it differently to the grid?

Thanks man




--- In flexcoders@yahoogroups.com, bhaq1972 mbha...@... wrote:

  Thanks for your time, realy
 
 thats okay. Can you send an example of column array and data array? 
 
  
 
 --- In flexcoders@yahoogroups.com, yossi.baram yossi.baram@ 
 wrote:
 
  Hi man,
  I am very sorry to say that I was not clear :(
  myArray is what I need to create, I dont have it (I just gave as 
  example of what I need to create).
  This is basically my problem,
  How to build it based on column array and on data array?
  Only then I will assign it to the DataGrid
  
  Thanks for your time, realy
  
  --- In flexcoders@yahoogroups.com, bhaq1972 mbhaque@ wrote:
  
Can I set it dynamically without the need to set
columnName:columnValue statically?
   
   Sorry i'm a bit unclear. Another suggestion ...
   
   You want to create DatgridColumns based on whats in the 
  DataProvider.
   
   If your dataProvider Array is something like the following
   
   var myArray:Array = 
   [{parent:'root1',col1:100,date:myObject[0],col2:33},
{parent:'root1',col1:5,date:myObject[1],col2:21},
{parent:'root2',col1:11,date:myObject[2],col2:5}];
   
   then why not do something like this
   var row:Object = myArray[0];
   
   for(var obj1:Object in row)
   {
 var col:DataGridColumn = new DataGridColumn();
 col.dataField = obj1;
   }
   
   
   
   --- In flexcoders@yahoogroups.com, yossi.baram yossi.baram@ 
   wrote:
   
Thanks man,

I am doing something like you mensioned for columns,
my problem is the dataprovider itself that I set to the 
 DataGrid.
Can I set it dynamically without the need to set
columnName:columnValue statically?
To be clear :)
My current dataprovider is set accornigly in an Array:
{parent:'root1',col1:100,date:myObject[0],col2:33},
{parent:'root1',col1:5,date:myObject[1],col2:21},
{parent:'root2',col1:11,date:myObject[2],col2:5}


I need to build it dymanically because the column names(the 
ones 
before the semicolon) can be different and as I said I get 
them 
  and 
the values(objects) from Arrays.

Thanks again

Jo



--- In flexcoders@yahoogroups.com, bhaq1972 mbhaque@ 
wrote:

 If you want to add columns dynamically, you need something 
 like 
   this
 
 var colNum:int=5

[flexcoders] Re: Creating a DataProvider by dynamic loading

2009-02-24 Thread yossi.baram
Thanks any way...

--- In flexcoders@yahoogroups.com, bhaq1972 mbha...@... wrote:

 Not sure, i'll have a play around.
 Maybe someone else can take a look.
 
 
 --- In flexcoders@yahoogroups.com, yossi.baram yossi.baram@ 
 wrote:
 
  Hi,
  
  This is my columns:
  
  var columns:ArrayCollection = new ArrayCollection();
  columns.addItem(parent);  
  columns.addItem(cell1);
  columns.addItem(cell2);
  columns.addItem(dummy);
  
  
  let say 3 rows:
  
  var data_:ArrayCollection = new ArrayCollection;
  
  rowData_ = new Map();
  rowData_.put(columns[0],root1);
  rowData_.put(columns[1],55);
  rowData_.put(columns[2],100);
  rowData_.put(columns[3],myObject[0]);
  data_.addItem(rowData_);
  
  rowData_ = new Map();
  rowData_.put(columns[0],root1);
  rowData_.put(columns[1],34);
  rowData_.put(columns[2],10);
  rowData_.put(columns[3],myObject[1]);
  data_.addItem(rowData_);
  
  rowData_ = new Map();
  rowData_.put(columns[0],root1);
  rowData_.put(columns[1],6);
  rowData_.put(columns[2],60);
  rowData_.put(columns[3],myObject[2]);
  data_.addItem(rowData_);
  
  
  My Map (which is a HashMap):
  
  package
  
  {
  
  import flash.utils.Dictionary;
  
  
  
  public class Map
  
  {
  
  private var keysList:Array = new Array();

  
  private var valuesList:Array = new Array();
  
  
  private var entries:Dictionary = new Dictionary();
  
  
  public function Map(){
  
  }
  
  
  public function get length():uint
  
  {
  
  return valuesList.length;
  
  }
 
  
  public function get(key:Object):Object
  
  {
  
  return entries[key];
  
  }
  
  public function getKeyAt(index:uint):Object
  
  {
  
  return keysList[index];
  
  }   
  
  public function getKeysList():Array
  
  {
  
  return keysList.slice();
  
  }
  
   
  public function getValueAt(index:uint):Object
  
  {
  
  return valuesList[index];
  
  }
  
  
  public function getValuesList():Array
  
  {
  
  return valuesList.slice();
  
  }
  
  
  public function put(key:Object, value:Object):void
  
  {
  
  entries[key] = value;
  
  keysList.push(key);
  
  valuesList.push(value);
  
  }
 
  
  public function remove(key:Object):void
  
  {
  
  delete entries[key];
  
  
  
  var index:int = keysList.indexOf(key);
  
  if (index  -1)
  
  {
  
  keysList.splice(index, 1);
  
  valuesList.splice(index, 1);
  
  }
  
  }
  
  }
  
  } 
  
  
  The result is data_ ArrayCollection that holds a list of 
 column/value 
  hashmap which is good.
  
  How do I take this array and translate it to a dataProvider for 
the 
  DataGrid, or set it differently to the grid?
  
  Thanks man
  
  
  
  
  --- In flexcoders@yahoogroups.com, bhaq1972 mbhaque@ wrote:
  
Thanks for your time, realy
   
   thats okay. Can you send an example of column array and data 
 array? 
   

   
   --- In flexcoders@yahoogroups.com, yossi.baram yossi.baram@ 
   wrote:
   
Hi man,
I am very sorry to say that I was not clear :(
myArray is what I need to create, I dont have it (I just gave 
as 
example of what I need to create).
This is basically my problem,
How to build it based on column array and on data array?
Only then I will assign it to the DataGrid

Thanks for your time, realy

--- In flexcoders@yahoogroups.com, bhaq1972 mbhaque@ 
wrote:

  Can I set it dynamically without the need to set
  columnName:columnValue statically?
 
 Sorry i'm a bit unclear. Another suggestion ...
 
 You want to create DatgridColumns based on whats in the 
DataProvider.
 
 If your dataProvider Array is something like the following
 
 var myArray:Array = 
 [{parent:'root1',col1:100,date:myObject[0],col2:33},
  {parent:'root1',col1:5,date:myObject[1],col2:21},
  {parent:'root2',col1:11,date:myObject[2],col2:5}];
 
 then why not do something like this
 var row:Object = myArray[0];
 
 for(var obj1:Object in row)
 {
   var col:DataGridColumn = new DataGridColumn();
   col.dataField = obj1;
 }
 
 
 
 --- In flexcoders@yahoogroups.com, yossi.baram 
 yossi.baram@ 
 wrote:
 
  Thanks man,
  
  I am doing something like you mensioned for columns,
  my problem is the dataprovider itself that I set to the 
   DataGrid.
  Can I set it dynamically without the need to set
  columnName:columnValue statically

[flexcoders] Re: Creating a DataProvider by dynamic loading

2009-02-24 Thread yossi.baram
Hi Gary,
Thanks for your reply,
I just need a dynamic mechanism that creates this

{parent:'root1',col1:100,date:myObject[0],col2:33},
{parent:'root1',col1:5,date:myObject[1],col2:21},
{parent:'root2',col1:11,date:myObject[2],col2:5}

dynamically.

I have the columns array and all the data in a list of arrays(look at 
the previous posts i sent)
In short, I need to create the dataprovider dynamically, some kind of 
routine that accumulate columnName and append : and objectValue 
with comma etc.

Thanks



--- In flexcoders@yahoogroups.com, Gary Wall g...@... wrote:

 On Tuesday 24 February 2009 12:09:05 yossi.baram wrote:
  I am doing something like you mensioned for columns,
  my problem is the dataprovider itself that I set to the DataGrid.
  Can I set it dynamically without the need to set
  columnName:columnValue statically?
  To be clear :)
  My current dataprovider is set accornigly in an Array:
  {parent:'root1',col1:100,date:myObject[0],col2:33},
  {parent:'root1',col1:5,date:myObject[1],col2:21},
  {parent:'root2',col1:11,date:myObject[2],col2:5}
 
 
  I need to build it dymanically because the column names(the ones
  before the semicolon) can be different and as I said I get them 
and
  the values(objects) from Arrays.
 
 If I'm understanding you correctly, you mean that your column names 
might be 
 different, like this?
 
 [
 { colA: valA, colB: valB },
 { colA: valA, colC: valC },
 { colA: valA, colD: valD },
 ]
 
 If so, logic suggests that you would have to normalise the 
ArrayCollection 
 before providing it as a dataProvider, like this (whitespace added 
for 
 readability):
 
 [
 { colA: valA,   colB: valB,   colC: ,  colD:  },
 { colA: valA,   colB: ,  colC: valC,   colD:  },
 { colA: valA,   colB: ,  colC: ,  
colD: valD },
 ]
 
 Then you can skip declaring and adding DataGridColumns seperately 
and just 
 feed the ArrayCollection to the dataProvider.
 
 Hope this helps.
 
 Cheers,
 //gary





[flexcoders] Re: Creating a DataProvider by dynamic loading

2009-02-24 Thread yossi.baram
You are great
Thanks man, it works like a charm :)

--- In flexcoders@yahoogroups.com, bhaq1972 mbha...@... wrote:

 Hi jo
 
 I've had a little play around with what you gave and came up with 
the 
 following example. Let us know if this is what you want.
 
 ?xml version=1.0 encoding=utf-8?
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
   mx:Script
   ![CDATA[
  import mx.controls.dataGridClasses.DataGridColumn;
  import mx.collections.ArrayCollection;
  import mx.collections.IList;
   
   public function startUP():void
   {
 var myObject:Object = {0:0, 1:1, 2:2}
   
 var columns:ArrayCollection = new ArrayCollection();
 columns.addItem(parent);
 columns.addItem(cell1);
 columns.addItem(cell2);
 columns.addItem(dummy);
   
 //create columns  
 var colArray1:Array = [];
 for(var i:int=0;icolumns.length;i++)
 {
   var dgCol:DataGridColumn = new DataGridColumn();
   dgCol.dataField = columns[i];
   colArray1.push(dgCol);
 }
   
 dg.columns = colArray1;   
   
 //let say 3 rows:
 var data_:ArrayCollection = new ArrayCollection;
 var rowData_:Map;
   
 rowData_ = new Map();
 rowData_.put(columns[0],root1);
 rowData_.put(columns[1],55);
 rowData_.put(columns[2],100);
 rowData_.put(columns[3],myObject[0]);
 data_.addItem(rowData_);
   
 rowData_ = new Map();
 rowData_.put(columns[0],root1);
 rowData_.put(columns[1],34);
 rowData_.put(columns[2],10);
 rowData_.put(columns[3],myObject[1]);
 data_.addItem(rowData_);
   
 rowData_ = new Map();
 rowData_.put(columns[0],root1);
 rowData_.put(columns[1],6);
 rowData_.put(columns[2],60);
 rowData_.put(columns[3],myObject[2]);
 data_.addItem(rowData_);
 
 // set dg dataProvider
 var dp1:Array = [];
 var obj1:Object;
   
 for(var j:int=0;jdata_.length;j++)
 {
   var map:Map = data_.getItemAt(j) as Map;
   var meme:Object;
   obj1 = {};
   
   for(var k:int=0;kdg.columnCount;k++)
   {
   meme = dg.columns[k].dataField; 

   obj1[meme.valueOf()] = map.getValueAt(k);
   }
   

   dp1.push(obj1);
 }
   
 dg.dataProvider = dp1;
 }
 ]]
 /mx:Script
 mx:DataGrid id=dg initialize=startUP()/
 /mx:Application





[flexcoders] How do I enable a value id datagrid cell to be linked

2009-02-22 Thread yossi.baram
Hi guys,
I need some cells in my datagrid to enable navigation to a url 
I specify.
I create all my columns in an ActionScript.
How do I do it in my ItemRenderer?
I looked at the AdvancedDataGridColumn API and couldnt find anything 
regards column link (hyperLink) all I see is LinkButton, which is not 
relevant to a datagrid isnt it?

Thanks



[flexcoders] Re: How do I enable a value id datagrid cell to be linked

2009-02-22 Thread yossi.baram
Well again,
As I guessed LinkButton is the right way,

Thanks 

--- In flexcoders@yahoogroups.com, yossi.baram yossi.ba...@... 
wrote:

 Hi guys,
 I need some cells in my datagrid to enable navigation to a url 
 I specify.
 I create all my columns in an ActionScript.
 How do I do it in my ItemRenderer?
 I looked at the AdvancedDataGridColumn API and couldnt find anything 
 regards column link (hyperLink) all I see is LinkButton, which is not 
 relevant to a datagrid isnt it?
 
 Thanks





[flexcoders] Re: Eliminating Horizontal scroll on AdvancedDataGridColumn

2009-02-22 Thread yossi.baram
Thanks,
The thing that bothers me is when the grid first displayed it has 
horizontal scrollbars on some columns, but when I click on the 
vertical lines between the columns it dissapear for all columns and 
doesnt appear again,voodoo,
why is that?


--- In flexcoders@yahoogroups.com, Amy amyblankens...@... wrote:

 --- In flexcoders@yahoogroups.com, yossi.baram yossi.baram@ 
 wrote:
 
  Hi,
  How do I eliminate horizontal scroll on AdvacedDataGrid columns?
  If I set horizontalScrollPolicy='off' to the datagrid it 
eliminates 
 the 
  scroll for all grid, I need the same thing but for each of the 
 columns.
  I build the columns dynamicaly in my AC
  
  var column:AdvancedDataGridColumn = new AdvancedDataGridColumn();
  column.width=100;
  columns.addItem(column);
  column.headerText = 'xxx';
  column.dataField = 'test';
 
 Containers are really too heavy to be using as itemRenderers 
anyway...





[flexcoders] Re: call an ActionScript function from ActionScript

2009-02-22 Thread yossi.baram
Hi Jeffry,
Yep, with some of the methodes,
others are static, so I didnt have to instansiate

Thanks
--- In flexcoders@yahoogroups.com, Jeffry Houser j...@... wrote:

 
  A few thoughts:
 
  Usually you have to import the class, create an instance of it and 
all 
 the method from the instance.  Did you do any of that?
 
  As an aside, functions are not bindable, except for get / set 
functions
 yossi.baram wrote:
  Hi guys,
 
  I have the following ActionScript file:
  [Bindable]
  public function callJavaScript():void {
  ExternalInterface.call(sayString, Hello World, from 
  ActionScript);
  }
 
 
  When I try to call callJavaScript() in a different ActionScript 
class, 
  it gives me a none recognize error :(
 
  I included all AS's in my main mxml file.
 
  How do I allow a function in AS to be shared among all AS's?
 
  Thanks
 
 
 
  
 
  --
  Flexcoders Mailing List
  FAQ: 
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
  Alternative FAQ location: 
https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-
b4cf-1e62079f6847
  Search Archives: http://www.mail-archive.com/flexcoders%
40yahoogroups.comYahoo! Groups Links
 
 
 
 

 
 -- 
 Jeffry Houser, Technical Entrepreneur
 Adobe Community Expert: http://tinyurl.com/684b5h
 http://www.twitter.com/reboog711  | Phone: 203-379-0773
 --
 Easy to use Interface Components for Flex Developers
 http://www.flextras.com?c=104
 --
 http://www.theflexshow.com
 http://www.jeffryhouser.com
 --
 Part of the DotComIt Brain Trust





[flexcoders] Eliminating Horizontal scroll on AdvancedDataGridColumn

2009-02-21 Thread yossi.baram
Hi,
How do I eliminate horizontal scroll on AdvacedDataGrid columns?
If I set horizontalScrollPolicy='off' to the datagrid it eliminates the 
scroll for all grid, I need the same thing but for each of the columns.
I build the columns dynamicaly in my AC

var column:AdvancedDataGridColumn = new AdvancedDataGridColumn();
column.width=100;
columns.addItem(column);
column.headerText = 'xxx';
column.dataField = 'test';

What should I set to the column object to disable scrolling?

Thanks

Jo



[flexcoders] call an ActionScript function from ActionScript

2009-02-21 Thread yossi.baram
Hi guys,

I have the following ActionScript file:
[Bindable]
public function callJavaScript():void {
ExternalInterface.call(sayString, Hello World, from 
ActionScript);
}


When I try to call callJavaScript() in a different ActionScript class, 
it gives me a none recognize error :(

I included all AS's in my main mxml file.

How do I allow a function in AS to be shared among all AS's?

Thanks



[flexcoders] Re: call an ActionScript function from ActionScript

2009-02-21 Thread yossi.baram
Ok I managed,
I just placed the function in an ActionScript class, not a file
and called the instance of that class from the other ActionScript

Thaks any way

--- In flexcoders@yahoogroups.com, yossi.baram yossi.ba...@... 
wrote:

 Hi guys,
 
 I have the following ActionScript file:
 [Bindable]
 public function callJavaScript():void {
 ExternalInterface.call(sayString, Hello World, from 
 ActionScript);
   }
 
 
 When I try to call callJavaScript() in a different ActionScript 
class, 
 it gives me a none recognize error :(
 
 I included all AS's in my main mxml file.
 
 How do I allow a function in AS to be shared among all AS's?
 
 Thanks





[flexcoders] Re: Why cant I use mouseOver() in Image class, but using mx:Image tag, I can?

2009-02-20 Thread yossi.baram
Hi Nate,
Thanks, it works
But I have one problem,
How can I show seperate details for each of the images?
rememver I have one cell that includes several images side by side 
drawn from the loop bellow, and each one need to popup different data 
on a tooltip.


private var tooltipData:String;
override public function set data(value:Object):void {

if (value != null)
 {
removeAllChildren();
for (var i:int = 0; i  value.hair.length; i++){
var img:Image = new Image();  
img.source = value.hair[i].image;  
tooltipData = image -  +i; 
img.percentWidth=value.hair[i].width;   
img.maintainAspectRatio=false;
img.addEventListener(ToolTipEvent.TOOL_TIP_CREATE, 
tooltipDetailCreate);
addChild(img); 
} 
}
}

private function tooltipDetailCreate(event:ToolTipEvent):void { 
var tt:PanelToolTip  = new PanelToolTip(); 
tt.width  = 190; 
tt.height = 100;
tt.bodyText = tooltipData;  
event.toolTip = tt; 
} 


and my PanelToolTip:

?xml version=1.0 encoding=utf-8?
mx:Panel xmlns:mx=http://www.adobe.com/2006/mxml; 
implements=mx.core.IToolTip
width=200 alpha=.8 borderThickness=2 
backgroundColor=white 
dropShadowEnabled=true borderColor=black borderStyle=solid
shadowDistance=10 shadowDirection=right
mx:Script
![CDATA[
[Bindable]
public var bodyText:String = ;


public var _text:String;

public function get text():String {
return _text;
}
public function set text(value:String):void {
}
]]
/mx:Script

mx:Text text={bodyText} percentWidth=100/

/mx:Panel

The result I'm getting now is that I see a tooltip for each of the 
images but with the same data (tooltipData = the last iteration of the 
loop).
How can I set a different data for each of the images.

Thanks a lot for the help :)

Jo 
--- In flexcoders@yahoogroups.com, Nathaniel Skiba nate.sk...@... 
wrote:

 toolTipCreate is an event, so when using AS, you have to use the
 addEventListener function. The following should help:
 
 img.addEventListener(ToolTipEvent.TOOL_TIP_CREATE, myHandlerFunction);
 
 Just remember that you have to import ToolTipEvent, and
 myHandlerFunction has to be a function that takes one argument which 
is
 a ToolTipEvent.
 
 ~Nate





[flexcoders] Re: Why cant I use mouseOver() in Image class, but using mx:Image tag, I can?

2009-02-20 Thread yossi.baram
I think that I need to create a new panel for each image,
let say if I have 3 images in one cell and the event is fired, 
now I get one panel for all with the same data and its not good for 
me, i need 3 panels with different data, 
How do I do it??
Can it be done?

Thanks again

Jo

--- In flexcoders@yahoogroups.com, yossi.baram yossi.ba...@... 
wrote:

 Hi Nate,
 Thanks, it works
 But I have one problem,
 How can I show seperate details for each of the images?
 rememver I have one cell that includes several images side by side 
 drawn from the loop bellow, and each one need to popup different 
data 
 on a tooltip.
 
 
 private var tooltipData:String;
 override public function set data(value:Object):void {
   
 if (value != null)
  {
   removeAllChildren();
   for (var i:int = 0; i  value.hair.length; i++){
   var img:Image = new Image();  
   img.source = value.hair[i].image;  
   tooltipData = image -  +i; 
   img.percentWidth=value.hair[i].width;   

   img.maintainAspectRatio=false;
   img.addEventListener(ToolTipEvent.TOOL_TIP_CREATE, 
 tooltipDetailCreate);
   addChild(img); 
   } 
   }
 }
 
 private function tooltipDetailCreate(event:ToolTipEvent):void { 
   var tt:PanelToolTip  = new PanelToolTip(); 
   tt.width  = 190; 
   tt.height = 100;
   tt.bodyText = tooltipData;  
   event.toolTip = tt; 
 } 
 
 
 and my PanelToolTip:
 
 ?xml version=1.0 encoding=utf-8?
 mx:Panel xmlns:mx=http://www.adobe.com/2006/mxml; 
 implements=mx.core.IToolTip
   width=200 alpha=.8 borderThickness=2 
 backgroundColor=white 
   dropShadowEnabled=true borderColor=black 
borderStyle=solid
   shadowDistance=10 shadowDirection=right
   mx:Script
   ![CDATA[
   [Bindable]
   public var bodyText:String = ;
   
   
   public var _text:String;
   
   public function get text():String {
   return _text;
   }
   public function set text(value:String):void {
   }
   ]]
   /mx:Script
 
   mx:Text text={bodyText} percentWidth=100/
 
 /mx:Panel
 
 The result I'm getting now is that I see a tooltip for each of the 
 images but with the same data (tooltipData = the last iteration of 
the 
 loop).
 How can I set a different data for each of the images.
 
 Thanks a lot for the help :)
 
 Jo 
 --- In flexcoders@yahoogroups.com, Nathaniel Skiba nate.skiba@ 
 wrote:
 
  toolTipCreate is an event, so when using AS, you have to use the
  addEventListener function. The following should help:
  
  img.addEventListener(ToolTipEvent.TOOL_TIP_CREATE, 
myHandlerFunction);
  
  Just remember that you have to import ToolTipEvent, and
  myHandlerFunction has to be a function that takes one argument 
which 
 is
  a ToolTipEvent.
  
  ~Nate
 





[flexcoders] Re: Why cant I use mouseOver() in Image class, but using mx:Image tag, I can?

2009-02-20 Thread yossi.baram
well, i managed doing that :)
Using one panel, I use the currentTarget object of the evevnt allows 
me to retrieve the dataPorvider elements

private function tooltipDetailCreate(event:ToolTipEvent):void { 
var tt:PanelToolTip  = new PanelToolTip();
var innerImage:Object = event.currentTarget; 
tt.width  = 190; 
tt.height = 100; 
tt.bodyText = image source:  + innerImage.source; 
event.toolTip = tt; 
} 

It looks great.
Now I have (of course) one more question.
Every image need to have a unique Key/Value elements in a hashMap.
I know Java but rather new in Flex,
How can I set a hashMap into my ArrayCollection dp?
and what is the attribute I need to set in my panel in order to see 
it in my tooltip?

Thanks again

Jo

--- In flexcoders@yahoogroups.com, yossi.baram yossi.ba...@... 
wrote:

 I think that I need to create a new panel for each image,
 let say if I have 3 images in one cell and the event is fired, 
 now I get one panel for all with the same data and its not good for 
 me, i need 3 panels with different data, 
 How do I do it??
 Can it be done?
 
 Thanks again
 
 Jo
 
 --- In flexcoders@yahoogroups.com, yossi.baram yossi.baram@ 
 wrote:
 
  Hi Nate,
  Thanks, it works
  But I have one problem,
  How can I show seperate details for each of the images?
  rememver I have one cell that includes several images side by 
side 
  drawn from the loop bellow, and each one need to popup different 
 data 
  on a tooltip.
  
  
  private var tooltipData:String;
  override public function set data(value:Object):void {
  
  if (value != null)
   {
  removeAllChildren();
  for (var i:int = 0; i  value.hair.length; i++){
  var img:Image = new Image();  
  img.source = value.hair[i].image;  
  tooltipData = image -  +i; 
  img.percentWidth=value.hair[i].width;   
   
  img.maintainAspectRatio=false;
  img.addEventListener(ToolTipEvent.TOOL_TIP_CREATE, 
  tooltipDetailCreate);
  addChild(img); 
  } 
  }
  }
  
  private function tooltipDetailCreate(event:ToolTipEvent):void { 
  var tt:PanelToolTip  = new PanelToolTip(); 
  tt.width  = 190; 
  tt.height = 100;
  tt.bodyText = tooltipData;  
  event.toolTip = tt; 
  } 
  
  
  and my PanelToolTip:
  
  ?xml version=1.0 encoding=utf-8?
  mx:Panel xmlns:mx=http://www.adobe.com/2006/mxml; 
  implements=mx.core.IToolTip
  width=200 alpha=.8 borderThickness=2 
  backgroundColor=white 
  dropShadowEnabled=true borderColor=black 
 borderStyle=solid
  shadowDistance=10 shadowDirection=right
  mx:Script
  ![CDATA[
  [Bindable]
  public var bodyText:String = ;
  
  
  public var _text:String;
  
  public function get text():String {
  return _text;
  }
  public function set text(value:String):void {
  }
  ]]
  /mx:Script
  
  mx:Text text={bodyText} percentWidth=100/
  
  /mx:Panel
  
  The result I'm getting now is that I see a tooltip for each of 
the 
  images but with the same data (tooltipData = the last iteration 
of 
 the 
  loop).
  How can I set a different data for each of the images.
  
  Thanks a lot for the help :)
  
  Jo 
  --- In flexcoders@yahoogroups.com, Nathaniel Skiba nate.skiba@ 
  wrote:
  
   toolTipCreate is an event, so when using AS, you have to use the
   addEventListener function. The following should help:
   
   img.addEventListener(ToolTipEvent.TOOL_TIP_CREATE, 
 myHandlerFunction);
   
   Just remember that you have to import ToolTipEvent, and
   myHandlerFunction has to be a function that takes one argument 
 which 
  is
   a ToolTipEvent.
   
   ~Nate
  
 





[flexcoders] Why cant I use mouseOver() in Image class, but using mx:Image tag, I can?

2009-02-19 Thread yossi.baram
Hi,
I have a dataGrid, and in one of the columns I call an ItemRenderer 
(ActionScript).
This renderer should create a list of images as follows:
override public function set data(value:Object):void {  
if (value != null)
   {
removeAllChildren();
for (var i:int = 0; i  value.hair.length; i++){
var img:Image = new Image();  
img.source = value.hair[i].image;  
img.id = image -  +i;
img.height = 20;  
img.toolTip=value.hair[i].width;
img.percentWidth=value.hair[i].width; 
img.maintainAspectRatio=false;
addChild(img); 
} 
}
}

All images are displayed side by side in a cell, as I wanted.

The problem is that I need to use img.toolTipCreate to catch an event 
on each of the images and It doesnt let me, why?
If I use mx:Image tag in mxml file, it lets me use this function but 
in my ActionScript it doesnt.

What is the different between this 2?
Thanks for any advice

Jo



[flexcoders] Can I use mouseOver() an image in ActionScript

2009-02-18 Thread yossi.baram
Hi,
I have some images in a DataGrid cells and I need to chatch the event 
when I hover on them.
The images are created in an ItemRenderer AC, so it has to be done 
there, raising an Alert for example.

Thanks



[flexcoders] Re: Can I use mouseOver() an image in ActionScript

2009-02-18 Thread yossi.baram
Hi,
this is rather complicated.
I have a DataGrid, in one of its column I call an ItemRenderer that 
creates a list of colored images side by side.
All I need is to catch the event when I hover over every inner cell 
image (remember, in a cell I have few images, each one should fire 
different event).
How do I trigger a function in my renderer?

My ActionScript renderer:
package
{

import mx.collections.ArrayCollection;
import mx.containers.HBox;
import mx.controls.Image;
import mx.controls.Alert;

public class imageRenderer extends HBox 
{   
public function imageRenderer():void{
super();
this.setStyle(paddingBottom,1);
this.setStyle(paddingTop,1);
this.setStyle(horizontalGap,1);

}
 
// Here I create the colored images I place in HBox in the cell

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

   if (value != null)
{
removeAllChildren();
for (var i:int = 0; i  value.Actual.length; i++){
  var img:Image = new Image();  
  img.source = value.Actual[i].image;  
  img.id = image -  +i;
  img.height = 20;  
//img.toolTip=value.Actual[i].width;
  img.percentWidth=value.Actual[i].width;   
  img.maintainAspectRatio=false;
  addChild(img);
} 
  }
}   
}
}

I dont want to use flex tooltip, I need to place my own and for that 
I need an event for each of the images seperatly.

Thanks for the help

Jo

--- In flexcoders@yahoogroups.com, Jeffry Houser j...@... wrote:

 
  What problems did you have trying to accomplish this? 
 
  Without testing anything, I would expect the DataGrid to 'capture' 
the 
 mouseOver event as opposed to the itemRenderer component.  So, I'd 
 expect you'd need some way to trigger a function in the renderer 
based 
 on the DataGrid mouseOver . 
 
  But, this is just my first guess. 
 
 yossi.baram wrote:
  Hi,
  I have some images in a DataGrid cells and I need to chatch the 
event 
  when I hover on them.
  The images are created in an ItemRenderer AC, so it has to be 
done 
  there, raising an Alert for example.
 
  Thanks

 
 
 -- 
 Jeffry Houser, Technical Entrepreneur
 Adobe Community Expert: http://tinyurl.com/684b5h
 http://www.twitter.com/reboog711  | Phone: 203-379-0773
 --
 Easy to use Interface Components for Flex Developers
 http://www.flextras.com?c=104
 --
 http://www.theflexshow.com
 http://www.jeffryhouser.com
 --
 Part of the DotComIt Brain Trust





[flexcoders] Re: Can I use mouseOver() an image in ActionScript

2009-02-18 Thread yossi.baram
hi,
Please advise.
I realy need to know if I can catch the event when I hoover over the 
cells of the datagrid
and what is the function I should override in my AS to allow me do 
that?
Thanks again




--- In flexcoders@yahoogroups.com, yossi.baram yossi.ba...@... 
wrote:

 Hi,
 this is rather complicated.
 I have a DataGrid, in one of its column I call an ItemRenderer that 
 creates a list of colored images side by side.
 All I need is to catch the event when I hover over every inner cell 
 image (remember, in a cell I have few images, each one should fire 
 different event).
 How do I trigger a function in my renderer?
 
 My ActionScript renderer:
 package
 {
 
   import mx.collections.ArrayCollection;
   import mx.containers.HBox;
   import mx.controls.Image;
   import mx.controls.Alert;
 
   public class imageRenderer extends HBox 
   {   
   public function imageRenderer():void{
   super();
   this.setStyle(paddingBottom,1);
   this.setStyle(paddingTop,1);
   this.setStyle(horizontalGap,1);
 
   }

 // Here I create the colored images I place in HBox in the cell
   
  override public function set data(value:Object):void {
   
  if (value != null)
   {
   removeAllChildren();
   for (var i:int = 0; i  value.Actual.length; i++){
 var img:Image = new Image();  
 img.source = value.Actual[i].image;  
 img.id = image -  +i;
 img.height = 20;  
   //img.toolTip=value.Actual[i].width;
 img.percentWidth=value.Actual[i].width;   
 img.maintainAspectRatio=false;
   addChild(img);  
   } 
 }
   }   
 }
 }
 
 I dont want to use flex tooltip, I need to place my own and for 
that 
 I need an event for each of the images seperatly.
 
 Thanks for the help
 
 Jo
 
 --- In flexcoders@yahoogroups.com, Jeffry Houser jeff@ wrote:
 
  
   What problems did you have trying to accomplish this? 
  
   Without testing anything, I would expect the DataGrid 
to 'capture' 
 the 
  mouseOver event as opposed to the itemRenderer component.  So, 
I'd 
  expect you'd need some way to trigger a function in the renderer 
 based 
  on the DataGrid mouseOver . 
  
   But, this is just my first guess. 
  
  yossi.baram wrote:
   Hi,
   I have some images in a DataGrid cells and I need to chatch the 
 event 
   when I hover on them.
   The images are created in an ItemRenderer AC, so it has to be 
 done 
   there, raising an Alert for example.
  
   Thanks
 
  
  
  -- 
  Jeffry Houser, Technical Entrepreneur
  Adobe Community Expert: http://tinyurl.com/684b5h
  http://www.twitter.com/reboog711  | Phone: 203-379-0773
  --
  Easy to use Interface Components for Flex Developers
  http://www.flextras.com?c=104
  --
  http://www.theflexshow.com
  http://www.jeffryhouser.com
  --
  Part of the DotComIt Brain Trust
 





[flexcoders] How do I use CellRenderer in my AdvancedDataGrid? please help

2009-02-17 Thread yossi.baram
Hi,
I need to implement an ItemRenderer on a specific column,
Inside the column I need to hane an HBox that includs several images,
the data I can take from the DataProvider of the dataGrid.
What is the best way of doing that?
Can you give me small example of using the CellRenderer, because I 
think its the best way,
Thanks a lot
Jo



[flexcoders] Re: How do I use CellRenderer in my AdvancedDataGrid? please help

2009-02-17 Thread yossi.baram
Thanks man,
I created an item renderer for that column and it works like a 
charm :)))


--- In flexcoders@yahoogroups.com, Stephen Gilson smgil...@... 
wrote:

 You can see a bunch of examples here: 
http://livedocs.adobe.com/flex/3/html/help.html?
content=advdatagrid_10.html
 
 Stephen
 
 From: flexcoders@yahoogroups.com 
[mailto:flexcod...@yahoogroups.com] On Behalf Of yossi.baram
 Sent: Tuesday, February 17, 2009 1:41 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] How do I use CellRenderer in my 
AdvancedDataGrid? please help
 
 
 Hi,
 I need to implement an ItemRenderer on a specific column,
 Inside the column I need to hane an HBox that includs several 
images,
 the data I can take from the DataProvider of the dataGrid.
 What is the best way of doing that?
 Can you give me small example of using the CellRenderer, because I
 think its the best way,
 Thanks a lot
 Jo





[flexcoders] How do I get rid of the padding between images layed in HBox?

2009-02-17 Thread yossi.baram
Hi,
I created an ItemRenderer (an ActionScript) that extends HBox,
This renderer creates a list of images I provide, side by side.
The problem is that there is a gap between each image.
How do I eliminate it? I want the images stick to each other with no 
gap,
Please advice

Thanks
Jo



[flexcoders] Re: How do I get rid of the padding between images layed in HBox?

2009-02-17 Thread yossi.baram
Thanks man

--- In flexcoders@yahoogroups.com, Brendan Meutzner bmeutz...@... 
wrote:

 horizontalGap...
 
 
 On Wed, Feb 18, 2009 at 12:35 AM, yossi.baram yossi.ba...@... 
wrote:
 
Hi,
  I created an ItemRenderer (an ActionScript) that extends HBox,
  This renderer creates a list of images I provide, side by side.
  The problem is that there is a gap between each image.
  How do I eliminate it? I want the images stick to each other with 
no
  gap,
  Please advice
 
  Thanks
  Jo
 
   
 
 
 
 
 -- 
 Brendan Meutzner
 http://www.meutzner.com/blog/





[flexcoders] Is it possible to set different width for columns in HorizontalList ?

2009-02-16 Thread yossi.baram
Hi, 
I'm created a new HorizontalList() 
and tried to set different width of its columns (by override set Data
()) 
but its always gives me the same width... 
Can i set the columns width for HorizontalList or is it fixed? 

Thanks 

Jo 




[flexcoders] Re: Is it possible to set different width for columns in HorizontalList ?

2009-02-16 Thread yossi.baram
Great,
Thanks, 
you pointed me to the right direction,
please advise of this 2 crucial issues, if you may :)
1. How do I place a repeater in an AdvacedDataGrid cell/column?
   I need to have a special column in a tree table that contain 
   a set of colored images side by side (the repeater creates it for 
me)
2. How do I eliminate the padding that I get from using a repeater to 
show a list of colored images?

Thanks for all the help

Jo


--- In flexcoders@yahoogroups.com, Alex Harui aha...@... wrote:

 All cells in HorizontalList must be the same size.  If you don't 
have lots of images, just use HBox and Repeater
 
 Alex Harui
 Flex SDK Developer
 Adobe Systems Inc.http://www.adobe.com/
 Blog: http://blogs.adobe.com/aharui
 
 From: flexcoders@yahoogroups.com 
[mailto:flexcod...@yahoogroups.com] On Behalf Of yossi.baram
 Sent: Sunday, February 15, 2009 10:05 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Is it possible to set different width for 
columns in HorizontalList ?
 
 
 Hi,
 I'm created a new HorizontalList()
 and tried to set different width of its columns (by override set 
Data
 ())
 but its always gives me the same width...
 Can i set the columns width for HorizontalList or is it fixed?
 
 Thanks
 
 Jo