[flexcoders] Re: Should I follow this recommendation when it comes to Flex learning curve?

2010-01-20 Thread invertedspear
That recommendation has some merit, but the use of Flex in no way depends on 
HTML, PHP, or CSS (though it helps). Flex is a front-end GUI builder, since it 
uses actionScript it would be helpful to have some background in other 
ecmaScript languages (like javaScript), but it isn't required. 

Flex is limited in being able to connect to Databases and does require a little 
knowledge of php and sql (or whatever your back-end language is) in order to 
get and store data.

I develop in Flex and php, I never used php before October, but it was simple 
to learn enough to connect my Flex app to a database.

I guess what I'm  saying is that your friend is neither right or wrong. It 
really depends on you. Did you learn to swim by starting in the shallow end and 
working your way into the deep? Or did you jump right into the lake?

--- In flexcoders@yahoogroups.com, fred44455 fred44...@... wrote:

 I already know some html and CSS . Should I consider stopping learning Flex 
 getting into PHP and coming back to Flex 3 again?
 The statement below is the recommendation of a friend programmer.
 
 
 I'm a little curious why you're jumping straight into advanced stuff and 
 skipping the basics completely.
 
 Start with HTML and CSS. Those are literally the building blocks of the web. 
 If you don't know them, it doesn't really matter if you understand OOP, 
 because you'll never be able to format the output for the web. Then I'd move 
 on to something like PHP... get a good solid grounding in basic programming 
 logic used on the web. THEN jump into ActionScript/Flash programming and 
 Flex.
 
 You're kind of starting at the wrong end of the progression





[flexcoders] Re: apply style in newly created component

2010-01-15 Thread invertedspear
use the styleName option if your applying a CSS to it:
mychart.styleName = noGutterChart;

--- In flexcoders@yahoogroups.com, Vivian Richard kanps...@... wrote:

 Actually I am trying to apply a very simple style to a chart. My chart is
 inside a
 canvas component and in a separate file. I want to add this chart containing
 canvas in dynamically. This component is like this:
 
 ?xml version=1.0 encoding=utf-8?
 mx:Canvas width .
 mx:ColumnChart  id =myChart
 /mx:ColumnChart
 /mx:Canvas
 
 Now I have this simple styles for the the chart which are:
 
 .noGutterChart {
gutterLeft:0;
gutterBottom:0;
gutterTop:0;
gutterRight:0;
 }
 
 Now as I am trying to create the component dunamically and want to apply
 the
 style to the chart I get the error message.
 
   var myComp:ChartComp = new ChartComp;
   myComp.myChart.setStyle(styleName,noGutterChart);
 
 This gives me the error message that I cannot access a function of a
 null object.



[flexcoders] Re: Change color in itemRender?

2010-01-13 Thread invertedspear
I cannot recommend this tool enough it will help you write the correct CSS to 
do whatever you want:
http://examples.adobe.com/flex3/consulting/styleexplorer/Flex3StyleExplorer.html#

--- In flexcoders@yahoogroups.com, markflex2007 markflex2...@... wrote:

 Hi,
 
 I try two ways to change a panel board color in a itemRender,both can not 
 work.Please help me.
 
 1
  
  override public function set data( value:Object ) : void {
   super.data = value;
   if( data.borderTitle == room ){
  panel1.setStyle(borderColor,'#ff');
}else{
  panel1.setStyle(borderColor,'#33');
} 
 
  } 
  
  2
  
  mx:Panel id=panel1 layout=vertical title={data.borderTitle} 
 borderColor={data.borderColor} width=100% height=100%   
 ...
  /mx:Panel
 
 Thanks for help
 
 Mark





[flexcoders] Re: ListEvent ItemRollOver columnIndex value is wrong

2010-01-11 Thread invertedspear
I think, but I'm not sure, that when you set your col0 to be invisible, you 
need to also set includedInLayout = true;
~mike

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

 I have an itemRollover event handler in my datagrid. 
 
 This datagrid also has some invisble columns (i made them visible=false 
 during the datagrid's initialize event)
 
 Now if I make col0 invisible, and col1 visible, 
 i.e.
 mx:DataGridColumn dataField=col0 visible=false..
 mx:DataGridColumn dataField=col1 visible=true..
 
 when I try to determine which column i'm rollong over...i'm getting the wrong 
 value
 public function itemRolloverHandler(e:ListEvent):void
 {
   var  myDataField:String = this.columns[e.columnIndex].dataField;
 
 //myDataField=col0 but it should be col1 as col0 is invsible
 }
 Is there anything I can do so e.columnIndex has the right value?
 
 thanks





[flexcoders] Re: Status Code 504 Errors

2010-01-07 Thread invertedspear
504 is a gateway timeout. Do you have problems with your CF server from time to 
time? 

--- In flexcoders@yahoogroups.com, Battershall, Jeff jeff.battersh...@... 
wrote:

 Hi,
 
 I have an AIR app built in Flex that occasionally returns 
 NetConnection.Call.Failed - Error: HTTP Status 504 for certain clients. I'm 
 using CF8 as the backend.
 
 Any advice?
 
 Jeff Battershall
 Application Architect
 Dow Jones Indexes
 jeff.battersh...@...
 (609) 520-5637 (p)
 
 (484) 477-9900 (c)





[flexcoders] Re: XMLListCollection Filter - Viewing a single child branch

2010-01-05 Thread invertedspear
The Flex framework has awesome XML functions, even straight up querying of XML. 
I use this all the time: var myXML:XML = XMLVar.node.node.(@nodeID == 5) which 
will give you just this section of your XML

node nodeId=5
  node nodeId=6
node nodeId=7/
node nodeId=8/
node nodeId=9/
  /node
/node

I'm not sure if this solves your problem exactly, but its pretty powerful stuff.
--- In flexcoders@yahoogroups.com, aaronmfoster aaronmfos...@... wrote:

 I'm glad I got to this before anyone spent their precious time on it. 
 Unfortunately, the problem was not with my code but stemmed from my
 fundamental understanding (or misunderstanding) of an XMLListCollection.
 Turns out XMLListCollections aren't magical gateways into hierarchal
 data.  As far as I can tell, they are essentially flat structures that
 hold a reference to a list.  I'll explain my failed attempt and hope
 that it will help somebody avoid the same mistake.  Here's roughly what
 my data looks like:
 
 node nodeId=1node nodeId=2node nodeId=3/node
 nodeId=4/node nodeId=5node nodeId=6node nodeId=7/node
 nodeId=8/node nodeId=9//nodenode
 nodeId=10//node/node/node
 I was trying to apply the following filter function on the
 XMLListCollection to view a single child branch:
 public function viewBranch(xmlItem:XML):Boolean {return
 xmlItem.descendants()@nodeid == selectedNodeId; // where selectedNodeId
 corresponds to the appropriate nodeId }
 The problem with this is there is only one object in the
 XMLListCollection and it is either filtered out or it is not.   Since
 the single list contains all values for nodeid, any proper value for
 selectedNodeId will result in the entire list being included in the
 view.  Ah well, live and learn.
 I've since moved away from XMLLists, but if anyone has an idea of how to
 perform the original task with XMLListCollections I'd love to hear it.
 Cheers,
 Aaron
 
 --- In flexcoders@yahoogroups.com, aaronmfoster aaronmfoster@
 wrote:
 
  Howdy everyone,
 
  I'm struggling with an XMLListCollection filter function.  My xml is
 similarly structured to this:
 
  node
 node
node/
node/
 /node
 node
node/
node/
 /node
  node
 
  It consists of a root node, with zero or more child nodes.  The child
 nodes could also have zero or more child nodes.  Basically it's your run
 of the mill xml. =P
 
  I'm looking for a filter function which allows me to view a single
 child branch.  In other words filter out all but a particular child node
 and it's children.  Effectively it would turn the view into this:
 
  node
 node/
 node/
  /node
 
  The goal is to keep the original xml unaltered, while creating a view
 of a child node that appears to be the root.  The view will then be
 applied to several components.  Although I've struggled with with it, a
 filter seems like the simplest way to go.  I'd greatly appreciate any
 suggestions.
 
  Thanks,
  Aaron
 





[flexcoders] Re: DateField with multiple input formats

2009-12-30 Thread invertedspear
Dates are always tricky, you could parse the string and determine which section 
is which. 4 chars = year, 12 = day, etc but there will always be problems. 
What happens when a user enters 08/09/10 (or any day month year that leave 
ambiguity. IMO it is better to force the user to use a convention or a picker 
than to try to determine which format they used.

--- In flexcoders@yahoogroups.com, dr_flo_r dr_fl...@... wrote:

 I have an application where the user wants to be able to enter dates or 
 select them from a calendar.  The user wants to be able to enter these dates 
 in more than one format (say /MM/DD or MM/DD/).  Any suggestions as 
 to how I might be able to enable this?
 
 Thanks,
 
 flo





[flexcoders] How can I automatically scroll a VBox when an item is drug near the top or bot?

2009-12-30 Thread invertedspear


I have a VBox containing a bunch of panels. I have implemented dragging and 
dropping but I need to be able to scroll automatically when the item is drug 
near the edge. I am having mixed results. I can get it to work, but not well. 
My example is below. It works if the user bounces their mouse around a little 
near the top or bottom edge, but I want it to work if they just hold the mouse 
there. Any suggestions?

On Mouse down (I'm doing several other things but this is one of them):

VBox(di.parent).addEventListener(MouseEvent.MOUSE_MOVE,autoScrollSection,true,500);

On dragDrop

VBox(evt.currentTarget.parent).removeEventListener(MouseEvent.MOUSE_MOVE, 
autoScrollSection,true);

Here is the autoScroll function:

private function autoScrollSection(evt:MouseEvent):void{
var tempVBox:VBox = VBox(evt.currentTarget);
if(tempVBox.mouseY50){
tempVBox.verticalScrollPosition += -50;
}
if(tempVBox.mouseY int(tempVBox.height-50)){
tempVBox.verticalScrollPosition += +50;
}
}

So if they are within 50px of an edge then it should scroll by 50px. I've 
exaggerated the numbers just to get an affect.




[flexcoders] Re: How can I automatically scroll a VBox when an item is drug near the top or bot?

2009-12-30 Thread invertedspear
Heres how I solved it:

[Bindable] public var timer:Timer = new Timer(50);
private function autoScrollSection(active:Boolean,cont:VBox):void{
if(active){
timer.addEventListener(TimerEvent.TIMER,function():void{
if(cont.mouseY50){
cont.verticalScrollPosition += -20;
}
if(cont.mouseY int(cont.height-50)){
cont.verticalScrollPosition += +20;
}
})
timer.start();
}else{
timer.stop();
}
}

Then changed the calls in mouse down and drag drop to this respectively

autoScrollSection(true,VBox(di.parent));
autoScrollSection(false,VBox(evt.currentTarget.parent));

It works, but feels like a bit of a hack. I welcome any better suggestions.


--- In flexcoders@yahoogroups.com, invertedspear invertedsp...@... wrote:

 
 
 I have a VBox containing a bunch of panels. I have implemented dragging and 
 dropping but I need to be able to scroll automatically when the item is drug 
 near the edge. I am having mixed results. I can get it to work, but not well. 
 My example is below. It works if the user bounces their mouse around a little 
 near the top or bottom edge, but I want it to work if they just hold the 
 mouse there. Any suggestions?
 
 On Mouse down (I'm doing several other things but this is one of them):
 
 VBox(di.parent).addEventListener(MouseEvent.MOUSE_MOVE,autoScrollSection,true,500);
 
 On dragDrop
 
 VBox(evt.currentTarget.parent).removeEventListener(MouseEvent.MOUSE_MOVE, 
 autoScrollSection,true);
 
 Here is the autoScroll function:
 
 private function autoScrollSection(evt:MouseEvent):void{
 var tempVBox:VBox = VBox(evt.currentTarget);
 if(tempVBox.mouseY50){
 tempVBox.verticalScrollPosition += -50;
 }
 if(tempVBox.mouseY int(tempVBox.height-50)){
 tempVBox.verticalScrollPosition += +50;
 }
 }
 
 So if they are within 50px of an edge then it should scroll by 50px. I've 
 exaggerated the numbers just to get an affect.





[flexcoders] Re: Adding a custom UI component as a panel titleIcon.

2009-12-29 Thread invertedspear
Alternatively it would be nice if I could extend the Panel class to allow me to 
add click events to the title area at the top, but I can't find any way of 
making that public so I can do it outside of my custom class, any ideas on 
exposing that protected property?

Thanks

--- In flexcoders@yahoogroups.com, invertedspear invertedsp...@... wrote:

 This should be easy but I'm kind of a newbie.
 
 The concept of this seems easy, but I'm having trouble getting it right and 
 can't find anything to help me on this.
 
 I have a panel I need to perform a drag and drop operation on, but I only 
 want to perform that if the user mouses down on a particular area of the 
 panel. I can add an Icon to the panel by doing this:
 
 **
 [Embed(/img/icon.png)]
 [Bindable]
 public var dragIcon:Class;
 
 newPanel.titleIcon = dragIcon;
 **
 
 But what I really want to add is a box, which I can then add my listeners to 
 for the drag and mouse down like I do on some canvases created in 
 actionscript like so:
 
 **
 var tempBox:Box = new Box;
 tempBox.x=0;
 tempBox.y=0;
 tempBox.width = 20;
 tempBox.height = 44;
 tempBox.setStyle(horizontalAlign,center);
 tempBox.setStyle(verticalAlign,middle);
 tempBox.addEventListener(MouseEvent.ROLL_OVER,over);
 tempBox.addEventListener(MouseEvent.ROLL_OUT,out);
 tempBox.addEventListener(MouseEvent.MOUSE_DOWN,mouseDownAnswer);
 var tempImg:Image = new Image();
 tempImg.source = grabbableItem;
 tempBox.addChild(tempImg);
 myCanvas.addChild(tempBox);
 **
 
 So what do I need to do to use that tempBox and turn it into a class to be 
 used as my panels titleIcon?





[flexcoders] Re: Adding a custom UI component as a panel titleIcon.

2009-12-29 Thread invertedspear
Thanks, would you mind giving me at least a little pseudo code of how to do 
that? I'm completely lost when it comes to extending classes

--- In flexcoders@yahoogroups.com, turbo_vb timh...@... wrote:

 That's exactly what you should do.  To get around the the titleBar add
 the box to rawChildren.
 http://dougr.net/?p=160 http://dougr.net/?p=160
 -TH



[flexcoders] Re: Adding a custom UI component as a panel titleIcon.

2009-12-29 Thread invertedspear
I am adding the box but now it's covering up the normal title text of the 
panel. Any quick fix for that (I'm just adding space to the front of the text 
for the time being)?

--- In flexcoders@yahoogroups.com, turbo_vb timh...@... wrote:

 That's exactly what you should do.  To get around the the titleBar add
 the box to rawChildren.
 http://dougr.net/?p=160 http://dougr.net/?p=160
 -TH
 --- In flexcoders@yahoogroups.com, invertedspear invertedspear@
 wrote:
 
  Alternatively it would be nice if I could extend the Panel class to
 allow me to add click events to the title area at the top, but I can't
 find any way of making that public so I can do it outside of my custom
 class, any ideas on exposing that protected property?
 
  Thanks
 
  --- In flexcoders@yahoogroups.com, invertedspear invertedspear@
 wrote:
  
   This should be easy but I'm kind of a newbie.
  
   The concept of this seems easy, but I'm having trouble getting it
 right and can't find anything to help me on this.
  
   I have a panel I need to perform a drag and drop operation on, but I
 only want to perform that if the user mouses down on a particular area
 of the panel. I can add an Icon to the panel by doing this:
  
   **
   [Embed(/img/icon.png)]
   [Bindable]
   public var dragIcon:Class;
  
   newPanel.titleIcon = dragIcon;
   **
  
   But what I really want to add is a box, which I can then add my
 listeners to for the drag and mouse down like I do on some canvases
 created in actionscript like so:
  
   **
   var tempBox:Box = new Box;
   tempBox.x=0;
   tempBox.y=0;
   tempBox.width = 20;
   tempBox.height = 44;
   tempBox.setStyle(horizontalAlign,center);
   tempBox.setStyle(verticalAlign,middle);
   tempBox.addEventListener(MouseEvent.ROLL_OVER,over);
   tempBox.addEventListener(MouseEvent.ROLL_OUT,out);
   tempBox.addEventListener(MouseEvent.MOUSE_DOWN,mouseDownAnswer);
   var tempImg:Image = new Image();
   tempImg.source = grabbableItem;
   tempBox.addChild(tempImg);
   myCanvas.addChild(tempBox);
   **
  
   So what do I need to do to use that tempBox and turn it into a class
 to be used as my panels titleIcon?
  
 





[flexcoders] Re: Adding a custom UI component as a panel titleIcon.

2009-12-29 Thread invertedspear
I may not be able to sell that to the project manager. Anyway to keep it on the 
left without covering the title?

Thanks, you've helped a lot so far.

--- In flexcoders@yahoogroups.com, turbo_vb timh...@... wrote:

 In updateDispayList() position the box:
 
 tempBox.move( unscaledWidth - tempBox.width - 10, ( unscaledHeight / 2 ) - ( 
 tempBox.height / 2 ) );
 
 This would put it on the right side of the header, minus 10 pixels.
 
 -TH
 
 --- In flexcoders@yahoogroups.com, invertedspear invertedspear@ wrote:
 
  I am adding the box but now it's covering up the normal title text of the 
  panel. Any quick fix for that (I'm just adding space to the front of the 
  text for the time being)?
  
  --- In flexcoders@yahoogroups.com, turbo_vb TimHoff@ wrote:
  
   That's exactly what you should do.  To get around the the titleBar add
   the box to rawChildren.
   http://dougr.net/?p=160 http://dougr.net/?p=160
   -TH
   --- In flexcoders@yahoogroups.com, invertedspear invertedspear@
   wrote:
   
Alternatively it would be nice if I could extend the Panel class to
   allow me to add click events to the title area at the top, but I can't
   find any way of making that public so I can do it outside of my custom
   class, any ideas on exposing that protected property?
   
Thanks
   
--- In flexcoders@yahoogroups.com, invertedspear invertedspear@
   wrote:

 This should be easy but I'm kind of a newbie.

 The concept of this seems easy, but I'm having trouble getting it
   right and can't find anything to help me on this.

 I have a panel I need to perform a drag and drop operation on, but I
   only want to perform that if the user mouses down on a particular area
   of the panel. I can add an Icon to the panel by doing this:

 **
 [Embed(/img/icon.png)]
 [Bindable]
 public var dragIcon:Class;

 newPanel.titleIcon = dragIcon;
 **

 But what I really want to add is a box, which I can then add my
   listeners to for the drag and mouse down like I do on some canvases
   created in actionscript like so:

 **
 var tempBox:Box = new Box;
 tempBox.x=0;
 tempBox.y=0;
 tempBox.width = 20;
 tempBox.height = 44;
 tempBox.setStyle(horizontalAlign,center);
 tempBox.setStyle(verticalAlign,middle);
 tempBox.addEventListener(MouseEvent.ROLL_OVER,over);
 tempBox.addEventListener(MouseEvent.ROLL_OUT,out);
 tempBox.addEventListener(MouseEvent.MOUSE_DOWN,mouseDownAnswer);
 var tempImg:Image = new Image();
 tempImg.source = grabbableItem;
 tempBox.addChild(tempImg);
 myCanvas.addChild(tempBox);
 **

 So what do I need to do to use that tempBox and turn it into a class
   to be used as my panels titleIcon?

   
  
 





[flexcoders] Re: Pie chart with resizable slice ?

2009-12-28 Thread invertedspear
I don't see why you couldn't do this. You would have to use some custom mouse 
events that would change the data in your data provider. Not sure of the 
details but the process would go something like: 

onMouseDown: figure out which pie slice(and which item in the dataprovider) to 
change

onmousemove: calculate the change in mouse position and figure out what it 
would equate to, change dataprovider (which should also immediately change graph

onmouseup: cancel onmousemove

Alternatively you could have them click on the pie slice and then adjust a 
slider, I think it would work better.


--- In flexcoders@yahoogroups.com, Dharmendra chauhan.i...@... wrote:

 Hello All, 
 Is it possible to create a pie chart with re-sizable slice.. ie user should 
 be able to decrease  and increase  the area of any slice by just using mouse 
 drag. If I increase area of any particular slice, other adjacent slice should 
 automatically get reduced.  Please provide me some pointers on this .
 
 Regards,
 Dharmendra





[flexcoders] Adding a custom UI component as a panel titleIcon.

2009-12-28 Thread invertedspear
This should be easy but I'm kind of a newbie.

The concept of this seems easy, but I'm having trouble getting it right and 
can't find anything to help me on this.

I have a panel I need to perform a drag and drop operation on, but I only want 
to perform that if the user mouses down on a particular area of the panel. I 
can add an Icon to the panel by doing this:

**
[Embed(/img/icon.png)]
[Bindable]
public var dragIcon:Class;

newPanel.titleIcon = dragIcon;
**

But what I really want to add is a box, which I can then add my listeners to 
for the drag and mouse down like I do on some canvases created in actionscript 
like so:

**
var tempBox:Box = new Box;
tempBox.x=0;
tempBox.y=0;
tempBox.width = 20;
tempBox.height = 44;
tempBox.setStyle(horizontalAlign,center);
tempBox.setStyle(verticalAlign,middle);
tempBox.addEventListener(MouseEvent.ROLL_OVER,over);
tempBox.addEventListener(MouseEvent.ROLL_OUT,out);
tempBox.addEventListener(MouseEvent.MOUSE_DOWN,mouseDownAnswer);
var tempImg:Image = new Image();
tempImg.source = grabbableItem;
tempBox.addChild(tempImg);
myCanvas.addChild(tempBox);
**

So what do I need to do to use that tempBox and turn it into a class to be used 
as my panels titleIcon?




[flexcoders] Re: mx.controls.Text

2009-12-23 Thread invertedspear
Rather than do it on an interval, which is probably processing way too often, 
why not fire it on an onChange? maybe use the callLater to wait till the frame 
after the change so that the text is guaranteed to already be drawn. CallLater 
works like this:

public function myFunct():void{
callLater(
function():void{
//stuff to do one frame later
}
)
}

It's a great tool

--- In flexcoders@yahoogroups.com, djhatrick djhatr...@... wrote:

 This is interesting, a hack, I created a uiTextField, on my component, and on 
 an interval, check the height of the uiTextField and use the height of the 
 uiTextField to set my text/componenent's height, and it works.
 
 I'm hoping in Flex4, there's a better way to work with Text, although, I'm in 
 a major Flex 3 project, a year long project, so it  might be about 6 months 
 before I take that dive.
 
 Thanks,
 Patrick
 
 --- In flexcoders@yahoogroups.com, invertedspear invertedspear@ wrote:
 
  Not sure exactly what your trying to but might the getBounds() method help 
  you out?
  
  --- In flexcoders@yahoogroups.com, djhatrick djhatrick@ wrote:
  
   is there anyway to find the number of textRows in a TEXT.
   
   I can't seem to get my text to measure properly, it's anywhere between
   5 and 80 pixels off. It's a subject of much frustration, unfortunately, 
   the the Text component has a lot of protected properties. 
   
   Any suggestions on a free component as a replacement, etc.
   
   Thanks,
   Patrick
  
 





[flexcoders] Re: mx.controls.Text

2009-12-22 Thread invertedspear
Not sure exactly what your trying to but might the getBounds() method help you 
out?

--- In flexcoders@yahoogroups.com, djhatrick djhatr...@... wrote:

 is there anyway to find the number of textRows in a TEXT.
 
 I can't seem to get my text to measure properly, it's anywhere between
 5 and 80 pixels off. It's a subject of much frustration, unfortunately, the 
 the Text component has a lot of protected properties. 
 
 Any suggestions on a free component as a replacement, etc.
 
 Thanks,
 Patrick





[flexcoders] Re: Drag and drop, custom cursor during drag not working

2009-12-21 Thread invertedspear
Another topic bump, hoping someone can give me some insight.

--- In flexcoders@yahoogroups.com, invertedspear invertedsp...@... wrote:

 I have a datagrid that I want the user to sort the rows on. To make it 
 obvious that it's sortable I am implementing some custom cursors. But I'm 
 having a problem when I actually drag an item. Can anyone help me out?
 
 Thanks
 
 here's a psuedo demonstration of the problem
 
 Application = normal cursor // fine
 
 Rollover datagrid = open hand cursor // good so far
 
 mousedown on datagrid = closed hand cursor // good
 
 dragging item around = closed hand cursor // switches back to normal cursor 
 (if I move it around real fast I can see my custom curser for an instant)
 
 mouse up on datadrid = open hand cursor // not sure, after I drop it goes 
 back to open hand but if I mouse down, dont move and mouse up I have a closed 
 hand
 
 rollout of datagrid = normal cursor //good
 
 datagrid code:
 
 mx:DataGrid id=sectQuestionsDG x=10 y=204 width=558 height=277 
 headerHeight=0 selectable={editMode}
 dragMoveEnabled={editMode} dragEnabled={editMode} dropEnabled={editMode}
 dragDrop=sectQuestReOrder(event); rollOver=over(); mouseDown=down(); 
 mouseUp=up(); rollOut=out();/
 
 functions:
 
 public function over():void{
 CursorManager.setCursor(grabCursor,CursorManagerPriority.LOW,0,0);
 }
 public function down():void{
 CursorManager.setCursor(grabbingCursor,CursorManagerPriority.HIGH,0,0);
 }
 public function up():void{
 CursorManager.setCursor(grabCursor,CursorManagerPriority.LOW,0,0);
 }
 public function out():void{
 CursorManager.removeAllCursors();
 }





[flexcoders] Re: Drag and drop, custom cursor during drag not working

2009-12-21 Thread invertedspear
I have a bounty on this at stackoverflow.com if you want to get some rep there.

--- In flexcoders@yahoogroups.com, invertedspear invertedsp...@... wrote:

 Another topic bump, hoping someone can give me some insight.
 
 --- In flexcoders@yahoogroups.com, invertedspear invertedspear@ wrote:
 
  I have a datagrid that I want the user to sort the rows on. To make it 
  obvious that it's sortable I am implementing some custom cursors. But I'm 
  having a problem when I actually drag an item. Can anyone help me out?
  
  Thanks
  
  here's a psuedo demonstration of the problem
  
  Application = normal cursor // fine
  
  Rollover datagrid = open hand cursor // good so far
  
  mousedown on datagrid = closed hand cursor // good
  
  dragging item around = closed hand cursor // switches back to normal cursor 
  (if I move it around real fast I can see my custom curser for an instant)
  
  mouse up on datadrid = open hand cursor // not sure, after I drop it goes 
  back to open hand but if I mouse down, dont move and mouse up I have a 
  closed hand
  
  rollout of datagrid = normal cursor //good
  
  datagrid code:
  
  mx:DataGrid id=sectQuestionsDG x=10 y=204 width=558 height=277 
  headerHeight=0 selectable={editMode}
  dragMoveEnabled={editMode} dragEnabled={editMode} 
  dropEnabled={editMode}
  dragDrop=sectQuestReOrder(event); rollOver=over(); mouseDown=down(); 
  mouseUp=up(); rollOut=out();/
  
  functions:
  
  public function over():void{
  CursorManager.setCursor(grabCursor,CursorManagerPriority.LOW,0,0);
  }
  public function down():void{
  CursorManager.setCursor(grabbingCursor,CursorManagerPriority.HIGH,0,0);
  }
  public function up():void{
  CursorManager.setCursor(grabCursor,CursorManagerPriority.LOW,0,0);
  }
  public function out():void{
  CursorManager.removeAllCursors();
  }
 





[flexcoders] Re: Drag and drop, custom cursor during drag not working

2009-12-21 Thread invertedspear
I managed to finally get this one figured out

here is what I had to do:

1)remove the listeners for rollOver, rollOut, and mouseUp from the mxml and add 
rollOver and rollOutthem through the addEventListener method in AS

2) add the listener dragComplete to the mxml and assign the function previously 
assigned to mouseUP to it

3) change the main function to this:

public function over(evt:Event):void{ //on mouse over, added with AS
CursorManager.removeAllCursors();
CursorManager.setCursor(grabCursor,CursorManagerPriority.LOW,-7,-7);
var styleSheet:CSSStyleDeclaration = 
StyleManager.getStyleDeclaration(DragManager);
styleSheet.setStyle(moveCursor,grabbingCursor); //style set for the drag 
cursor
}
public function down(evt:Event):void{ // on mouse down
CursorManager.removeAllCursors();
CursorManager.setCursor(grabbingCursor,CursorManagerPriority.LOW,-7,-7);
sectQuestionsDG.removeEventListener(MouseEvent.ROLL_OVER,over);
sectQuestionsDG.removeEventListener(MouseEvent.ROLL_OUT,out);
//this is why I had to take it off the mxml, can only remove listeners
//added with the addEventListener, I don't remember where I read that.
}
public function up(evt:Event):void{
CursorManager.removeAllCursors();
CursorManager.setCursor(grabCursor,CursorManagerPriority.LOW,-7,-7);
sectQuestionsDG.addEventListener(MouseEvent.ROLL_OVER,over);
sectQuestionsDG.addEventListener(MouseEvent.ROLL_OUT,out);
}
public function out(evt:Event):void{
CursorManager.removeAllCursors();
}




[flexcoders] Re: Drag and drop, custom cursor during drag not working

2009-12-18 Thread invertedspear
Just giving a bump, I keep coming back to this issue.

--- In flexcoders@yahoogroups.com, invertedspear invertedsp...@... wrote:

 OK, That helped a little bit, I'm now doing this on rollOver var 
 styleSheet:CSSStyleDeclaration =
 StyleManager.getStyleDeclaration(DragManager);
 styleSheet.setStyle(moveCursor, grabbingCursor);
 CursorManager.setCursor(grabCursor,CursorManagerPriority.LOW);
 
 This is giving me the correct rollover and correct drag, but if I try to add 
 any function to rollOut it screws up again, so now I'm stuck with the 
 grabCursor. It seems like when I set a rollOut on the dataGrid it's firing 
 for each row, same with mouseOut, is there any way to avoid that?
 ~Thanks
 
 
 
 --- In flexcoders@yahoogroups.com, Chris zomgforeelz@ wrote:
 
  Just a thought, as I haven't tried the method you described. What about
  setting the styles of the cursor on mouse down?
  
  var styleSheet:CSSStyleDeclaration =
  StyleManager.getStyleDeclaration(DragManager);
  styleSheet.setStyle(moveCursor, grabCursor);
  
  or
  
  styleSheet.setStyle(copyCursor, grabCursor);
  
  And you could set it back on mouse up. Just a thought because maybe
  DragManager is setting things back to what it has set in its styles.





[flexcoders] Re: LCDS : jsvc suddenly takes 100% CPU

2009-12-18 Thread invertedspear
I'm not familiar with these log files, but it appears to be repeating a command 
over and over, can you post the section of your code that command is coming 
from?
~Mike

--- In flexcoders@yahoogroups.com, Besite - Bart b...@... wrote:

 Hello,
 
 We are running a Flex/LCDS application in a clustered environment.  We 
 use the Data Management Service
 and the Messaging Service over rtmp channels.
 
 Our application works ok, but sometimes the CPU skyrockets suddenly, we 
 see the jsvc process uses 100% CPU and our Livecycle server hangs..
 
 When the livecycle server hangs, the debug logs start showing the 
 following messages over and over again.
 Apperently there is a deadlock or infinite loop...  what could be the 
 cause of this ? What exactly does this message mean ?
 
 Thanks for your help !
 Bart Ronsyn
 
 Moving: {roomId=983224} from 0 to 1
 [LCDS]12/18/2009 15:13:19.528 [DEBUG] [InternalDataService] Sequence 
 Merge Step 3
 Moving: {roomId=984015} from 0 to 1
 [LCDS]12/18/2009 15:13:19.566 [DEBUG] [InternalDataService] Sequence 
 Merge Step 3
 Moving: {roomId=983224} from 0 to 1
 [LCDS]12/18/2009 15:13:19.528 [DEBUG] [InternalDataService] Sequence 
 Merge Step 3
 Moving: {roomId=984015} from 0 to 1
 [LCDS]12/18/2009 15:13:19.566 [DEBUG] [InternalDataService] Sequence 
 Merge Step 3
 Moving: {roomId=983224} from 0 to 1
 [LCDS]12/18/2009 15:13:19.528 [DEBUG] [InternalDataService] Sequence 
 Merge Step 3
 Moving: {roomId=984015} from 0 to 1
 [LCDS]12/18/2009 15:13:19.566 [DEBUG] [InternalDataService] Sequence 
 Merge Step 3
 Moving: {roomId=983224} from 0 to 1
 [LCDS]12/18/2009 15:13:19.528 [DEBUG] [InternalDataService] Sequence 
 Merge Step 3
 Moving: {roomId=984015} from 0 to 1
 [LCDS]12/18/2009 15:13:19.566 [DEBUG] [InternalDataService] Sequence 
 Merge Step 3
 Moving: {roomId=983224} from 0 to 1
 [LCDS]12/18/2009 15:13:19.528 [DEBUG] [InternalDataService] Sequence 
 Merge Step 3
 Moving: {roomId=984015} from 0 to 1
 [LCDS]12/18/2009 15:13:19.566 [DEBUG] [InternalDataService] Sequence 
 Merge Step 3
 Moving: {roomId=983224} from 0 to 1
 [LCDS]12/18/2009 15:13:19.528 [DEBUG] [InternalDataService] Sequence 
 Merge Step 3
 Moving: {roomId=984015} from 0 to 1
 [LCDS]12/18/2009 15:13:19.566 [DEBUG] [InternalDataService] Sequence 
 Merge Step 3
 Moving: {roomId=983224} from 0 to 1
 [LCDS]12/18/2009 15:13:19.528 [DEBUG] [InternalDataService] Sequence 
 Merge Step 3
 Moving: {roomId=984015} from 0 to 1
 [LCDS]12/18/2009 15:13:19.566 [DEBUG] [InternalDataService] Sequence 
 Merge Step 3
 Moving: {roomId=983224} from 0 to 1
 [LCDS]12/18/2009 15:13:19.528 [DEBUG] [InternalDataService] Sequence 
 Merge Step 3
 Moving: {roomId=984015} from 0 to 1
 [LCDS]12/18/2009 15:13:19.566 [DEBUG] [InternalDataService] Sequence 
 Merge Step 3





[flexcoders] Re: capturing SHIFT+TAB on keyDown event

2009-12-18 Thread invertedspear
I don't have time to look it up right now, but I'm pretty sure you catch the 
Tab key down, then check if the shift key was down at the same time. Hopefully 
this gets you going in the right direction.

--- In flexcoders@yahoogroups.com, flexcoder2008 djohnso...@... wrote:

 Trying to capture the SHIFT+TAB key event on my DataGrid.  It seems the 
 Keydown handler can only handle 1 key at a time.  What is the best way to 
 handle this?





[flexcoders] Drag and drop, custom cursor during drag not working

2009-12-17 Thread invertedspear
I have a datagrid that I want the user to sort the rows on. To make it obvious 
that it's sortable I am implementing some custom cursors. But I'm having a 
problem when I actually drag an item. Can anyone help me out?

Thanks

here's a psuedo demonstration of the problem

Application = normal cursor // fine

Rollover datagrid = open hand cursor // good so far

mousedown on datagrid = closed hand cursor // good

dragging item around = closed hand cursor // switches back to normal cursor (if 
I move it around real fast I can see my custom curser for an instant)

mouse up on datadrid = open hand cursor // not sure, after I drop it goes back 
to open hand but if I mouse down, dont move and mouse up I have a closed hand

rollout of datagrid = normal cursor //good

datagrid code:

mx:DataGrid id=sectQuestionsDG x=10 y=204 width=558 height=277 
headerHeight=0 selectable={editMode}
dragMoveEnabled={editMode} dragEnabled={editMode} dropEnabled={editMode}
dragDrop=sectQuestReOrder(event); rollOver=over(); mouseDown=down(); 
mouseUp=up(); rollOut=out();/

functions:

public function over():void{
CursorManager.setCursor(grabCursor,CursorManagerPriority.LOW,0,0);
}
public function down():void{
CursorManager.setCursor(grabbingCursor,CursorManagerPriority.HIGH,0,0);
}
public function up():void{
CursorManager.setCursor(grabCursor,CursorManagerPriority.LOW,0,0);
}
public function out():void{
CursorManager.removeAllCursors();
}




[flexcoders] Re: Drag and drop, custom cursor during drag not working

2009-12-17 Thread invertedspear
OK, That helped a little bit, I'm now doing this on rollOver var 
styleSheet:CSSStyleDeclaration =
StyleManager.getStyleDeclaration(DragManager);
styleSheet.setStyle(moveCursor, grabbingCursor);
CursorManager.setCursor(grabCursor,CursorManagerPriority.LOW);

This is giving me the correct rollover and correct drag, but if I try to add 
any function to rollOut it screws up again, so now I'm stuck with the 
grabCursor. It seems like when I set a rollOut on the dataGrid it's firing for 
each row, same with mouseOut, is there any way to avoid that?
~Thanks



--- In flexcoders@yahoogroups.com, Chris zomgfore...@... wrote:

 Just a thought, as I haven't tried the method you described. What about
 setting the styles of the cursor on mouse down?
 
 var styleSheet:CSSStyleDeclaration =
 StyleManager.getStyleDeclaration(DragManager);
 styleSheet.setStyle(moveCursor, grabCursor);
 
 or
 
 styleSheet.setStyle(copyCursor, grabCursor);
 
 And you could set it back on mouse up. Just a thought because maybe
 DragManager is setting things back to what it has set in its styles.



[flexcoders] Re: Simplfying Repetitive Code

2009-12-16 Thread invertedspear
simple for loop would do it:

for(var i:int=1; i=10;i++){
 
}

--- In flexcoders@yahoogroups.com, AJC2357 ajc2...@... wrote:

 Hi all, 
 
 If I have a function like this.
 
 private function changeSeries(): void {
 series1.yField = 'male';
 series2.yField = 'male';
 series3.yField = 'male';
 series4.yField = 'male';
 series5.yField = 'male';
 series6.yField = 'male';
 series7.yField = 'male';
 series8.yField = 'male';
 series9.yField = 'male';
 series10.yField = 'male';
 }
 
 Is there an easy way to simplify it?  Something like
 
 private function changeSeries(): void {
 something to indicate i equaling zero through ten
 series[i] = 'male';
 }
 
 Any code help would be much appreciated!
 
 Alex





[flexcoders] Re: Simplfying Repetitive Code

2009-12-16 Thread invertedspear
Tibor,
I have been needing something like 'this[string+var]' for awhile. Would 
have saved me a lot of time to know about that sooner. Thanks.
~Mike



[flexcoders] Re: Crazy problem with a script creating datagrids

2009-12-14 Thread invertedspear
The problem is I have to create them programatically since the number of them 
will be different based on the returned data. I found a workaround where I call 
the filter after I assign the column dataFields names I want. But I'm still 
doing all these actions on an array that starts off with all the wrong values.

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

 In general, you should manipulate the columns of a DataGrid at setup other 
 than maybe to change visible.  The recommended practice at setup is to create 
 a fresh array of DataGridColumns and assign the whole array to the columns 
 property.
 
 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 invertedspear
 Sent: Friday, December 11, 2009 2:51 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Crazy problem with a script creating datagrids
 
 
 
 
 This is driving me nuts. This script is adding datagrids to various 
 containers in an accordion. In my first level for-each loop the item that 
 fills my if(compone...@component_componentid == 9) is the last 
 item looped through everything works fine except the datagrid I am building 
 there has the wrong columns. For some reason tempGridicd9.columns array is 
 returning the columns array from the tempGrid variable, and not even the 
 version I end up with after the filter, but the original columns array. I 
 don't even see how this is possible.
 
 Then when they datagrid gets drawn it has the right data in it, but it has 
 extra columns, cause the items from the else statement have 4 more columns.
 
 I have done hours of trouble shooting on this so far. The problem will not 
 present itself if I do not assign a dataProvider to tempGrid, for some reason 
 that seems to be where it all blows up.
 
 Anyone have a clue what's going on? Either I've majorly screwed up or this is 
 a major bug. Please help!!
 
 Here's a simple example of the XML, the real thing has a lot more nodes and a 
 lot of attributes:
 
 component
 question
 answer/
 /question
 /component
 component
 icd9/
 /component
 
 Script With the Problem
 
 public function populateTemplate():void{
 accComponents.removeAllChildren();
 for each(var component:XML in XMLTemplate.template.children()){
 var newVBox:VBox = new VBox();
 newVBox.id = compone...@component_name;
 newVBox.label = compone...@component_longname;
 newVBox.width = 388;
 newVBox.percentHeight = 100;
 accComponents.addChild(newVBox);
 
 if(compone...@component_componentid == 9){//icd9component
 var tempGridicd9:DataGrid = new DataGrid();
 tempGridicd9.setStyle(borderStyle,none);
 tempGridicd9.dataProvider = component.children();
 tempGridicd9.validateNow();
 //tempGridicd9.columns = 
 tempGridicd9.columns.filter(newTempGridicd9ColFilter);
 tempGridicd9.id = 'gridICD9';
 tempGridicd9.headerHeight = 0;
 tempGridicd9.selectable = false;
 tempGridicd9.percentWidth = 100;
 tempGridicd9.percentHeight = 100;
 tempGridicd9.variableRowHeight = true;
 tempGridicd9.columns[0].dataField = @icd9_color;
 tempGridicd9.columns[0].width = 25;
 tempGridicd9.columns[0].itemRenderer = new ClassFactory(icdDot);
 tempGridicd9.columns[1].dataField = @icd9_icd9;
 tempGridicd9.columns[1].width = 60;
 tempGridicd9.columns[2].dataField = @templateIcd9_name;
 tempGridicd9.columns[2].width = 283;
 tempGridicd9.columns[2].wordWrap = true;
 tempGridicd9.columns[3].dataField = @templateIcd9_templateIcd9ID;
 tempGridicd9.columns[3].visible = false;
 
 newVBox.addChild(tempGridicd9);
 }else if(component.children().length()0){
 for each (var section:XML in component.children()){
 var newPanel:Panel = new Panel();
 newPanel.title = secti...@sectiontype_name + :  + secti...@section_name;
 newPanel.width = 368;
 newPanel.id = secti...@section_sectionid;
 newPanel.data = secti...@section_sortorder;
 newPanel.addEventListener(MouseEvent.CLICK,panelClick,false,100,false);
 newPanel.addEventListener(MouseEvent.MOUSE_OVER,sectMouseOver,false,100,false);
 newPanel.addEventListener(MouseEvent.MOUSE_OUT,sectMouseOut,false,100,false);
 newVBox.addChild(newPanel);
 
 if(section.children().length()0){
 var tempGrid:DataGrid = new DataGrid();
 var tempGridList:XMLList = section.children();
 tempGridList = tempGridList.(@questionType_name!=null);
 tempGridList = tempGridList.(@question_hideByUserID==null);
 tempGrid.dataProvider = tempGridList;
 tempGrid.columns = tempGrid.columns.filter(tempGridColFilter);
 tempGrid.id = 'grid'+ secti...@section_sectionid
 //There is a bug that prevents only showing one line with 
 this:tempGrid.showHeaders = false;
 //use below instead
 tempGrid.headerHeight = 0;
 tempGrid.width = 348;
 tempGrid.columns[0].dataField=@questionDisplay;
 tempGrid.columns[1].dataField=@question_questionID;
 tempGrid.columns[1].visible=false;
 tempGrid.columns[2].dataField=@question_sortOrder;
 tempGrid.columns[2].visible=false

[SPAM] [flexcoders] Re: Crazy problem with a script creating datagrids

2009-12-14 Thread invertedspear
Thats what the filter function does, unless I missed something. The problem I 
am seeing is that a whole new datagrid, with a whole new dataprovider, created 
with a whole different line of code. That dataGrid.columns (different ID) is 
returning the first datagrids columns.

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

 DataGrid.columns returns a copy of the columns array.  Be sure you re-assign
 the modified array to the columns property.
 
  
 
 Tracy Spratt,
 
 Lariat Services, development services available
 
   _  
 
 From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
 Behalf Of invertedspear
 Sent: Monday, December 14, 2009 10:20 AM
 To: flexcoders@yahoogroups.com
 Subject: [SPAM] [flexcoders] Re: Crazy problem with a script creating
 datagrids
 
  
 
   
 
 The problem is I have to create them programatically since the number of
 them will be different based on the returned data. I found a workaround
 where I call the filter after I assign the column dataFields names I want.
 But I'm still doing all these actions on an array that starts off with all
 the wrong values.
 
 --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com,
 Alex Harui aharui@ wrote:
 
  In general, you should manipulate the columns of a DataGrid at setup other
 than maybe to change visible. The recommended practice at setup is to create
 a fresh array of DataGridColumns and assign the whole array to the columns
 property.
  
  Alex Harui
  Flex SDK Developer
  Adobe Systems Inc.http://www.adobe. http://www.adobe.com/ com/
  Blog: http://blogs. http://blogs.adobe.com/aharui adobe.com/aharui
  
  From: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com
 [mailto:flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com]
 On Behalf Of invertedspear
  Sent: Friday, December 11, 2009 2:51 PM
  To: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com
  Subject: [flexcoders] Crazy problem with a script creating datagrids
  
  
  
  
  This is driving me nuts. This script is adding datagrids to various
 containers in an accordion. In my first level for-each loop the item that
 fills my if(compone...@component_componentid == 9) is the last
 item looped through everything works fine except the datagrid I am building
 there has the wrong columns. For some reason tempGridicd9.columns array is
 returning the columns array from the tempGrid variable, and not even the
 version I end up with after the filter, but the original columns array. I
 don't even see how this is possible.
  
  Then when they datagrid gets drawn it has the right data in it, but it has
 extra columns, cause the items from the else statement have 4 more columns.
  
  I have done hours of trouble shooting on this so far. The problem will not
 present itself if I do not assign a dataProvider to tempGrid, for some
 reason that seems to be where it all blows up.
  
  Anyone have a clue what's going on? Either I've majorly screwed up or this
 is a major bug. Please help!!
  
  Here's a simple example of the XML, the real thing has a lot more nodes
 and a lot of attributes:
  
  component
  question
  answer/
  /question
  /component
  component
  icd9/
  /component
  
  Script With the Problem
  
  public function populateTemplate():void{
  accComponents.removeAllChildren();
  for each(var component:XML in XMLTemplate.template.children()){
  var newVBox:VBox = new VBox();
  newVBox.id = compone...@component_name;
  newVBox.label = compone...@component_longname;
  newVBox.width = 388;
  newVBox.percentHeight = 100;
  accComponents.addChild(newVBox);
  
  if(compone...@component_componentid == 9){//icd9component
  var tempGridicd9:DataGrid = new DataGrid();
  tempGridicd9.setStyle(borderStyle,none);
  tempGridicd9.dataProvider = component.children();
  tempGridicd9.validateNow();
  //tempGridicd9.columns =
 tempGridicd9.columns.filter(newTempGridicd9ColFilter);
  tempGridicd9.id = 'gridICD9';
  tempGridicd9.headerHeight = 0;
  tempGridicd9.selectable = false;
  tempGridicd9.percentWidth = 100;
  tempGridicd9.percentHeight = 100;
  tempGridicd9.variableRowHeight = true;
  tempGridicd9.columns[0].dataField = @icd9_color;
  tempGridicd9.columns[0].width = 25;
  tempGridicd9.columns[0].itemRenderer = new ClassFactory(icdDot);
  tempGridicd9.columns[1].dataField = @icd9_icd9;
  tempGridicd9.columns[1].width = 60;
  tempGridicd9.columns[2].dataField = @templateIcd9_name;
  tempGridicd9.columns[2].width = 283;
  tempGridicd9.columns[2].wordWrap = true;
  tempGridicd9.columns[3].dataField = @templateIcd9_templateIcd9ID;
  tempGridicd9.columns[3].visible = false;
  
  newVBox.addChild(tempGridicd9);
  }else if(component.children().length()0){
  for each (var section:XML in component.children()){
  var newPanel:Panel = new Panel();
  newPanel.title = secti...@sectiontype_name + :  + secti...@section_name;
  newPanel.width = 368;
  newPanel.id = secti...@section_sectionid

[flexcoders] Easy (I hope) drag and drop question

2009-12-14 Thread invertedspear
I searched but couldn't find my answer, I'm sure it's easy for anyone with a 
little experience. I have multiple datagrids on a page, each one I want 
sortable with drag and drop, but I don't want items drug from one control to 
the other. How can I prevent a user from dragging an item out of a conrol. I 
would prefer to have it just stop moving with the mouse, but I am prepared to 
just completely cancel out of the dragging if need be.
I was trying to do something like this

dragExit=dragEvent.CANCEL

This is obviously wrong, but I can't find the correct way to do it.

Thanks in advance. ~Mike




Re: [SPAM] [flexcoders] XMLList question

2009-12-11 Thread invertedspear
I forgot I asked that question here too. I actually turned up a pretty simple 
function some dude developed to sort XML at 
http://freerpad.blogspot.com/2007/07/more-hierarchical-sorting-e4x-xml-for.html 
I then modified it a bit to do what I need and posted it here 
http://stackoverflow.com/questions/1869964/flex-newbie-xmllist-question. 

It's essentially the same thing as your suggesting but I couldn't use the set 
children easily since I had multiple note names and I only wanted to sort one. 

ex:
question
  answer sort=1/
  answer sort=3/
  answer sort=2/
  defaultAnswer/
/question
I only need to (and only can) sort answer nodes but need to keep the 
defaultAnswer around.

Thanks for the help though, sorry I didn't post the answer I had found sooner.


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

 I don't believe you can sort an xmllist directly.  I use a function that
 takes the children of a node (XMLList), wraps it in an XMLListCollection,
 sorts it, then uses setChildren() to re-assign the sorted children to the
 parent.  I think I have posted that here actually.
 
  
 
 Tracy Spratt,
 
 Lariat Services, development services available



[flexcoders] Re: .exe files in flex3

2009-12-11 Thread invertedspear
You might want to post your question in the directly instead of as a reply. 
You'll get a more detailed answer than what I know. You want to make an Air 
application. All I can suggest is looking into how to compile to an Air app.

--- In flexcoders@yahoogroups.com, kanna kannaec...@... wrote:

 Hi i need a help from you all,i want to know how to create a .exe files in
 Flex3. For example i have a application up and running which is
 developed in flex3 with blezeds -tomcat. i want to create it as a full
 exe so that it can be installed in other system and without doing any
 other configuration it should work. i believe we need to take care of
 the database part. i have a war with swf files and web-inf parts.





[flexcoders] Crazy problem with a script creating datagrids

2009-12-11 Thread invertedspear


This is driving me nuts. This script is adding datagrids to various containers 
in an accordion. In my first level for-each loop the item that fills my 
if(compone...@component_componentid == 9) is the last item looped 
through everything works fine except the datagrid I am building there has the 
wrong columns. For some reason tempGridicd9.columns array is returning the 
columns array from the tempGrid variable, and not even the version I end up 
with after the filter, but the original columns array. I don't even see how 
this is possible.

Then when they datagrid gets drawn it has the right data in it, but it has 
extra columns, cause the items from the else statement have 4 more columns.

I have done hours of trouble shooting on this so far. The problem will not 
present itself if I do not assign a dataProvider to tempGrid, for some reason 
that seems to be where it all blows up.

Anyone have a clue what's going on? Either I've majorly screwed up or this is a 
major bug. Please help!!

Here's a simple example of the XML, the real thing has a lot more nodes and a 
lot of attributes:

component
  question
answer/
  /question
/component
component
  icd9/
/component

Script With the Problem

public function populateTemplate():void{
accComponents.removeAllChildren();
for each(var component:XML in XMLTemplate.template.children()){
var newVBox:VBox = new VBox();
newVBox.id = compone...@component_name;
newVBox.label = compone...@component_longname;
newVBox.width = 388;
newVBox.percentHeight = 100;
accComponents.addChild(newVBox);

if(compone...@component_componentid == 9){//icd9component
var tempGridicd9:DataGrid =  new DataGrid();
tempGridicd9.setStyle(borderStyle,none);
tempGridicd9.dataProvider = component.children();
tempGridicd9.validateNow();
//tempGridicd9.columns = 
tempGridicd9.columns.filter(newTempGridicd9ColFilter);
tempGridicd9.id = 'gridICD9';
tempGridicd9.headerHeight = 0;
tempGridicd9.selectable = false;
tempGridicd9.percentWidth = 100;
tempGridicd9.percentHeight = 100;
tempGridicd9.variableRowHeight = true;
tempGridicd9.columns[0].dataField = @icd9_color;
tempGridicd9.columns[0].width = 25;
tempGridicd9.columns[0].itemRenderer = new ClassFactory(icdDot);
tempGridicd9.columns[1].dataField = @icd9_icd9;
tempGridicd9.columns[1].width = 60;
tempGridicd9.columns[2].dataField = @templateIcd9_name;
tempGridicd9.columns[2].width = 283;
tempGridicd9.columns[2].wordWrap = true;
tempGridicd9.columns[3].dataField = 
@templateIcd9_templateIcd9ID;
tempGridicd9.columns[3].visible = false;

newVBox.addChild(tempGridicd9);
}else if(component.children().length()0){
for each (var section:XML in component.children()){
var newPanel:Panel = new Panel();
newPanel.title = secti...@sectiontype_name + :  + 
secti...@section_name;
newPanel.width = 368;
newPanel.id = secti...@section_sectionid;
newPanel.data = secti...@section_sortorder;

newPanel.addEventListener(MouseEvent.CLICK,panelClick,false,100,false);

newPanel.addEventListener(MouseEvent.MOUSE_OVER,sectMouseOver,false,100,false);

newPanel.addEventListener(MouseEvent.MOUSE_OUT,sectMouseOut,false,100,false);
newVBox.addChild(newPanel);

if(section.children().length()0){
var tempGrid:DataGrid =  new DataGrid();
var tempGridList:XMLList = section.children();
tempGridList = 
tempGridList.(@questionType_name!=null);
tempGridList = 
tempGridList.(@question_hideByUserID==null);
tempGrid.dataProvider = tempGridList;
tempGrid.columns = 
tempGrid.columns.filter(tempGridColFilter);
tempGrid.id = 'grid'+ secti...@section_sectionid
//There is a bug that prevents only showing one 
line with this:tempGrid.showHeaders = false; 
//use below instead
tempGrid.headerHeight = 0;
tempGrid.width = 348;

tempGrid.columns[0].dataField=@questionDisplay;

tempGrid.columns[1].dataField=@question_questionID;
tempGrid.columns[1].visible=false;
 

[flexcoders] Re: invalidateList not working on Menu control

2009-12-08 Thread invertedspear
I don't think I've done what you described before, but I think you should try 
refreshing the dataprovider. arrayDP.refresh();

--- In flexcoders@yahoogroups.com, steveb805 quantumcheese...@... wrote:

  invalidateList is invalidating my mood ... no it's not that bad.
 
 I have a popUpButton:
 
 templateMenu = new Menu();// global var
 templateMenu.labelField = name;
 templateMenu.dataProvider = arrayDP;
 templateMenu.selectedIndex = 0;
 templateMenu.showRoot = true;
 templatePopUpButton.popUp = templateMenu;
 
 
 Occassionally, I do an arrayDP.push(some object);
 
 I'd like the popUp's menu to immediately show this new item.
 
 I tried templateMenu.invalidateList(), but this is not working.
 
 The flash develop doc/hint says that invalidateList: refresh all rows on the 
 next update
 
 How do you force the next update.   Is it invalidateDisplayList()?  I tried 
 that, adding it after invalidateList, but that didn't work.
 
 eager to be enlightened,
 Thanks,
 Steve





[flexcoders] Re: Prevent inset/shifting of text in selected tabs

2009-12-08 Thread invertedspear
I haven't seen that before but it may be something to do with some of your 
styles. Check this gadget out, it has helped me beyond words in dealing with 
styles in Flex. I haven't seen one for flex3 yet, but this covers most of 
everything.

http://examples.adobe.com/flex2/consulting/styleexplorer/Flex2StyleExplorer.html

--- In flexcoders@yahoogroups.com, dfalling dfall...@... wrote:

 When a tab in a tab navigator is selected, the text shifts down a slight 
 amount.  I've looked everywhere and can't find a style or property that's 
 causing this.  How can I prevent the text from shifting?
 
 Thanks





[flexcoders] XMLList question

2009-12-08 Thread invertedspear
Is it possible to sort an XMLList? All the examples I can find on it create a 
new XMLListCollection like this:

MyXMLListCol = new XMLListCollection(MyXMLList);

I don't think the XMLListCollection in this case has any reference to the 
XMLList so sorting it would leave my XMLList unsorted, is this correct?

How can I sort the XMLList directly?

Thanks ~Mike




[flexcoders] Re: Prevent inset/shifting of text in selected tabs

2009-12-08 Thread invertedspear
I couldn't even notice it before, but now I can see it shifting about a pixel. 
It looks to me like it defaults to being vertically aligned to center, and the 
selected tab has no bottom border, so the space to center the text in is 
slightly bigger. There is no vertical-align style for selected tab or any tabs 
for that matter.

Maybe an itemRenderer is the solution. This is bothering me now, if I find the 
answer I will let you know ASAP.

--- In flexcoders@yahoogroups.com, dfalling dfall...@... wrote:

 It's definitely not a style I've set.  If you go select the tab navigator in 
 the style explorer, you should be able to notice the text in the tabs 
 shifting down slightly whenever the tab is selected.  I haven't found any 
 styles or text properties that cause this, and have even dug through the tab 
 navigator code to try to see the changes it does to selected tabs.
 
 --- In flexcoders@yahoogroups.com, invertedspear invertedspear@ wrote:
 
  I haven't seen that before but it may be something to do with some of your 
  styles. Check this gadget out, it has helped me beyond words in dealing 
  with styles in Flex. I haven't seen one for flex3 yet, but this covers most 
  of everything.
  
  http://examples.adobe.com/flex2/consulting/styleexplorer/Flex2StyleExplorer.html
  
  --- In flexcoders@yahoogroups.com, dfalling dfalling@ wrote:
  
   When a tab in a tab navigator is selected, the text shifts down a slight 
   amount.  I've looked everywhere and can't find a style or property that's 
   causing this.  How can I prevent the text from shifting?
   
   Thanks
  
 





[flexcoders] Re: phpMyAdmin and Flex

2009-12-04 Thread invertedspear
Try the MySQL Query Browser. It's a free download from the MySQL team and 
should suit your needs. There are also numerous pay programs out there. My 
Favorite is the EMS MySQLManager.


--- In flexcoders@yahoogroups.com, Christophe christophe_jacque...@... 
wrote:

 Hello, 
 
 I have a database mySQL with my Flex application.
 But the use of phpMyAdmin to view the tables is too long, I am searching for 
 a faster way to view tables in a back office.
 
 Thank you,
 Christophe,





[flexcoders] Re: Help, please

2009-12-04 Thread invertedspear
You might try the adobe forums themselves, but you're using an old version of 
Flex as a plugin to eclipse so they might nor really have an answer for you. 
stackoverflow.com has a good community of people that might be able to help 
you, they're pretty much all developers so someone may have more experience 
with your setup.


--- In flexcoders@yahoogroups.com, Greg Morphis gmorp...@... wrote:

 So no one has any ideas what could be the cause of this? Any Adobe
 people out there? Where else can I post my problem to get some kind of
 help?
 
 On Thu, Dec 3, 2009 at 7:43 AM, Greg Morphis gmorp...@... wrote:
  Should I try uninstalled Flex Builder 2 and reinstalling it? Has no
  one ran into anything like this?
 
  On Wed, Dec 2, 2009 at 1:05 PM, Greg Morphis gmorp...@... wrote:
  I need help when trying to compile a Flex 2 app with SSL using Ant I
  keep getting an error. I've Googled Error: Unable to locate specified
  base class 'mx.core.Application' for component class 'index'
  with not much help. I'm using Eclipse with Flex builder 2 lugin. Please 
  help.
 
  Buildfile:
  C:\eclipseworkspace\flexdev\rrtbuilds\RetailForms.xml
 
  compileSSL:
  [java] Loading configuration file C:\Program Files\Adobe\Flex Builder
  2 Plug-in\Flex SDK 2\frameworks\flex-config.xml
  [java] C:\Temp\RetailForms\index.mxml: Error: Unable to locate
  specified base class 'mx.core.Application' for component class
  'index'.
  BUILD FAILED
 
  C:\eclipseworkspace\flexdev\rrtbuilds\RetailForms.xml:85: Java returned: 1
 
  Total time: 3 seconds
 
  Here's from the build file
 
  !-- compile the actual project for SSL --
  target name=compileSSL depends= 
  java jar=${mxmlcjar}
  fork=true
  failonerror=true
  maxmemory=128m
  dir=${flexsdk}\frameworks
  arg value=-local-fonts-snapshot=${flexsdk}\frameworks\winFonts.ser/
  arg value=-load-config=${flexsdk}\frameworks\flex-config.xml/
  arg value=-services=${flexservices}\ssl-services-config.xml /
  arg value=-include-libraries=${lib}\cairngorm.swc /
  arg value=-include-libraries+=${lib}\RRTUtilities.swc /
  arg value=-context-root=/ /
  arg value=-output=${bin}\${flex.ouput_file} /
  arg value=-file-specs=${src}\${flex.src_file}/
  /java
  /target
 
 





[flexcoders] XML problem

2009-12-03 Thread invertedspear
I am having a problem when I'm getting back an HTTPService and trying to set 
some XML attributes with it. It works fine the first time I handle the result, 
but fails to do anything after the first time. No error or anything else to 
give me any indication something's wrong. I know that str is being set 
correctly as I can put it in an Alert, but the @name attribute doesn't update 
in the XMLTemplate.

Any ideas?

var str:String = templateDetailsAC.getItemAt(0).name
xmltemplate.templa...@name=str;



[flexcoders] Re: DataGrid adds extra row unexpectedly

2009-12-03 Thread invertedspear
Amy, I know I answered you privately when the group was down, but I wanted to 
throw the answer in here in case anyone was searching for it:

When I came across this problem I found that it was a known bug.
A workaround is to set the showHeader back to true, header height to 0 and the 
rowcount to the length of your dataprovider. By showing the header it escapes 
the bug and the height of 0 effectively hides the header.

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

 Hi, all;
 
 I have a datagrid whose rowcount is set to thedataGrid.dataProvider.length -1 
 (because the datagrid has no header row, I have to subtract 1).
 
 The problem is that, even though the datagrid's editable property is set to 
 false, there appears to be an extra, invisible row at the bottom of the 
 datagrid that, if you roll over it, will highlight one of the rows (two up 
 from the bottom).  If you click while the highlight is visible, it will add 
 an extra row to the datagrid.  When this happens, the itemClick event does 
 not fire, so I can't prevent this with preventDefault() on that event.
 
 Does anyone know what event I should be looking at for this, or whether 
 there's a property that equates to don't allow wonky extra invisible row to 
 be clickable and add data to my dataprovider?
 
 Thanks;
 
 Amy





[flexcoders] Re: e4x Filtering with a variable?

2009-12-03 Thread invertedspear
I was just doing something similar and found help here:

http://livedocs.adobe.com/flex/3/html/help.html?content=13_Working_with_XML_08.html

probably best you read through there and find the solution that is specific for 
you.

Let us know if you still need help after reviewing that.
~Mike

--- In flexcoders@yahoogroups.com, flexcoder2008 djohnso...@... wrote:

 I have an XML structure that gets built dynamically.  Nodes are constructed 
 with a number appending the node name and the number of these nodes depends 
 on values in a database.  The structure looks like this:
 
 RootNode
 Item1 /
 Item2 /
 Item3 /
 
 etc...
 
 
 Now I want to access a particular node using a variable.
 
 For example:
 
 var i:int = 2;
 myXML.RootNode.Item{i}
 
 but this is not working.  How can I create an E4x expression that appends a 
 variable value onto a node name in the filter expression?





[flexcoders] Re: XML list empty or remove items from provider?

2009-12-03 Thread invertedspear
Easiest way is myXMLListCollection = new XMLListCollection;

--- In flexcoders@yahoogroups.com, advancedonsite nos...@... wrote:

 Something simple like a XML collection list I thought I could empty it out 
 but have been searching and not found a simple way to do it.
 
 So how does someone clear a XML collection list?





[flexcoders] Re: Quadrant

2009-12-01 Thread invertedspear
Are you adding the image with a script? if so you can change the height and 
width of the image setting it equal to the height and width of the container 
canvas, or any percentage of it like so:

height = int(container.height * .75) //for 75% of the height
width = int(container.width - 10)//to leave 10 pixels

does this help?
~Mike

--- In flexcoders@yahoogroups.com, kanu kukreja kanukukr...@... wrote:

 Hi,
 I need a help from you all.
 
 I have 5 canvases all are of different dimension.
 
 If i add an image in one canvas, proportionally i want to show that in
 another banners.
 How i can achieve that?
 
 Thanks





[flexcoders] Re: Flex Builder 3 - Crashes

2009-12-01 Thread invertedspear
Had this prob with another program, it was a major software conflict, something 
like a windows BSOD so bad that it couldn't even do a BSOD.

Tracing this problem is a nearly impossible task for a normal user. It could be 
a conflict with almost any installed software, my issue only occurred when I 
had MS Office  IEX (the crashing app) installed, then it only occurred when I 
resized a window by clicking and dragging the lower right corner, not a side, 
top, bottom, or any other corner.

Re-installing is not going to help because the conflicting software is still 
installed. What may make the difference is where the conflict is occurring so 
try closing the app in different ways. Assuming you're using windows, try 
clicking the [X], file-close, right clicking and selecting close from the 
start bar, and even using the task manager. One of these may skip the conflict 
and you might be safe that way, else try a different system or uninstalling 
programs you aren't using. 

Good Luck
~Mike

--- In flexcoders@yahoogroups.com, criptopus sd_br...@... wrote:

 It has happened now 4 times,
 
 When I exit Flex Builder 3 my system crashes, screen goes black and the 
 system restarts. When I re-run Flex Builder it shows nothing in the Flex 
 Navigator.
 
 This wouldn't be a problem as I save (export) my work but the exported work 
 dosn't restore properly, while before I was working in the debug area it 
 insists on working in the release area. Which is not how I had it set up.
 
 The only way I recover successfully is to create a new project, set up all my 
 php services and copy the files back, which takes ages.
 
 Anybody have the same trouble, if so does anybody have any way to speed up 
 the restore or stop the crash happening?
 
 - Stephen





[flexcoders] Re: Charting error

2009-12-01 Thread invertedspear
That error is not specific to charts. Can we see the line of code that is 
throwing the error? You are probably trying to do something to an object before 
it is created.

--- In flexcoders@yahoogroups.com, Richard Rodseth rrods...@... wrote:

 Since I don't have the Flex 3.3 charting sources handy, has anyone
 encountered this error?
 
 TypeError: Error #1009: Cannot access a property or method of a null object
 reference.
 at
 mx.charts::AxisRenderer/calcStaggeredSpacing()[C:\work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\AxisRenderer.as:2200]





[flexcoders] Re: Charting error

2009-12-01 Thread invertedspear
So I am going to assume you are using a loop, and lastLabel is a variable set 
to the last label created in the loop. You're code's going to break on the 
first iteration since it can't divide a null value by 2. You need to either set 
an initial value for lastLabel before the loop or not process that line on the 
first iteration, instead setting the position. That is probably what you really 
want to do since you would want your first label to be at a fixed position and 
the second to base it off of that.

I hope it doesn't seem that I'm talking down to you, I'm just trying to 
determine the best I can out of the little bit I'm seeing here.

--- In flexcoders@yahoogroups.com, Richard Rodseth rrods...@... wrote:

 Yes, I know a null pointer exception is not charting-specific :)
 
 None of my code is in the stack crawl (shown below). The line in question
 is:
 
 staggeredrightGutter / (lastLabel.width / 2));
 
 and lastLabel is null. I can't reproduce all the code here (but I will note
 that the series list is built dynamically).
 
 I'll keep digging. Thanks.
 
 
 TypeError: Error #1009: Cannot access a property or method of a null object
 reference.
 at
 mx.charts::AxisRenderer/calcStaggeredSpacing()[C:\work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\AxisRenderer.as:2200]
 at
 mx.charts::AxisRenderer/calcRotationAndSpacing()[C:\work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\AxisRenderer.as:1591]
 at
 mx.charts::AxisRenderer/adjustGutters()[C:\work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\AxisRenderer.as:1331]
 at mx.charts::AxisRenderer/set
 gutters()[C:\work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\AxisRenderer.as:803]
 at
 mx.charts.chartClasses::CartesianChart/updateAxisLayout()[C:\work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses\CartesianChart.as:2032]
 at
 mx.charts.chartClasses::CartesianChart/updateDisplayList()[C:\work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses\CartesianChart.as:1359]
 at
 mx.core::UIComponent/validateDisplayList()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\core\UIComponent.as:6351]
 at
 mx.managers::LayoutManager/validateDisplayList()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:622]
 at
 mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:695]
 at Function/http://adobe.com/AS3/2006/builtin::apply()
 at
 mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8633]
 at
 mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8573]





[flexcoders] Re: Flex Chart Horizontal Axis

2009-11-24 Thread invertedspear
I don't remember how to do it, but when I had to do this a couple years ago I 
found it easier to add a line series to the chart where I wanted it than to add 
a single gridline. Maybe that's a route you can explore until someone comes up 
with something better :-)

~Mike

--- In flexcoders@yahoogroups.com, jch92592 jch92...@... wrote:

 I have a Flex Bar Chart that I would like to add *one*
 grid line to at a specific location on the horizontal axis.
 
 I have tried using the verticalChangeCount with mixed results.
 
 This grid line will be provided to indicate a goal for a KPI.
 
 Any suggestions?
 
 Thank you,
 JCH





[flexcoders] Re: Help! - AdvancedDataGrid - Applying sort as if user clicked column header

2009-11-24 Thread invertedspear
Bumping this cause I'm still searching.

--- In flexcoders@yahoogroups.com, invertedspear invertedsp...@... wrote:

 So can anyone tell me how to sort when using a grouping collection? The GC is 
 sorted how I want it, but I want the rest of them to default to being sorted 
 as if the user had clicked on the header of the first column. I can't find 
 help on this anywhere.
 
 Thanks in advance.




[flexcoders] Re: Help! - AdvancedDataGrid - Applying sort as if user clicked column header

2009-11-24 Thread invertedspear
Tried to bump this earlier, must have done something wrong, but apologies if I 
double post.

I'm bumping because I'm still having a problem with this. Can anyone help me 
out? 



[flexcoders] Re: Help! - AdvancedDataGrid - Applying sort as if user clicked column header

2009-11-24 Thread invertedspear
Valdhor you are a life saver. I hadn't found that first link in my searching 
and it cleared everything up for me.

Thank you so much. I think that's twice you assisted me. I might owe you a beer 
soon.

Thanks
~Mike

--- In flexcoders@yahoogroups.com, valdhor valdhorli...@... wrote:

 Maybe one of these would help:
 
 http://cookbooks.adobe.com/post_How_to_sort_items_within_group_in_AdvancedDataGrid-13047.html
 
 http://stackoverflow.com/questions/155279/how-do-i-sort-in-a-flex-advanceddatagrid-callback-isnt-being-called
 
 http://flexpearls.blogspot.com/2008/01/using-advanceddatagrid-as-tree-control.html



[flexcoders] Re: checksums (md5, sha1)

2009-11-24 Thread invertedspear
I'm not questioning your need, but as a newbie to Flex I am curious why you 
would do this, and if it's something I should be doing. Is it some sort of 
stability check?
Thanks

--- In flexcoders@yahoogroups.com, sean.drexler se...@... wrote:

 I am trying to compile my code 2 times and get 2 swf files with matching 
 checksums. Does anyone know how to do this? I have managed to get this to 
 work on small chunks of code but nothing large scale, i.e. libraries (my own 
 or 3rd party) included, additional custom classes. I turned off the optimizer 
 but still do not get anything valid. I also have compared the swf files in a 
 Hex viewer and both are vastly different. Is there a compiler flag or certain 
 coding conventions that would help me achieve this?
 Thanks,
 Sean





[flexcoders] Re: Help! - AdvancedDataGrid - Applying sort as if user clicked column header

2009-11-23 Thread invertedspear
So can anyone tell me how to sort when using a grouping collection? The GC is 
sorted how I want it, but I want the rest of them to default to being sorted as 
if the user had clicked on the header of the first column. I can't find help on 
this anywhere.

Thanks in advance.

--- In flexcoders@yahoogroups.com, tntomek tnto...@... wrote:

 Grouping data provider has its own sort property that is separate from the 
 base sort on your ArrayCollection, you will have to specify that in one of 
 the group of grouping field properties





[flexcoders] Re: Errors sorting a arrayCollection ready for searching?

2009-11-23 Thread invertedspear
I agree that you are probably better doing the backend search, but if you need 
to do it in your app here's the proper way to sort. You just missed declaring a 
sort as a new object (then since you didn't have an object you were trying to 
apply sortfields to an AC) and then you apply that new sort to your AC.

private function private function userHandler(event:ResultEvent):void{
acUsers = evt.result.rows.row;
var sort:Sort = new Sort();
sort.fields = [new SortField(usraccount,true)];
acUsers.sort = sort;
acUsers.refresh();
}

--- In flexcoders@yahoogroups.com, valdhor valdhorli...@... wrote:

 You are probably better off checking if the new user has entered an already 
 used account name on the back end and sending through a Yes/No answer to Flex.
 
 Anyway, You should be able to figure out how to do a sort by perusing this 
 example:
 
 http://blog.flexexamples.com/2007/08/05/sorting-an-arraycollection-using-the-sortfield-and-sort-classes/
 
 --- In flexcoders@yahoogroups.com, criptopus sd_brown@ wrote:
 
  Don't understand why im getting these errors, can anybody help?
  
  I have just created an arrayCollection from a HTTPService that reads a 
  table from my database. I am trying to check to see if the new user has 
  entered an already used account name.
  
  After reading a number of articles I discovered searching the 
  arrayCollection was possible but only after sorting the collection, this is 
  what I am having trouble with.
  
  Here is my code:
  
  private function userHandler(event:ResultEvent):void
  {
acUsers = event.result.response.data.row;
acUsers.fields = [new SortField(usraccount, true)];
acUsers.sort=acUsers;
acUsers.refresh();
  }
  
  I am getting the following error at (acUsers.sort=acUsers;):
  
  implicit coercion of a value of type
  mx.collections:ArrayCollection
  to an unrelated type
  mx.collections:Sort.
  
  and also an error at (acUsers.fields = [new SortField(usraccount, true)];)
  
  Access of possibly undefined property
  fields through a refrence with static type mx.collections:ArrayCollection.
 





[flexcoders] Re: Help! - AdvancedDataGrid - Applying sort as if user clicked column header

2009-11-21 Thread invertedspear
The last argument in the function is the index of the column (0, which is the 
first, I have also tried 1 and 2 just to see if I could get something to 
happen. Sorting the dataprovider doesn't work with the grouping for some 
reason. If I need more arguments in the dispatch event, which ones do I need?

--- In flexcoders@yahoogroups.com, tntomek tnto...@... wrote:

 Nothing is happening because the event has no context of the column that was 
 supposedly clicked, try adding more arguments into the createEvent method. 
 
 Having said that, this is probably not the recommended way of programmaticaly 
 invoking sort on the grid. Have a look around there we some threads about 
 this a few days ago.
 
 Ideally what you want to do is update the sort property on your 
 dataProvider, this will dispatch events to the grid and it should draw itself 
 correctly.




Re: [flexcoders] [SPAM] Re: Passing an object to a rendererProvider

2009-11-20 Thread InvertedSpear

Any chance you can explain further, maybe with a simple example? 


Amy-28 wrote:
 
 That's what styleFunction on ADG is for.  And why the Data Visualization
 Components take things that would be properties on other components (like
 dataProvider) as styles.
 

-- 
View this message in context: 
http://old.nabble.com/Passing-an-object-to-a-rendererProvider-tp26396466p26442371.html
Sent from the FlexCoders mailing list archive at Nabble.com.



[flexcoders] Help! - AdvancedDataGrid - Applying sort as if user clicked column header

2009-11-20 Thread InvertedSpear

Check out the advancedDataGrid below in the ***s. After I group I loose the
sorting I applied to the dataprovider, and no matter what I try or when I
try it, sorting the dataprovider has no effect. But the user can sort by
clicking on a column header. So I want to simulate that click in a function
but I am having no success.

I'm trying this code in the ///s and calling it after I refresh the grouping
collection. I know this code isn't breaking with any sort of error cause the
Alert.show I fire right after it works fine. Anyone know what I'm doing
wrong?


gridTemplates.dispatchEvent(
new AdvancedDataGridEvent(
AdvancedDataGridEvent.HEADER_RELEASE,
false,
false,
0
)
);






Here's the AdvancedDataGrid:
***
mx:AdvancedDataGrid defaultLeafIcon={null} folderClosedIcon={null}
folderOpenIcon={null}
displayItemsExpanded=true id=gridTemplates left=10 right=10
top=10 bottom=50 click=gridClick();


mx:dataProvider
mx:GroupingCollection id=gc source={acTemplates}
mx:Grouping
mx:GroupingField name=templateTypeID
mx:SummaryRow summaryPlacement=group
mx:fields
mx:SummaryField 
dataField=templateTypeID label=templateTypeID /
/mx:fields
/mx:SummaryRow
/mx:GroupingField
/mx:Grouping
/mx:GroupingCollection
/mx:dataProvider
mx:columns
mx:AdvancedDataGridColumn dataField=name headerText=Formal 
Name
width=280/  
mx:AdvancedDataGridColumn dataField=abbreviation 
headerText=Short
Name width=150/
mx:AdvancedDataGridColumn dataField=insertDate 
headerText=Date
Created width=150/
mx:AdvancedDataGridColumn dataField=templateID width=0
visible=false/
/mx:columns
mx:rendererProviders
mx:AdvancedDataGridRendererProvider dataField=templateTypeID

 columnIndex=0

 columnSpan=0

 depth=1

 renderer=SummaryRenderer/
/mx:rendererProviders

/mx:AdvancedDataGrid
***
-- 
View this message in context: 
http://old.nabble.com/Help%21---AdvancedDataGrid---Applying-sort-as-if-user-clicked-column-header-tp26443587p26443587.html
Sent from the FlexCoders mailing list archive at Nabble.com.



RE: [flexcoders] [SPAM] Re: Passing an object to a rendererProvider

2009-11-19 Thread InvertedSpear

Bumping to see if anyone can help me. I understand the concept of sending an
object instead of a string, or sending the additional string. If Flex could
read my mind I would be there. I just can't figure out how to execute that
concept.

Thanks to those that have provided me with help already, and thanks in
advance to those who will.
~Mike
-- 
View this message in context: 
http://old.nabble.com/Passing-an-object-to-a-rendererProvider-tp26396466p26421387.html
Sent from the FlexCoders mailing list archive at Nabble.com.



RE: [flexcoders] [SPAM] Re: Passing an object to a rendererProvider

2009-11-19 Thread InvertedSpear

Bumping to see if anyone can help me. I unserstand the concept of sending an
object instead of a string, or sending the additional string. If Flex could
read my mind I would be there. I just can't figure out how to execute that
concept.

Thanks to those that have provided me with help already, and thanks in
advance to those who will.
~Mike
-- 
View this message in context: 
http://old.nabble.com/Passing-an-object-to-a-rendererProvider-tp26396466p26421386.html
Sent from the FlexCoders mailing list archive at Nabble.com.



Re: [flexcoders] Passing an object to a rendererProvider

2009-11-18 Thread InvertedSpear

Passing the data as part of the data object seems like what I need to do, in
fact if I can do that then I can pass the simple string instead of the
entire object, but how do I do that? 

Thanks
~Mike

Jeffry Houser-2 wrote:
 
 
  What component are you using? 
 
  Most list based classes have a ListData property passed into 
 itemRenderers.  You can extend ListData to contain your custom data, and 
 extend the List class to use your new ListData class with new data. 
  You could also pass in the relevant data as part of your itemRenderer's 
 data object. 
 

-- 
View this message in context: 
http://old.nabble.com/Passing-an-object-to-a-rendererProvider-tp26396466p26408398.html
Sent from the FlexCoders mailing list archive at Nabble.com.



RE: [flexcoders] [SPAM] Re: Passing an object to a rendererProvider

2009-11-18 Thread InvertedSpear

My understanding of it all is pretty negligible. I found an example similar
to what I wanted to do online, then modified it just a little to make it
work. My problem was I needed the Summary rows to display text
(templateType), but I also needed them to sort based on a different field
(templateTypeID). I couldn't figure out how to tell it to sort on one, but
display the other. My little hack works, but if I could somehow send the
text to the renderer along with the int, or still have it sort on the int
and only send the text I would at least feel like I'm doing it the right way
instead of duct-taping it. 


If it will help here are some relevant code samples.

here's the grid calling the renderer

mx:AdvancedDataGrid defaultLeafIcon={null} folderClosedIcon={null}
folderOpenIcon={null}
displayItemsExpanded=true id=gridTemplates left=10 right=10
top=10 bottom=50 click=gridClick();

mx:dataProvider
mx:GroupingCollection id=gc source={acTemplates}
mx:Grouping
mx:GroupingField name=templateTypeID
mx:SummaryRow summaryPlacement=group
mx:fields
mx:SummaryField dataField=templateTypeID
label=templateTypeID /
/mx:fields
/mx:SummaryRow
/mx:GroupingField
/mx:Grouping
/mx:GroupingCollection
/mx:dataProvider
mx:columns
mx:AdvancedDataGridColumn dataField=name headerText=Formal 
Name
width=280/  
mx:AdvancedDataGridColumn dataField=abbreviation 
headerText=Short
Name width=150/
mx:AdvancedDataGridColumn dataField=insertDate 
headerText=Date
Created width=150/
mx:AdvancedDataGridColumn dataField=templateID width=0
visible=false/
/mx:columns
mx:rendererProviders
mx:AdvancedDataGridRendererProvider dataField=templateTypeID
 columnIndex=0
 columnSpan=0
 depth=1
 renderer=SummaryRenderer/
/mx:rendererProviders

/mx:AdvancedDataGrid

and here's what I'm doing in the renderer

?xml version=1.0 encoding=utf-8?
mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml;
backgroundColor=#BB
mx:Label id=rowLabel textAlign=center width=100%
mx:Script
![CDATA[

override public function set data( value:Object ):void
{
import mx.controls.Alert;
super.data = value;
var items:Array =
parentApplication.getChildByName(pubData).text.split(|);
var obj:Object = new Object();
for (var i:String in items){
var props:Array = items[i].split(:);
obj[props[0]] = props[1];
}
   
   
//Alert.show(parentApplication.objTemplate_ID[1].templateType.toString());
// set the html text
rowLabel.htmlText =  + obj[data.GroupLabel] + ;
}
]]
/mx:Script
/mx:Label
/mx:Canvas




Tracy Spratt-2 wrote:
 
 When (in its life cycle) do you need this object in the renderer?  What
 does
 it do?  When is it initialized or updated?
 
 Do you have a good understanding of itemRenderer recycling?  Typically,
 there are two kinds of data in a renderer.  Static data, which can be
 compiled in, and item data, which comes from the dataProvider item. 
 Dynamic
 data that is not from the item raises questions.
 
 Tracy Spratt,
 
 Lariat Services, development services available
 

-- 
View this message in context: 
http://old.nabble.com/Passing-an-object-to-a-rendererProvider-tp26396466p26412742.html
Sent from the FlexCoders mailing list archive at Nabble.com.



Re: [flexcoders] XML e4x error

2009-11-18 Thread InvertedSpear

The only thing I can see in the one that is giving you a problem is different
from the others is there is a text / tag. The one above it has a
text/text pair. This could be being read as a null text instead of a 0
length string. Try changing that and let us know.

~Mike

Daniel Freiman wrote:
 
 I'm running the following line of code on XML objects and getting
 inconsistent results:
 
 data.path[...@d[0]
 
 In 3 cases, I get a valid answer.  In the last case, data.path[0] == null
 and thus errors.
 Can anyone see any difference?
 The valid XML are:
 
 g transform=matrix(0 -1 1 0 50 112.5) improv:classname=image
 id=Object07B xmlns=http://www.w3.org/2000/svg; xmlns:pdf=
 http://ns.adobe.com/pdf/2006; xmlns:xlink=http://www.w3.org/1999/xlink;
 xmlns:improv=http://ns.colorquick.com/improv/mars;
   image height=75 width=75 x=12.5 xlink:href=/images/Smiley.png
 y=150 improv:rotation=-90/
   path d=M 12.5 150  L 87.5 150  L 87.5 75  L 12.5 75  C 22.5 65 22.5
 160
 12.5 150 stroke-width=0 improv:classname=border/
 /g
 g transform=matrix(1 0 0 1 150 112.5) improv:classname=image
 id=ObjectD6B xmlns=http://www.w3.org/2000/svg; xmlns:pdf=
 http://ns.adobe.com/pdf/2006; xmlns:xlink=http://www.w3.org/1999/xlink;
 xmlns:improv=http://ns.colorquick.com/improv/mars;
   image height=75 width=75 x=112.5 xlink:href=/images/Smiley.jpg
 y=75 improv:rotation=0/
   path d=M 112.5 75  L 187.5 75  L 187.5 150  L 112.5 150  C 122.5 140
 122.5 85 112.5 75 stroke-width=0 improv:classname=border/
 /g
 g transform=matrix(1 0 0 1 10 430) improv:classname=text
 id=Object817
 xmlns=http://www.w3.org/2000/svg;
 xmlns:pdf=http://ns.adobe.com/pdf/2006;
 xmlns:xlink=http://www.w3.org/1999/xlink; xmlns:improv=
 http://ns.colorquick.com/improv/mars;
   text fill=rgb(0,0,0) font-family=F1 font-size=12 x=10
 y=420.763671875 improv:rotation=0 width=289.9453125
 height=11.26171875Ipsor Lopsumething and other things that will test
 stuff./text
   path d=M 10 420.763671875  L 299.9453125 420.763671875  L 299.9453125
 432.025390625  L 10 432.025390625  L 10 420.763671875 stroke-width=0
 improv:classname=border/
 /g
 
 The XML that throws the error is:
 
 g transform=matrix(1 0 0 1 0 0) improv:classname=text id=ObjectE68
 xmlns=http://www.w3.org/2000/svg;
 xmlns:pdf=http://ns.adobe.com/pdf/2006;
 xmlns:xlink=http://www.w3.org/1999/xlink; xmlns:improv=
 http://ns.colorquick.com/improv/mars;
   text fill=rgb(0,0,0) font-family=Arial font-size=12 x=57.1
 y=185.2 improv:rotation=0 width=97.65 height=92/
   path d=M 57.1 185.2 L 154.75 185.2 L 154.75 277.2 L 57.1 277.2 L 57.1
 185.2 stroke-width=0 improv:classname=border/
 /g
 
 

-- 
View this message in context: 
http://old.nabble.com/XML-e4x-error-tp26415121p26415423.html
Sent from the FlexCoders mailing list archive at Nabble.com.



[flexcoders] Passing an object to a rendererProvider

2009-11-17 Thread InvertedSpear

So I need to pass additional information (an object like an associative
array) to my renderer provider which is stored nicely in a component, but I
can't access any variables in my parent application from the component, only
children. As a work around, I parsed the object variable to text, put it in
an invisible mx:Text control, and parsed it back into an object in my
component.

I feel like a hack because I know this is horribly inefficient and there has
to be a better way, but I couldn't come up with one. 

Thoughts anyone?

~Mike

PS, I did this because I'm using a summary row in an advancedDataGrid to
divide it into sections, but I don't want to sort by the lable of each
section (which seems to be the default) but by an ID. My solution was to
pass it the ID which will sort it correctly then pull the correct lable text
out of my object with that ID. It works perfectly like it is but does anyone
know the Right way to do this?
-- 
View this message in context: 
http://old.nabble.com/Passing-an-object-to-a-rendererProvider-tp26396466p26396466.html
Sent from the FlexCoders mailing list archive at Nabble.com.



Re: [flexcoders] Problem sorting advancedDataGrid after dataprovider updated

2009-11-16 Thread InvertedSpear

I'm bumping this post because I am really needing an answer ASAP. At this
point I'm just hoping my boss doesn't notice.

ANY help will be appreciated.
-- 
View this message in context: 
http://old.nabble.com/Problem-sorting-advancedDataGrid-after-dataprovider-updated-tp26326531p26374637.html
Sent from the FlexCoders mailing list archive at Nabble.com.



Re: [flexcoders] Problem sorting advancedDataGrid after dataprovider updated

2009-11-16 Thread InvertedSpear


valdhor-3 wrote:
 
 Could you post some sample data arrays. It's not too easy to try out your
 code without it.
 
Sure here's some for the first two httpServices I'm running. The third isn't
necesary since that code isn't called untill after this problem presents
itself.

*
getPHPvars:
?xml version=1.0 encoding=UTF-8 ? 
  rows
row
  userID11001/userID 
  enterpriseID1/enterpriseID 
  communityID1/communityID 
  clinicID15/clinicID 
  isSuperUser0/isSuperUser  
/row
  /rows
**
getTemplates:
?xml version=1.0 encoding=UTF-8 ? 
  rows
row
  namebreast lump/name 
  insertDate05/03/2004/insertDate 
  templateID33/templateID 
  abbreviationbreast lmp/abbreviation 
  templateTypeID1/templateTypeID 
  templateTypeNew Problem/templateType 
/row
row
  nameupper respiratory symptoms/name 
  insertDate05/03/2004/insertDate 
  templateID3/templateID 
  abbreviationuri/abbreviation 
  templateTypeID1/templateTypeID 
  templateTypeNew Problem/templateType 
/row
row
  namechange in bowel habits/name 
  insertDate05/03/2004/insertDate 
  templateID35/templateID 
  abbreviationchang-bowels/abbreviation 
  templateTypeID1/templateTypeID 
  templateTypeNew Problem/templateType 
/row
  /rows
***


Thanks again



-- 
View this message in context: 
http://old.nabble.com/Problem-sorting-advancedDataGrid-after-dataprovider-updated-tp26326531p26375403.html
Sent from the FlexCoders mailing list archive at Nabble.com.



Re: [flexcoders] Problem sorting advancedDataGrid after dataprovider updated

2009-11-16 Thread InvertedSpear

My app isn't crashing at this point, maybe it's a difference of which SDK we
are running, or more likely some specific issue of environment, but when I
click another tab it runs the HTTPService and repopulates the Grid. It's
only after that repopulation that I loose the ability to sort the data.

Thanks for looking into it though. 



valdhor-3 wrote:
 
 It looks like you have a bug. When I click on the Enterprise Library
 tab, the HTTPService is invoked and the data is returned. Then inside your
 getTemplates_result function it crashes with a null object reference when
 you try to do gc.refresh().
 
 I would check why the app crashes here (I don't have time to debug your
 code).
 

-- 
View this message in context: 
http://old.nabble.com/Problem-sorting-advancedDataGrid-after-dataprovider-updated-tp26326531p26378551.html
Sent from the FlexCoders mailing list archive at Nabble.com.



Re: [flexcoders] Problem sorting advancedDataGrid after dataprovider updated

2009-11-16 Thread InvertedSpear

Ok, we are running the same SDK. Lets try to explore what you are
identifying. Please forgive me as I am pretty new to FLEX and AS. gc is the
id of a GroupingCollection of a dataProvider. refresh() is a built-in public
method to GroupingCollections. How can that be a problem unless it's a bug
in the FLEX SDK itself? Further more, it runs fine on the initial call that
populates the data the first time. It's the exact same function running with
different data when the tab is clicked, why would it not cause a problem the
first time but does all subsequent times? 

I'm not doubting that this may be the problem, but if it is, I have no Idea
where to start to fix it. 

Thanks again.

valdhor-3 wrote:
 
 I am running SDK 3.4.
 
 I still believe that is the crux of the problem. You can't sort because
 the gc.refresh() is not working properly.
 

-- 
View this message in context: 
http://old.nabble.com/Problem-sorting-advancedDataGrid-after-dataprovider-updated-tp26326531p26379293.html
Sent from the FlexCoders mailing list archive at Nabble.com.



Re: [flexcoders] Problem sorting advancedDataGrid after dataprovider updated

2009-11-16 Thread InvertedSpear

If I remove the whole mx:dataProvider tag and add the dataProvider
attribute to the mx:advancedDataGrid tag with the value of
{xmllTemplates} then I can sort, change tabs and am still able to sort, so
It does seem to be something about the groupingCollection. 

I have no idea how I would monitor the collectionEvent.CHANGE event. I tried
to google up some examples on it, but anything I could find was WAY over my
head. Is there some simple way to do this?

Thanks again for taking the time with me, I know you probably have better
things to be doing. 


valdhor-3 wrote:
 
 So, if you try it without the grouping collection, does it work?
 
 Are you monitoring the collectionevent.CHANGE event? What happens when the
 collection changes?
 

-- 
View this message in context: 
http://old.nabble.com/Problem-sorting-advancedDataGrid-after-dataprovider-updated-tp26326531p26379910.html
Sent from the FlexCoders mailing list archive at Nabble.com.



Re: [flexcoders] Problem sorting advancedDataGrid after dataprovider updated

2009-11-16 Thread InvertedSpear

Problem Solved... I guess.


I was turning my HTTPService result into an XMLList. I just switched it to
an arrayCollection and I no longer loose the ability to sort when I refresh
the data. 

Maybe there is some limitation when using an XMLList, I wish I could have
found out for sure, but at least I have a working product now.

Lesson Learned: use arrayCollection, it's apparently a superior veriable
type.

Thanks for all the help and time valdhor.
-- 
View this message in context: 
http://old.nabble.com/Problem-sorting-advancedDataGrid-after-dataprovider-updated-tp26326531p26379929.html
Sent from the FlexCoders mailing list archive at Nabble.com.



[flexcoders] Problem sorting advancedDataGrid after dataprovider updated

2009-11-13 Thread InvertedSpear

Anyone know about this?

My data comes in, and I can sort just fine, I refresh my dataProvider (pulls
a different query) and then I can't sort anymore, even if I go back and pull
the original data again. I have been searching and searching for a post on
correcting this issue but can't find one.

Here's the code, I hope someone can help me.
~Mike
*
?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute 
creationComplete=init();
mx:Script
![CDATA[
import mx.events.ItemClickEvent;
import mx.collections.ArrayCollection;
import mx.collections.XMLListCollection;
import mx.utils.ArrayUtil;
import mx.rpc.events.*;
import mx.controls.Alert;
import mx.collections.HierarchicalData;
import mx.utils.ObjectProxy;
import mx.collections.Sort;
import mx.collections.SortField;

[Bindable] private var xmllTemplates:XMLList = new 
XMLList();
[Bindable] private var templateDetails:XMLList = new 
XMLList();
[Bindable] private var curLibLevel:String = new 
String(enterprise);
[Bindable] private var usrLevel:String = new 
String(enterprise);
[Bindable] private var session:ObjectProxy = new 
ObjectProxy({

userID:,enterpriseID:,communityID:,clinicID:,specialtyID:,dsn:,clinicName:,isSuperUser:,name:
});
[Bindable] private var arcLibraries:ArrayCollection = 
new
ArrayCollection([{label:User Library, level:user},
{label:Enterprise Library, 
level:enterprise},{label:System
Library, level:system}]); 

private function init():void{
getPhpVars.send();
}
private function postInit():void{
getTemplates.send();
vwSelectBtnSettings();
userLevelChange();
}

private function 
getTemplates_fault(evt:FaultEvent):void {
var title:String = evt.type +  ( + evt.fault.faultCode +
);
var text:String = evt.fault.faultString;
Alert.show(text,title);
xmllTemplates = new XMLList();
}

private function getTemplates_result(evt:ResultEvent):void {
xmllTemplates = evt.result.row;
gc.refresh();
   
}
private function generic_fault(evt:FaultEvent):void {
var title:String = evt.type +  ( + evt.fault.faultCode +
);
var text:String = evt.fault.faultString;
Alert.show(text,title);
}

private function getPhpVars_result(evt:ResultEvent):void {
var sessionVars:XMLList = new XMLList();
sessionVars = evt.result.row;
for each(var i:XML in sessionVars.children()){
session[i.localName()] = i;
}
postInit();
}
private function getTemplateDetail_result(evt:ResultEvent):void
{
templateDetails = evt.result.row;
accComponents.removeAllChildren();
for each(var i:XML in templateDetails){
if(accComponents.getChildByName(i.child(component))){

}else{
var newCanv:Canvas = new Canvas();
newCanv.id = i.child(component);
newCanv.label = i.child(componentName);
accComponents.addChild(newCanv);
}
}
//Alert.show(templateDetails.toString());
}  

private function tabLibClick(evt:ItemClickEvent):void{
gridTemplates.selectedIndex=-1;
var targetComp:TabBar = 
TabBar(evt.currentTarget);
curLibLevel = 
targetComp.dataProvider[evt.index].level;
getTemplates.send();
vwSelectBtnSettings();
}
private function vwSelectBtnSettings():void{
if(gridTemplates.selectedIndex-1){
if(curLibLevel == usrLevel){

Re: [flexcoders] Flex Data Grid Question

2009-11-12 Thread InvertedSpear


droponrcll wrote:
 
 
 Set the treeColumn to an AdvancedDataGridColumn with 0 width?
 
 
I tried that, It still gets about a 20pixel width, and forces itself onto
the page. You did get my mind to click and search for something new which
actually turned up an example that is exactly what I needed and solves the
OPs problem as well. So good job there :clap:

http://www.robrusher.com/2008/06/26/flex-3-advanceddatagrid-summary-divider/comment-page-1/#comment-53


@Balki:
You're going to have to play with the item renderer, set its rowspan instead
of it's colspan. I'm not sure how to do it, but you should be able to
experiment with that a bit. Also, check that link and see if that might help
you to.
-- 
View this message in context: 
http://old.nabble.com/Flex-Data-Grid-Question-tp23766210p26321791.html
Sent from the FlexCoders mailing list archive at Nabble.com.



Re: [flexcoders] Flex Data Grid Question

2009-11-11 Thread InvertedSpear

Apologies for resurrecting a somewhat old thread, but since my searches
turned me up here and I spent several hours today working on this issue I
thought it would be appropriate.

Here's is the code I came up with that mostly solves this.
My source data is just a basic XMLListCollection. 
The renderer colSpanningHeader is a basic label component. I did nothing
but make it align center

***
mx:AdvancedDataGrid id=gridTemplates left=10 right=10 top=10
bottom=50
mx:dataProvider
mx:GroupingCollection id=gc source={xmllTemplates}
mx:Grouping
mx:GroupingField name=templateType

/mx:GroupingField
/mx:Grouping
/mx:GroupingCollection
/mx:dataProvider
mx:columns
mx:AdvancedDataGridColumn id=hidCol headerText= width=0
visible=True/  
mx:AdvancedDataGridColumn dataField=name headerText=Formal 
Name
width=280/  
mx:AdvancedDataGridColumn dataField=abbreviation 
headerText=Short
Name width=150/
mx:AdvancedDataGridColumn dataField=insertDate 
headerText=Date
Created width=150/
/mx:columns
mx:rendererProviders
mx:AdvancedDataGridRendererProvider column={hidCol} depth=1
columnSpan=4 
renderer=colSpanningHeader/
/mx:rendererProviders
/mx:AdvancedDataGrid
***

I find one problem with this, I can't completely get rid of the first
column. It makes my grid look a little tacky. 

Anyone out there know how I can get this same method of grouping without
showing the first column? I don't want a folder tree, I just want a header
row for each group.
Thanks
~mike




guess what wrote:
 
 
 I need to draw a data grid where I need to do paint subtotals and and page
 total and group by some category . Can anyone provide me witha same xml
 for this kind of table 
 
   Item IDName   Qty  Price 

   Milk --- This is how it should be milk should be
 first row [Just a blank row with Milk in it ]
 
1. Soy Milk  l5USD
2. Choclate  215USD
 
   SubTotal   20 USD [ Again Blank row ]
 
   Water [ Again Blank Row ]

1.  Aqua   1 10USD
2.  Calistoga  1 10USD
 
   SubTotal   20 USD [ Again Blank row ]
 
   PurchaseTotal  40 USD [ Again Blank row ]
 
 
 Can someone provide with an xml for this type of table in flex . Is it
 possible .
 

-- 
View this message in context: 
http://old.nabble.com/Flex-Data-Grid-Question-tp23766210p26293126.html
Sent from the FlexCoders mailing list archive at Nabble.com.



Re: [flexcoders] Flex Data Grid Question

2009-11-11 Thread InvertedSpear

I'm not sure how to group in the way you're wishing it, but I am sure that it
can be done. I think the trick is with the item renderers. Which is
something I just learned about. Here's my entire code, Sorry I can't release
the entire http service since it's to a protected site, but it pulls back a
basic XML file formatted like so:
rows
  row
nameBob/name
otherother value/other
  /row
/rows

Main App MXML:
**
?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute 
creationComplete=init();
mx:Script
![CDATA[
import mx.events.ItemClickEvent;
import mx.collections.ArrayCollection;
import mx.collections.XMLListCollection;
import mx.utils.ArrayUtil;
import mx.rpc.events.*;
import mx.controls.Alert;
import mx.collections.HierarchicalData;

[Bindable] private var arcLibraries:ArrayCollection = 
new
ArrayCollection();
[Bindable] private var xmllTemplates:XMLList = new 
XMLList();
[Bindable] private var curLibLevel:String = new 
String(enterprise);
[Bindable] private var usrLevel:String = new 
String(enterprise);

private function init():void{
changeUserID();
getTemplates.send();
vwSelectBtnSettings();
}

private function changeUserID():void{
if(Boolean(Number(userID.text))){
arcLibraries = new ArrayCollection([
{label:User Library, level:user},
{label:Enterprise Library, 
level:enterprise},
{label:System Library, level:system}
]); 
usrLevel = 'user';
} else{
arcLibraries = new ArrayCollection([
{label:Enterprise Library, 
level:enterprise},
{label:System Library, level:system}
]);
usrLevel = 'enterprise';
}
vwSelectBtnSettings();
}

//on click will change user id to a valid value
private function defaultUserID():void{
if (userID.text == '0'){userID.text= 
'11001'}else{userID.text= '0'};
changeUserID();
}

private function httpService_fault(evt:FaultEvent):void 
{
var title:String = evt.type +  ( + evt.fault.faultCode +
);
var text:String = evt.fault.faultString;
Alert.show(text,title);
xmllTemplates = new XMLList();
}

private function httpService_result(evt:ResultEvent):void {
xmllTemplates = evt.result.row;
gc.refresh();
gridTemplates.validateNow();
for (var i:int=gridTemplates.numChildren;i-1;i--){
gridTemplates.selectedIndex=i;

gridTemplates.expandItem(gridTemplates.selectedItem,true);
}
gridTemplates.selectedIndex=-1;
}

private function tabLibClick(evt:ItemClickEvent):void{
var targetComp:TabBar = 
TabBar(evt.currentTarget);
curLibLevel = 
targetComp.dataProvider[evt.index].level;
getTemplates.send();
vwSelectBtnSettings();
}
private function vwSelectBtnSettings():void{
if(curLibLevel == usrLevel)

{btnNew.enabled=btnEdit.enabled=btnHide.visible=true;btnAdopt.visible=false;btnEdit.label='Edit';}

else{btnNew.enabled=btnEdit.enabled=btnHide.visible=false;btnAdopt.visible=true;btnEdit.label='View';}
}
private function gridClick():void{
var msg:String = new String();
msg = 
XML(gridTemplates.selectedItem).child(templateID);