[flexcoders] Re: daylight savings time and charts
Well, I think I've figured out the problem. I didn't notice it before but on the mxml chart I was using dataUnits and on the AS chart I was using labelUnits. It looks like labelUnits are the culprit because when I switched the AS to this, if finally rendered correctly. I haven't tested it extensively, but for now, it looks like that is working. --- In flexcoders@yahoogroups.com, netdeep deep...@... wrote: I have an app which displays any type of chart based on actionscript class definitions. It can't be done in mxml because the charts get drawn at runtime. It has worked fine until recently. The daylight savings time change has made it go all out of whack. I rebuilt a sample version in mxml however and it displays correctly. I've attempted to mimic this in a hard coded actionscript version as well but it just doesn't work. In the code below, the columnWidthRatio is set to 1.1 so that the columns slightly overlap, but in the actionscript version, the bars are tiny with wide gaps between them. Also, if I set the labelUnits to 'hours', the chart won't work at all. It won't even draw anything, but just times out. I am using Flex 3.3 on a Mac. I've also tried Flex 3.5a but it didn't work with that either. [Bindable] public var DECKER:Array = [ {point1:Tue Mar 16 00:00:00 GMT-0400 2010, point2:6.021350380920805}, {point1:Mon Mar 15 00:00:00 GMT-0400 2010, point2:12.432308140005917}, {point1:Sun Mar 14 00:00:00 GMT-0500 2010, point2:19.558957234168425} ]; // actionscript version which doesn't work public function makeDateChart(genericChart:CartesianChart, genericLegend:Legend, chartPanel:ChartPanel, chart:ChartObject):void { // ChartObject is a custom object which holds display information // as well as al the SeriesObjects (see below) var axisList:ArrayCollection = chart.getAxisList(); var seriesArray:Array = new Array(); var hAxis:DateTimeAxis = new DateTimeAxis(); for (var i:int=0; iaxisList.length; i++) { var axis:AxisObject = axisList.getItemAt(i) as AxisObject; if (axis.getID() == x Axis) { hAxis.labelUnits = days; genericChart.horizontalAxis = hAxis; } else { // Define vertical axis var vAxis:LinearAxis = new LinearAxis(); genericChart.verticalAxis = vAxis; for (var j:int=0; jaxis.getSeriesList().length; j++) { // custom data object which holds data and display settings var ser:SeriesObject = axis.getSeriesList().getItemAt(j) as SeriesObject; var columnSeries:ColumnSeries = new ColumnSeries(); // bind data...It doesn't matter if I bind 'pointList' or DECKER to this // either way it doesn't work for columnSeries- it does work for the // mxml object testCol (see prev post for static version of chart) BindingUtils.bindProperty(columnSeries, dataProvider, this, DECKER); BindingUtils.bindProperty(colSer, dataProvider, this, DECKER); // pointList would be used for the dynamic version // BindingUtils.bindProperty(columnSeries, dataProvider, ser, pointList); // BindingUtils.bindProperty(colSer, dataProvider, ser, pointList); columnSeries.columnWidthRatio = 1.1; //columnSeries.displayName = ser.name; columnSeries.xField=point1; columnSeries.yField=point2; seriesArray.push(columnSeries); } } } genericChart.series = seriesArray;//.toArray().reverse
[flexcoders] Re: daylight savings time and charts
A further note, the dataUnits seem to work for columnSeries, but not for plotSeries. Or it could be just setting the units to hours that is the problem. I'm looking into it further. It would be great to get some confirmation that this is fixed in Flex 4. --- In flexcoders@yahoogroups.com, netdeep deep...@... wrote: Well, I think I've figured out the problem. I didn't notice it before but on the mxml chart I was using dataUnits and on the AS chart I was using labelUnits. It looks like labelUnits are the culprit because when I switched the AS to this, if finally rendered correctly. I haven't tested it extensively, but for now, it looks like that is working. --- In flexcoders@yahoogroups.com, netdeep deepnet@ wrote: I have an app which displays any type of chart based on actionscript class definitions. It can't be done in mxml because the charts get drawn at runtime. It has worked fine until recently. The daylight savings time change has made it go all out of whack. I rebuilt a sample version in mxml however and it displays correctly. I've attempted to mimic this in a hard coded actionscript version as well but it just doesn't work. In the code below, the columnWidthRatio is set to 1.1 so that the columns slightly overlap, but in the actionscript version, the bars are tiny with wide gaps between them. Also, if I set the labelUnits to 'hours', the chart won't work at all. It won't even draw anything, but just times out. I am using Flex 3.3 on a Mac. I've also tried Flex 3.5a but it didn't work with that either. [Bindable] public var DECKER:Array = [ {point1:Tue Mar 16 00:00:00 GMT-0400 2010, point2:6.021350380920805}, {point1:Mon Mar 15 00:00:00 GMT-0400 2010, point2:12.432308140005917}, {point1:Sun Mar 14 00:00:00 GMT-0500 2010, point2:19.558957234168425} ]; // actionscript version which doesn't work public function makeDateChart(genericChart:CartesianChart, genericLegend:Legend, chartPanel:ChartPanel, chart:ChartObject):void { // ChartObject is a custom object which holds display information // as well as al the SeriesObjects (see below) var axisList:ArrayCollection = chart.getAxisList(); var seriesArray:Array = new Array(); var hAxis:DateTimeAxis = new DateTimeAxis(); for (var i:int=0; iaxisList.length; i++) { var axis:AxisObject = axisList.getItemAt(i) as AxisObject; if (axis.getID() == x Axis) { hAxis.labelUnits = days; genericChart.horizontalAxis = hAxis; } else { // Define vertical axis var vAxis:LinearAxis = new LinearAxis(); genericChart.verticalAxis = vAxis; for (var j:int=0; jaxis.getSeriesList().length; j++) { // custom data object which holds data and display settings var ser:SeriesObject = axis.getSeriesList().getItemAt(j) as SeriesObject; var columnSeries:ColumnSeries = new ColumnSeries(); // bind data...It doesn't matter if I bind 'pointList' or DECKER to this // either way it doesn't work for columnSeries- it does work for the // mxml object testCol (see prev post for static version of chart) BindingUtils.bindProperty(columnSeries, dataProvider, this, DECKER); BindingUtils.bindProperty(colSer, dataProvider, this, DECKER); // pointList would be used for the dynamic version // BindingUtils.bindProperty(columnSeries, dataProvider, ser, pointList); // BindingUtils.bindProperty(colSer, dataProvider, ser, pointList); columnSeries.columnWidthRatio = 1.1; // columnSeries.displayName = ser.name; columnSeries.xField=point1
[flexcoders] daylight savings time and charts
I have an app which displays any type of chart based on actionscript class definitions. It can't be done in mxml because the charts get drawn at runtime. It has worked fine until recently. The daylight savings time change has made it go all out of whack. I rebuilt a sample version in mxml however and it displays correctly. I've attempted to mimic this in a hard coded actionscript version as well but it just doesn't work. In the code below, the columnWidthRatio is set to 1.1 so that the columns slightly overlap, but in the actionscript version, the bars are tiny with wide gaps between them. Also, if I set the labelUnits to 'hours', the chart won't work at all. It won't even draw anything, but just times out. I am using Flex 3.3 on a Mac. I've also tried Flex 3.5a but it didn't work with that either. [Bindable] public var DECKER:Array = [ {point1:Tue Mar 16 00:00:00 GMT-0400 2010, point2:6.021350380920805}, {point1:Mon Mar 15 00:00:00 GMT-0400 2010, point2:12.432308140005917}, {point1:Sun Mar 14 00:00:00 GMT-0500 2010, point2:19.558957234168425} ]; // actionscript version which doesn't work public function makeDateChart(genericChart:CartesianChart, genericLegend:Legend, chartPanel:ChartPanel, chart:ChartObject):void { // ChartObject is a custom object which holds display information // as well as al the SeriesObjects (see below) var axisList:ArrayCollection = chart.getAxisList(); var seriesArray:Array = new Array(); var hAxis:DateTimeAxis = new DateTimeAxis(); for (var i:int=0; iaxisList.length; i++) { var axis:AxisObject = axisList.getItemAt(i) as AxisObject; if (axis.getID() == x Axis) { hAxis.labelUnits = days; genericChart.horizontalAxis = hAxis; } else { // Define vertical axis var vAxis:LinearAxis = new LinearAxis(); genericChart.verticalAxis = vAxis; for (var j:int=0; jaxis.getSeriesList().length; j++) { // custom data object which holds data and display settings var ser:SeriesObject = axis.getSeriesList().getItemAt(j) as SeriesObject; var columnSeries:ColumnSeries = new ColumnSeries(); // bind data...It doesn't matter if I bind 'pointList' or DECKER to this // either way it doesn't work for columnSeries- it does work for the // mxml object testCol (see prev post for static version of chart) BindingUtils.bindProperty(columnSeries, dataProvider, this, DECKER); BindingUtils.bindProperty(colSer, dataProvider, this, DECKER); // pointList would be used for the dynamic version // BindingUtils.bindProperty(columnSeries, dataProvider, ser, pointList); // BindingUtils.bindProperty(colSer, dataProvider, ser, pointList); columnSeries.columnWidthRatio = 1.1; // columnSeries.displayName = ser.name; columnSeries.xField=point1; columnSeries.yField=point2; seriesArray.push(columnSeries); } } } genericChart.series = seriesArray;//.toArray().reverse(); genericChart.percentWidth = 100; genericChart.showDataTips = true; var hb:HBox = new HBox(); hb.addChild(genericChart); this.addChild(hb); } !-- mxml version which works -- mx:HBox backgroundColor=white
[flexcoders] Re: daylight savings time and charts
Thanks for the reply. I was really hoping the new builds would fix the problem but they didn't. Even if they had, both 3.4 and 3.5a exhibit another bug which ruins my app. Whenever I refresh the data, the chart goes into some weird loop, redrawing its axis labels over and over again which makes them flash. Was your chart done in actionscript? I wonder why it worked for you. There is definitely a bug in there somewhere though. I never had any problems before this. --- In flexcoders@yahoogroups.com, Richard Rodseth rrods...@... wrote: Sorry, I missed that you'd tried 3.5a. It did fix my problem. On Wed, Mar 17, 2010 at 8:47 AM, Richard Rodseth rrods...@... wrote: I posted about this recently, but it hasn't shown up. Turns out there's a bug in DateTimeAxis, fixed in 3.4 http://bugs.adobe.com/jira/browse/FLEXDMV-2043 On Wed, Mar 17, 2010 at 5:53 AM, netdeep deep...@... wrote: I have an app which displays any type of chart based on actionscript class definitions. It can't be done in mxml because the charts get drawn at runtime. It has worked fine until recently. The daylight savings time change has made it go all out of whack. I rebuilt a sample version in mxml however and it displays correctly. I've attempted to mimic this in a hard coded actionscript version as well but it just doesn't work. In the code below, the columnWidthRatio is set to 1.1 so that the columns slightly overlap, but in the actionscript version, the bars are tiny with wide gaps between them. Also, if I set the labelUnits to 'hours', the chart won't work at all. It won't even draw anything, but just times out. I am using Flex 3.3 on a Mac. I've also tried Flex 3.5a but it didn't work with that either. [Bindable] public var DECKER:Array = [ {point1:Tue Mar 16 00:00:00 GMT-0400 2010, point2:6.021350380920805}, {point1:Mon Mar 15 00:00:00 GMT-0400 2010, point2:12.432308140005917}, {point1:Sun Mar 14 00:00:00 GMT-0500 2010, point2:19.558957234168425} ]; // actionscript version which doesn't work public function makeDateChart(genericChart:CartesianChart, genericLegend:Legend, chartPanel:ChartPanel, chart:ChartObject):void { // ChartObject is a custom object which holds display information // as well as al the SeriesObjects (see below) var axisList:ArrayCollection = chart.getAxisList(); var seriesArray:Array = new Array(); var hAxis:DateTimeAxis = new DateTimeAxis(); for (var i:int=0; iaxisList.length; i++) { var axis:AxisObject = axisList.getItemAt(i) as AxisObject; if (axis.getID() == x Axis) { hAxis.labelUnits = days; genericChart.horizontalAxis = hAxis; } else { // Define vertical axis var vAxis:LinearAxis = new LinearAxis(); genericChart.verticalAxis = vAxis; for (var j:int=0; jaxis.getSeriesList().length; j++) { // custom data object which holds data and display settings var ser:SeriesObject = axis.getSeriesList().getItemAt(j) as SeriesObject; var columnSeries:ColumnSeries = new ColumnSeries(); // bind data...It doesn't matter if I bind 'pointList' or DECKER to this // either way it doesn't work for columnSeries- it does work for the // mxml object testCol (see prev post for static version of chart) BindingUtils.bindProperty(columnSeries, dataProvider, this, DECKER); BindingUtils.bindProperty(colSer, dataProvider, this, DECKER); // pointList would be used for the dynamic version // BindingUtils.bindProperty(columnSeries, dataProvider, ser, pointList); // BindingUtils.bindProperty(colSer, dataProvider, ser, pointList); columnSeries.columnWidthRatio = 1.1; // columnSeries.displayName = ser.name; columnSeries.xField=point1; columnSeries.yField=point2; seriesArray.push(columnSeries); } } } genericChart.series = seriesArray;//.toArray().reverse(); genericChart.percentWidth = 100; genericChart.showDataTips = true; var hb:HBox = new HBox(); hb.addChild(genericChart); this.addChild(hb); } !-- mxml version which works -- mx:HBox backgroundColor=white mx:CartesianChart showDataTips=true id=testCol mx:horizontalAxis mx:DateTimeAxis labelFunction=fullTimeLabelFunction dataUnits=days/ /mx:horizontalAxis mx:verticalAxis mx:LinearAxis / /mx:verticalAxis mx:series mx:ColumnSeries id=colSer columnWidthRatio=1.1 yField=point2 xField=point1 displayName=points/ /mx:series /mx:CartesianChart /mx:HBox
[flexcoders] Blazeds messaging from java to java
I know BlazeDS allows flex to communicate with server technology, but what if I want to communicate from a java class. How do I send my channel (which I've already set up and defined in the messaging-config file) a message and also hear back from the same channel? I can create messages like this: String clientID = UUIDUtils.createUUID(); AsyncMessage message = new AsyncMessage(); message.setDestination(airBridge); message.setClientId(clientID); message.setMessageId(UUIDUtils.createUUID()); message.setTimestamp(System.currentTimeMillis()); // this header info is not currently being used TreeMap String, StringhMap = new TreeMapString, String(); hMap.put(secureID, general); hMap.put(reportID, repID); message.setHeaders(hMap); // but I can't create this because I am not a ServiceAdaptor- I don't have the // getDestination() method. MessageService service = (MessageService)getDestination().getService(); // And even if I could get the service, how do I send it to a specific channel? // And if I send a message how do I hear back from the channel? The message needs to get sent from a servlet to the ServiceAdapter (messaging channel) which will in turn propagate that out to other apps, get a result and send confirmation that the process completed successfully back to the servlet. How can this be done?
[flexcoders] AlivePDF 0.1.4.9 not generating pdf
Does anyone here have experience with AlivePDF? I am using 0.1.4.9. in Flex (tried both 3.0 and 3.3) and nothing happens. I tried it with create.php, create.java, and looked into saving it with Flash Player 10 (but couldn't find any real documentation on how to make that work). I just get a blank new browser window. No error message, no anything. I add the swc file to my library path, used the turotial sample code and still nothing happens: myPDF = new PDF(); var page:Page = new Page ( Orientation.PORTRAIT, Unit.MM, Size.A4 ); myPDF.addPage(page); myPDF.lineStyle(new RGBColor(0×99), 1,1,1); myPDF.drawCircle(20,20,20); var path:String = getBaseURL() + /terracotta/create.php; myPDF.save(Method.REMOTE, path, Download.INLINE, viewChart.pdf);
[flexcoders] Configureing AIR app for blazeds messaging
I am trying to get messaging working with my AIR application. I'm converting a Flex application into AIR and everything works in Flex but not in AIR. I can get remoting working, but messaging isn't working. I set up remoting channels at runtime using the examples from this site: http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetailspostId= 9703productId=2 But I can't get it working for messaging. How do I define destinations for AIR at runtime? In Flex, I just define them in the messaging-config.xml file. Here's what I have from the messaging-config.xml file which works in flex: ?xml version=1.0 encoding=UTF-8? service id=message-service class=flex.messaging.services.MessageService adapters adapter-definition id=TCautomation class=factory.AutoWatcher/ adapter-definition id=actionscript class=flex.messaging.services.messaging.adapters.ActionScriptAdapter default=true / /adapters default-channels channel ref=my-polling-amf/ /default-channels destination id=autoWatch adapter ref=TCautomation/ /destination /service And here are my components in mxml: mx:Producer id=reportManager destination=autoWatch/ mx:Consumer id=consumer destination=autoWatch message=messageHandler(event.message)/ Pretty simple for Flex, but how is this done in AIR?
[flexcoders] Re: minorticks and grid lines for charts
Here's what I tried, but it doesn't work: var hAxis:DateTimeAxis = new DateTimeAxis(); hAxis.displayLocalTime = true;); hAxis.labelUnits = hours hAxis.dataInterval = 1; hAxis.minorTickUnits = hours; hAxis.minorTickInterval = 1; var ar:AxisRenderer = new AxisRenderer(); ar.axis = hAxis; ar.setStyle(canDropLabels, true); ar.setStyle(minorTickPlacement, cross); genericChart.horizontalAxisRenderers = [ar]; genericChart.horizontalAxis = hAxis; --- In flexcoders@yahoogroups.com, thomas parquier mailingli...@... wrote: I think you have to use datainterval and labelunit. thomas --- http://www.web-attitude.fr/ msn : thomas.parqu...@... softphone : sip:webattit...@... sip%3awebattit...@... téléphone portable : +33601 822 056 2009/6/4 netdeep deep...@... I have a chart which is created in actionscript with parameters specified by the user. So it needs to be flexible enough to accomodate all kinds of different styles and types of charts. One user would like to display lines on the minor ticks marks at every hour. Complicating matters is the fact that the chart can be resized horizontally which would increase or decrease the space available for such lines. So how do I create a chart which displays grid lines every hour on minor ticks and let's flex display major grid lines for each label. I'm using a DateTimeAxis, by the way. Thanks.
[flexcoders] minorticks and grid lines for charts
I have a chart which is created in actionscript with parameters specified by the user. So it needs to be flexible enough to accomodate all kinds of different styles and types of charts. One user would like to display lines on the minor ticks marks at every hour. Complicating matters is the fact that the chart can be resized horizontally which would increase or decrease the space available for such lines. So how do I create a chart which displays grid lines every hour on minor ticks and let's flex display major grid lines for each label. I'm using a DateTimeAxis, by the way. Thanks.
[flexcoders] Re: Axis titles on CartesianChart blurry, but not on ColumnChart
Perhaps there is there some default anti-aliasing value turned on for CartesianCharts, but not for ColumnCharts? --- In flexcoders@yahoogroups.com, Battershall, Jeff jeff.battersh...@... wrote: Are you embedidng the font for the Axis titles? And if so, is advancedAntiAliasing = true in your @font-face declaration? Jeff -Original Message- From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of netdeep Sent: Tuesday, April 28, 2009 11:28 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Axis titles on CartesianChart blurry, but not on ColumnChart This seems like a bug with Flex which I never noticed until just recently, but the vertical axis titles for CartesianCharts (and LineCharts as well) are blurry at higher resolutions. However this problem is not present with ColumnChart. I had to encode the charts with ImageSnapshot and export them as png files and I set the dpi to 300 and this is when I noticed this glitch. So maybe this also has to do with ImageSnapshot. Have others noticed this problem and is there a way around it? -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf- 1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
[flexcoders] Axis titles on CartesianChart blurry, but not on ColumnChart
This seems like a bug with Flex which I never noticed until just recently, but the vertical axis titles for CartesianCharts (and LineCharts as well) are blurry at higher resolutions. However this problem is not present with ColumnChart. I had to encode the charts with ImageSnapshot and export them as png files and I set the dpi to 300 and this is when I noticed this glitch. So maybe this also has to do with ImageSnapshot. Have others noticed this problem and is there a way around it?
[flexcoders] Re: Axis titles on CartesianChart blurry, but not on ColumnChart
Im' not doing anything with fonts, just something like this: var vAxis:LinearAxis = new LinearAxis(); vAxis.baseAtZero = false; vAxis.title = titleString; var axr:AxisRenderer = new AxisRenderer(); axr.axis = vAxis; renderers.addItem(axr); genericChart.verticalAxisRenderers = renderers.toArray(); And if I make generciChart a ColumnChart it works, and the other charts cause the heavy blurring. The labels and other strings don't blur by the way, just the vertical titles. --- In flexcoders@yahoogroups.com, Battershall, Jeff jeff.battersh...@... wrote: Are you embedidng the font for the Axis titles? And if so, is advancedAntiAliasing = true in your @font-face declaration? Jeff
[flexcoders] DataGrid combobox erasing items from it's list
I have a DataGrid that is linked to an array of custom data objects which I call a seriesList. You are supposed to be able to choose the name of each series via a combobox in the datagrid. It works fine except when the user selects the combobox and then clicks somewhere else in the interface, which closes the combobox and erases whichever item is previously selected! !-- Definition in application -- !-- axis.seriesList is and ArrayCollection of actionscript objects called SeriesObjects which have a var name:String variable -- mx:DataGrid id=seriesTable color=black fontSize=9 rowHeight=30 editable=true resizeEffect=slow rollOverColor=#CC selectionColor=#99 dataProvider={axis.seriesList} width=100% rowCount={axis.seriesList.length 2 ? axis.seriesList.length : 2} mx:columns mx:DataGridColumn dataField=name headerText=Name width=280 headerStyleName=centered id=nameColumn rendererIsEditor=true editorDataField=result itemRenderer=renderer.SeriesBoxRenderer/ /mx:columns /mx:DataGrid !-- SeriesBoxRenderer -- mx:VBox xmlns:mx=http://www.adobe.com/2006/mxml; creationComplete=init() horizontalAlign=center mx:Script ![CDATA[ import mx.collections.ArrayCollection; // Define a property for returning the new value to the cell. public var result:String=; [Bindable] private var dpValue:ArrayCollection; private function init():void { // list of possible names to choose from for this series dpValue = mx.core.Application.application.seriesArray; } // Override the set method for the data property. override public function set data(value:Object):void { if (dpValue == null) init(); super.data = value; if (value != null) { var currentValue:String = value.name; var len:int = dpValue.length; for (var i:int = 0; i len; i++) { if (dpValue[i].name == currentValue) { editor.selectedIndex = i; return; } } } editor.selectedIndex = 0;} public function onChange():void { var index:int = editor.selectedIndex; result = dpValue[index].name; data.name = dpValue[index].name; } ]] /mx:Script mx:ComboBox id=editor textAlign=left labelField=name dataProvider={dpValue} change=onChange()/ /mx:VBox
[flexcoders] building a dataprovider in Java
I posted a few weeks back about how to create a chart dataprovider in Java to pass to Flex and the response I got back was to use Maps. I got sidetracked with other aspects of the code and now that I'm trying to code it, I am really drawing a blank. How would you create the following dataprovider in Java without using a custom object (i.e., the next data structure may have more or less elements than this one and I would need to use generic names for each data pair)? public var expenses:ArrayCollection = new ArrayCollection([ {Month:Jan, Profit:2000, Expenses:1500}, {Month:Feb, Profit:1000, Expenses:200}, {Month:Mar, Profit:1500, Expenses:500} ]);
[flexcoders] verticalscrollbar not showing after addChild
My application accepts input and adds charts to itself via addChild in actionscript. However, no matter how many charts I add, the app never shows a vertical scrollbar until the user manually resizes the browser window. How do I fix this quirk? I found this snippet on the web, but it doesn't work. In fact, when the Alert box pops up, measuredHeight is always less than height so the problem seems to be that flex is not calculating the height correctly. I tried invalidateDisplayList() but that didn't work either. override public function validateSize(recursive:Boolean = false):void { super.validateSize(recursive); if (!initialized) return; Alert.show(ht: +height,measured ht: +measuredHeight); if (height measuredHeight) verticalScrollPolicy = ScrollPolicy.ON; else verticalScrollPolicy = ScrollPolicy.OFF; }
[flexcoders] Re: verticalscrollbar not showing after addChild
Ok, I think I got measuredHeight and height mixed up, measuredHeight IS always larger, so that if I change the code, it detects the need for scroll bars: if (measuredHeight height) verticalScrollPolicy = ScrollPolicy.ON; However, it still just shows the ghost of a verticalScrollbar (while annoyingly showing an unnecessarily horizontal scrollbar!). The vertical scroll isn't actually there, just the gutter for it! What is going on? --- In flexcoders@yahoogroups.com, netdeep deep...@... wrote: My application accepts input and adds charts to itself via addChild in actionscript. However, no matter how many charts I add, the app never shows a vertical scrollbar until the user manually resizes the browser window. How do I fix this quirk? I found this snippet on the web, but it doesn't work. In fact, when the Alert box pops up, measuredHeight is always less than height so the problem seems to be that flex is not calculating the height correctly. I tried invalidateDisplayList() but that didn't work either. override public function validateSize(recursive:Boolean = false):void { super.validateSize(recursive); if (!initialized) return; Alert.show(ht: +height,measured ht: +measuredHeight); if (height measuredHeight) verticalScrollPolicy = ScrollPolicy.ON; else verticalScrollPolicy = ScrollPolicy.OFF; }
[flexcoders] Re: verticalscrollbar not showing after addChild
Ok, sorry for the confusion, disregard the above posts. I've found the problem. I am using a custom Box component to mimic a flow layout. I just needed to set the height to 100% for that component to get it to work properly.
[flexcoders] losing queryString parameters when launching from UNIX prompt
I need to run my flex app on a headless server. I am launching my app via a command line script in Solaris. It works but for some reason, I am losing much needed parameters in my URL by the time it gets to flex. What could be causing this? Command line args for app [/bin/sh, -c, /opt/sfw/bin/firefox http://dev.app.com/direct/Momentum.html?reportID=Rep1channel=Y, :5] queryString.url in Flex: http://dev.app.com/direct/Momentum.html?reportID=Rep1 So how can I get the channel=Y arg back?
[flexcoders] Re: losing queryString parameters when launching from UNIX prompt
Well, I figured it out. You need to put the url in quotation marks. --- In flexcoders@yahoogroups.com, netdeep deep...@... wrote: I need to run my flex app on a headless server. I am launching my app via a command line script in Solaris. It works but for some reason, I am losing much needed parameters in my URL by the time it gets to flex. What could be causing this? Command line args for app [/bin/sh, -c, /opt/sfw/bin/firefox http://dev.app.com/direct/Momentum.html?reportID=Rep1channel=Y, :5] queryString.url in Flex: http://dev.app.com/direct/Momentum.html?reportID=Rep1 So how can I get the channel=Y arg back?
[flexcoders] Re: converting a Java object into a chart dataprovider
Right. I'd like to basically return an array of arrays, visually organized like a spread sheet. So the xField might point to column 0 (the first array) and yField to column 1. For then next series, xField would still be column 0 and yField would be column 2, etc. As far as the actual way to pull this off in java, I'm not sure how to do it in a way that flex will recognize as an associative array (like the Month:January, Profit:2000, Expenses:1500, Amount:450 from the first example). --- In flexcoders@yahoogroups.com, Josh McDonald j...@... wrote: But what will the objects be that you're sending back? You can't make a chart out of a list of numbers, it'd be one-dimensional, not to mention not very useful :) -Josh 2009/3/18 netdeep deep...@... I'll be sending Dates, Strings, and floats. --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Josh McDonald josh@ wrote: What kind of objects are in your array? -Josh 2009/3/17 netdeep deepnet@ In the flex documentation, it shows how to easily create a chart with mxml and a static Array: private var expenses:Array = [ {Month:January,Profit:2000,Expenses:1500,Amount:450}, {Month:February,Profit:1000,Expenses:200,Amount:600}, {Month:March,Profit:1500,Expenses:500,Amount:300}, ]; mx:ColumnSeries xField=Month yField=Profit displayName=Profit / mx:ColumnSeries xField=Month yField=Expenses displayName=Expenses / But I am reading my data from the database and want to pass the data via a java object. But I don't know the number of fields at runtime. So how do I assign the xFields and yFields since I won't be able to create a variable named Month or Profit? I'll just have an array of floats or dates or whatever. Here's a start put I have no idea how to plug in the missing pieces or if another route would be preferable. var lineSeries:LineSeries = new LineSeries(); BindingUtils.bindProperty(lineSeries, dataProvider, ser, javaArray); // lineSeries.xField= ??? // lineSeries.yField= ??? The data set is often quite large by the way. -- Therefore, send not to know For whom the bell tolls. It tolls for thee. Josh 'G-Funk' McDonald - josh@ - http://twitter.com/sophistifunk - http://flex.joshmcdonald.info/ -- Therefore, send not to know For whom the bell tolls. It tolls for thee. Josh 'G-Funk' McDonald - j...@... - http://twitter.com/sophistifunk - http://flex.joshmcdonald.info/
[flexcoders] Re: converting a Java object into a chart dataprovider
In the previous implementation, I would send an ArrayList of custom Objects containing two values each, variables called point1 (an Object) and point2 (a float). So for each series, I'd assign this ArrayList (converted into an ArrayCollection by blazeDS) as the dataProvider for the series and xField = point1 and yField = point2. Obviously if I had many series on the same axis, the xField data would be duplicated for each series (very redundant, I realize). In the new implementation, I'd like to just have all the xFields point to a single array of dates for example and then each yfield would point to a different array. But since I can't create an Object in Java on the fly with variables called point1, point2, point3, etc, I'm at a loss as how to get flex to recognize where my data is when I assign the dataProvider. I hope that makes more sense. --- In flexcoders@yahoogroups.com, Josh McDonald j...@... wrote: But what will the objects be that you're sending back? You can't make a chart out of a list of numbers, it'd be one-dimensional, not to mention not very useful :) -Josh 2009/3/18 netdeep deep...@... I'll be sending Dates, Strings, and floats. --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Josh McDonald josh@ wrote: What kind of objects are in your array? -Josh 2009/3/17 netdeep deepnet@ In the flex documentation, it shows how to easily create a chart with mxml and a static Array: private var expenses:Array = [ {Month:January,Profit:2000,Expenses:1500,Amount:450}, {Month:February,Profit:1000,Expenses:200,Amount:600}, {Month:March,Profit:1500,Expenses:500,Amount:300}, ]; mx:ColumnSeries xField=Month yField=Profit displayName=Profit / mx:ColumnSeries xField=Month yField=Expenses displayName=Expenses / But I am reading my data from the database and want to pass the data via a java object. But I don't know the number of fields at runtime. So how do I assign the xFields and yFields since I won't be able to create a variable named Month or Profit? I'll just have an array of floats or dates or whatever. Here's a start put I have no idea how to plug in the missing pieces or if another route would be preferable. var lineSeries:LineSeries = new LineSeries(); BindingUtils.bindProperty(lineSeries, dataProvider, ser, javaArray); // lineSeries.xField= ??? // lineSeries.yField= ??? The data set is often quite large by the way. -- Therefore, send not to know For whom the bell tolls. It tolls for thee. Josh 'G-Funk' McDonald - josh@ - http://twitter.com/sophistifunk - http://flex.joshmcdonald.info/ -- Therefore, send not to know For whom the bell tolls. It tolls for thee. Josh 'G-Funk' McDonald - j...@... - http://twitter.com/sophistifunk - http://flex.joshmcdonald.info/
[flexcoders] Re: converting a Java object into a chart dataprovider
Thanks, that sounds like the way to go. I'll try Maps and see if that works. --- In flexcoders@yahoogroups.com, Wesley Acheson wesley.ache...@... wrote: Assuming Blaze or LiveCycle to create an object that is rendered as an actionscript object with subobjects use a map. Maps are serialised as simple objects. On Wed, Mar 18, 2009 at 3:47 PM, netdeep deep...@... wrote: In the previous implementation, I would send an ArrayList of custom Objects containing two values each, variables called point1 (an Object) and point2 (a float). So for each series, I'd assign this ArrayList (converted into an ArrayCollection by blazeDS) as the dataProvider for the series and xField = point1 and yField = point2. Obviously if I had many series on the same axis, the xField data would be duplicated for each series (very redundant, I realize). In the new implementation, I'd like to just have all the xFields point to a single array of dates for example and then each yfield would point to a different array. But since I can't create an Object in Java on the fly with variables called point1, point2, point3, etc, I'm at a loss as how to get flex to recognize where my data is when I assign the dataProvider. I hope that makes more sense. --- In flexcoders@yahoogroups.com, Josh McDonald josh@ wrote: But what will the objects be that you're sending back? You can't make a chart out of a list of numbers, it'd be one-dimensional, not to mention not very useful :) -Josh 2009/3/18 netdeep deepnet@ I'll be sending Dates, Strings, and floats. --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Josh McDonald josh@ wrote: What kind of objects are in your array? -Josh 2009/3/17 netdeep deepnet@ In the flex documentation, it shows how to easily create a chart with mxml and a static Array: private var expenses:Array = [ {Month:January,Profit:2000,Expenses:1500,Amount:450}, {Month:February,Profit:1000,Expenses:200,Amount:600}, {Month:March,Profit:1500,Expenses:500,Amount:300}, ]; mx:ColumnSeries xField=Month yField=Profit displayName=Profit / mx:ColumnSeries xField=Month yField=Expenses displayName=Expenses / But I am reading my data from the database and want to pass the data via a java object. But I don't know the number of fields at runtime. So how do I assign the xFields and yFields since I won't be able to create a variable named Month or Profit? I'll just have an array of floats or dates or whatever. Here's a start put I have no idea how to plug in the missing pieces or if another route would be preferable. var lineSeries:LineSeries = new LineSeries(); BindingUtils.bindProperty(lineSeries, dataProvider, ser, javaArray); // lineSeries.xField= ??? // lineSeries.yField= ??? The data set is often quite large by the way. -- Therefore, send not to know For whom the bell tolls. It tolls for thee. Josh 'G-Funk' McDonald - josh@ - http://twitter.com/sophistifunk - http://flex.joshmcdonald.info/ -- Therefore, send not to know For whom the bell tolls. It tolls for thee. Josh 'G-Funk' McDonald - josh@ - http://twitter.com/sophistifunk - http://flex.joshmcdonald.info/ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
[flexcoders] Re: converting a Java object into a chart dataprovider
I'll be sending Dates, Strings, and floats. --- In flexcoders@yahoogroups.com, Josh McDonald j...@... wrote: What kind of objects are in your array? -Josh 2009/3/17 netdeep deep...@... In the flex documentation, it shows how to easily create a chart with mxml and a static Array: private var expenses:Array = [ {Month:January,Profit:2000,Expenses:1500,Amount:450}, {Month:February,Profit:1000,Expenses:200,Amount:600}, {Month:March,Profit:1500,Expenses:500,Amount:300}, ]; mx:ColumnSeries xField=Month yField=Profit displayName=Profit / mx:ColumnSeries xField=Month yField=Expenses displayName=Expenses / But I am reading my data from the database and want to pass the data via a java object. But I don't know the number of fields at runtime. So how do I assign the xFields and yFields since I won't be able to create a variable named Month or Profit? I'll just have an array of floats or dates or whatever. Here's a start put I have no idea how to plug in the missing pieces or if another route would be preferable. var lineSeries:LineSeries = new LineSeries(); BindingUtils.bindProperty(lineSeries, dataProvider, ser, javaArray); // lineSeries.xField= ??? // lineSeries.yField= ??? The data set is often quite large by the way. -- Therefore, send not to know For whom the bell tolls. It tolls for thee. Josh 'G-Funk' McDonald - j...@... - http://twitter.com/sophistifunk - http://flex.joshmcdonald.info/
[flexcoders] converting a Java object into a chart dataprovider
In the flex documentation, it shows how to easily create a chart with mxml and a static Array: private var expenses:Array = [ {Month:January,Profit:2000,Expenses:1500,Amount:450}, {Month:February,Profit:1000,Expenses:200,Amount:600}, {Month:March,Profit:1500,Expenses:500,Amount:300}, ]; mx:ColumnSeries xField=Month yField=Profit displayName=Profit / mx:ColumnSeries xField=Month yField=Expenses displayName=Expenses / But I am reading my data from the database and want to pass the data via a java object. But I don't know the number of fields at runtime. So how do I assign the xFields and yFields since I won't be able to create a variable named Month or Profit? I'll just have an array of floats or dates or whatever. Here's a start put I have no idea how to plug in the missing pieces or if another route would be preferable. var lineSeries:LineSeries = new LineSeries(); BindingUtils.bindProperty(lineSeries, dataProvider, ser, javaArray); // lineSeries.xField= ??? // lineSeries.yField= ??? The data set is often quite large by the way.
[flexcoders] filtering blazeds messages
I have blazeds working on a channel I have set up, but how do you filter out the information you broadcast on that channel? If I want to send data to one instance of my application, but no another, how do I determine that. Here is how I set up the message in java and flex. I have tried setting the consumer.selector as it says to in the documentation, but that doesn't seem to do anything, at least not the way I'm doing it. Here is the code: !-- flex code -- mx:Consumer id=consumer destination=factory message=msgHandler(event.message)/ !-- actionscript snippet consumer.selector = reportID = '+reportID+'; consumer.subscribe(); -- // java code message = new AsyncMessage(); message.setDestination(factory); // the channel I've set up message.setClientId(clientID); message.setMessageId(UUIDUtils.createUUID()); message.setTimestamp(System.currentTimeMillis()); message.setHeader(reportID, this.getRepID()); message.setBody(channelDef); // my object service.pushMessageToClients(message, false);
[flexcoders] chart axis titles missing in image capture
I have two sections of code which generate a png file from a UIComponent. Both seem very similar except that one of them cuts the axis titles off for some reason. The actual image file is generated in Java, but the encoding happens here in flex. The same code is used in both calls to Java, though one is through a servlet (which then calls a Java method) and the other is through a direct call to the remote Java method. What is going on? ImageSnapshot.defaultEncoder = PNGEncoder; public function saveAllSnapshots():void { for (var i:int=0; iflowLayout.getChildren().length; i++) { var box:VBox = flowLayout.getChildAt(i) as VBox; var cp:ChartPanel = box.getChildAt(2) as ChartPanel; this.captureImg(cp, cp.title); } } // creates png ByteArray and sends it to a java remote object for saving // This is the method that chops off the axis titles private function captureImg(comp:UIComponent, name:String):void { var imageSnap:ImageSnapshot = ImageSnapshot.captureImage(comp); var imageByteArray:ByteArray = imageSnap.data as ByteArray; imgSave.saveImage(imageByteArray, name+-img.png); } // handle a click on the save image button private function imgClickHandler(evt:MouseEvent):void { var button:Button = evt.target as Button; for (var i:int=0; iflowLayout.getChildren().length; i++) { var box:VBox = flowLayout.getChildAt(i) as VBox; if (button == box.getChildAt(1)) { saveSnapShot(box.getChildAt(2) as UIComponent); break; } } } // show image in a new window (this works) private function saveSnapShot(comp:UIComponent):void { var imageSnap:ImageSnapshot = ImageSnapshot.captureImage(comp); var imageByteArray:ByteArray = imageSnap.data as ByteArray; var request:URLRequest = new URLRequest(imgServURL); request.contentType=text/html; request.data = imageByteArray; request.method = URLRequestMethod.POST; navigateToURL(request, _blank); }
[flexcoders] Re: chart axis titles missing in image capture
I have an idea that this might be a problem with the asynchronous way methods get called in Flex. In other words even though code wise, the chart has been created before the automated image capture is called, somehow internally the chart is not complete. That's explains why the user triggered event of clicking the button works, but it doesn't explain why the automated calls to generate the image fail on the second and subsequent tries (since by then one would assume that the image has been created) By the way, I am using callLater(saveAllSnapshots) for the automated code. Could someone please help me with this? Thanks! --- In flexcoders@yahoogroups.com, netdeep deep...@... wrote: I have two sections of code which generate a png file from a UIComponent. Both seem very similar except that one of them cuts the axis titles off for some reason. The actual image file is generated in Java, but the encoding happens here in flex. The same code is used in both calls to Java, though one is through a servlet (which then calls a Java method) and the other is through a direct call to the remote Java method. What is going on? ImageSnapshot.defaultEncoder = PNGEncoder; public function saveAllSnapshots():void { for (var i:int=0; iflowLayout.getChildren().length; i++) { var box:VBox = flowLayout.getChildAt(i) as VBox; var cp:ChartPanel = box.getChildAt(2) as ChartPanel; this.captureImg(cp, cp.title); } } // creates png ByteArray and sends it to a java remote object for saving // This is the method that chops off the axis titles private function captureImg(comp:UIComponent, name:String):void { var imageSnap:ImageSnapshot = ImageSnapshot.captureImage(comp); var imageByteArray:ByteArray = imageSnap.data as ByteArray; imgSave.saveImage(imageByteArray, name+-img.png); } // handle a click on the save image button private function imgClickHandler(evt:MouseEvent):void { var button:Button = evt.target as Button; for (var i:int=0; iflowLayout.getChildren().length; i++) { var box:VBox = flowLayout.getChildAt(i) as VBox; if (button == box.getChildAt(1)) { saveSnapShot(box.getChildAt(2) as UIComponent); break; } } } // show image in a new window (this works) private function saveSnapShot(comp:UIComponent):void { var imageSnap:ImageSnapshot = ImageSnapshot.captureImage(comp); var imageByteArray:ByteArray = imageSnap.data as ByteArray; var request:URLRequest = new URLRequest(imgServURL); request.contentType=text/html; request.data = imageByteArray; request.method = URLRequestMethod.POST; navigateToURL(request, _blank); }
[flexcoders] Re: chart axis titles missing in image capture
I've made some progress. If I add this code: chartPanel.addEventListener(FlexEvent.CREATION_COMPLETE, imgExport); // method: imgExport (Event) public function imgExport(e:Event):void { var cp:ChartPanel = e.currentTarget as ChartPanel; captureImg(cp, cp.title); } The axis gets drawn, but only on the INITAL rendering of the chart (obviously). The addEventListener(FlexEvent.UPDATE_COMPLETE, imgExport) does not seem to register properly because the chartPanel doesn't ever get updated, just the data in the chart element whithin the panel. How do I get the update to register as an event as well?
[flexcoders] multi axis columnSeries chart grid messed up in Actionscript
I'm having a problem with a stray grid line popping up on my charts. It is not the same color as the other grid lines (which are grey), in fact it is the same color as the vertical axes (it is a multi-axis chart) and appears out of sinc with the others similar to this pattern: unwanted grid line Furthermore, it only appears on one of my chart where I use a column series. Here is the code, but even when I comment out the background elements, the horizontal lines still show up, both the regular lines and the unwanted line. How do I get rid of this line? (Edit) One thing, I've noticed is that when I comment out this line in the columSeries case: columnSeries.verticalAxis = vAxis; The data draws itself along this unwanted grid line (but very squished).. Code snippet: var axisList:ArrayCollection = chart.getAxisList(); var renderers:ArrayCollection = new ArrayCollection(); var seriesArray:ArrayCollection = new ArrayCollection(); var hAxis:DateTimeAxis = new DateTimeAxis(); // define each axis for (var i:int=0; iaxisList.length; i++) { var axis:AxisObject = axisList.getItemAt(i) as AxisObject; if (axis.getID() == x Axis) { var ar:AxisRenderer = new AxisRenderer(); ar.axis = hAxis; ar.placement = bottom; ar.setStyle(canDropLabels, true); genericChart.horizontalAxisRenderers = [ar]; genericChart.horizontalAxis = hAxis; } else { // Define vertical axis var vAxis:LinearAxis = new LinearAxis(); if (axis.min != axis.max) vAxis.minimum = axis.min; var axr:AxisRenderer = new AxisRenderer(); axr.axis = vAxis; axr.placement = axis.getLocation(); axr.setStyle(canDropLabels, true); for (var j:int=0; jaxis.getSeriesList().length; j++) { var ser:SeriesObject = axis.getSeriesList().getItemAt(j) as SeriesObject; stroke.color = col; // define series if (ser.getPlotType() == Line) { var lineSeries:LineSeries = new LineSeries(); BindingUtils.bindProperty(lineSeries, dataProvider, ser, pointList); lineSeries.verticalAxis = vAxis; lineSeries.horizontalAxis = hAxis; lineSeries.setStyle(lineStroke, stroke); lineSeries.xField=point1; lineSeries.yField=point2; seriesArray.addItem(lineSeries); } if (ser.getPlotType() == Column) { var columnSeries:ColumnSeries = new ColumnSeries(); BindingUtils.bindProperty(columnSeries, dataProvider, ser, pointList); columnSeries.verticalAxis = vAxis; columnSeries.horizontalAxis = hAxis; columnSeries.setStyle('stroke', stroke); columnSeries.xField=point1; columnSeries.yField=point2; seriesArray.addItem(columnSeries);
[flexcoders] Flex with virtual frame buffer
I have to run an automated version of my flex app on a headless server so I'm using a virtual frame buffer (Xvfb) running on Solaris in an oc4j container. I can get the following command to 'apparently' launch the app: String cmd = /bin/sh DISPLAY=:5 /opt/sfw/bin/firefox + url+ -width 1600 -height 1200; I say apparently because it does not cause any errors. But when I send messages to the flex app via BlazeDS for it to do it's thing...they never get there. I know the program works because it is fine in my localhost development environment, but how do I get the app to launch with a virtual frame buffer or more generally, on a headless server?
[flexcoders] Re: appending to a dataprovider in actionscript
Well, I tried this approach and while I didn't work, at least I finally got an error from flash instead of the whole program just hanging: TypeError: Error #1006: value is not a function. at mx.charts::DateTimeAxis/mapCache()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\DateTimeAxis.as:1403] at mx.charts.series::LineSeries/updateMapping()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\series\LineSeries.as:1054] at mx.charts.chartClasses::Series/validateData()[C:\work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses\Series.as:1600] at mx.charts.series::LineSeries/describeData()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\series\LineSeries.as:1174] at mx.charts.chartClasses::DataTransform/describeData()[C:\work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses\DataTransform.as:234] at mx.charts.chartClasses::AxisBase/describeData()[C:\work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses\AxisBase.as:177] at mx.charts.chartClasses::NumericAxis/get dataDescriptions()[C:\work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses\NumericAxis.as:1033] at mx.charts.chartClasses::NumericAxis/autoGenerate()[C:\work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses\NumericAxis.as:1050] at mx.charts.chartClasses::NumericAxis/updateCache()[C:\work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses\NumericAxis.as:761] at mx.charts.chartClasses::NumericAxis/update()[C:\work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses\NumericAxis.as:884] at mx.charts.chartClasses::NumericAxis/getLabelEstimate()[C:\work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses\NumericAxis.as:645] at mx.charts::AxisRenderer/measureLabels()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\AxisRenderer.as:1740] at mx.charts::AxisRenderer/calcRotationAndSpacing()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\AxisRenderer.as:1459] at mx.charts::AxisRenderer/adjustGutters()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\AxisRenderer.as:1326] at mx.charts.chartClasses::CartesianChart/updateAxisLayout()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses\CartesianChart.as:19 37] at mx.charts.chartClasses::CartesianChart/updateDisplayList()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses\CartesianChart.as:13 55] at mx.core::UIComponent/validateDisplayList()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\core\UIComponent.as:6293] at mx.managers::LayoutManager/validateDisplayList()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:605] at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:678] at Function/http://adobe.com/AS3/2006/builtin::apply() at mx.core::UIComponent/callLaterDispatcher2()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8565] at mx.core::UIComponent/callLaterDispatcher()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8508] --- In flexcoders@yahoogroups.com, Fu Di [EMAIL PROTECTED] wrote: if u want to listen a ArrayCollection when some of its elements are changed. u could write like this: dataProvider.addEventListener(CollectionEvent.COLLECTION_CHANGE,updateHandler); private function updateHandler(event:CollectionEvent):void { } look up CollectionEvent api , u can find out how to do next step. From: netdeep [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Friday, November 21, 2008 2:41:48 AM Subject: [flexcoders] appending to a dataprovider in actionscript I am still trying to iron out the problems with data binding in actionscript an server push. If I just replace the old array with a new one, it updates ok, but when I append to an array, it doesn't seem to work. I have to do everything in actionscript. I set up the data binding like this. BindingUtils. bindProperty( lineSeries, dataProvider , ser, pointList) ; Here is the way I'm currently trying to append the new data and catch the error, but this does not work. // oldArray is the same as pointlist from the data binding line of code above for (var i:int = 0; inewArray.length; i++) { oldArray.addItem( newArray. getItemAt( i)); } What's more, because the app is fired remotedly from a server process, I can't trace or run it in debug mode to find out why it's failing. Usually, I'll throw in an Alert.show to find out
[flexcoders] Re: appending to a dataprovider in actionscript
The code for the event listener is pretty much what was suggested previously: private function updateHandler(event:CollectionEvent):void { Alert.show( updated); } BindingUtils.bindProperty(lineSeries, dataProvider, ser, pointList); // assignement to pointList which is the dataprovider ser.pointList.addEventListener(CollectionEvent.COLLECTION_CHANGE,updateHandler);
[flexcoders] Re: appending to a dataprovider in actionscript
Ok, I'm not sure what code you're looking for, so here is the function which I believe is triggering the error. I've edited out as much as I could (things like display settings) to trim it down and here is what remains: public function makeDateChart(genericChart:CartesianChart, genericLegend:Legend, chartPanel:ChartPanel, chart:ChartObject):void { var axisList:ArrayCollection = chart.getAxisList(); var renderers:ArrayCollection = new ArrayCollection(); var seriesArray:ArrayCollection = new ArrayCollection(); var hAxis:DateTimeAxis = new DateTimeAxis(); // define each axis for (var i:int=0; iaxisList.length; i++) { var axis:AxisObject = axisList.getItemAt(i) as AxisObject; if (axis.getID() == x Axis) { var start:Date = axis.start; var end:Date = axis.end; hAxis.labelFunction = fullTimeLabelFunction; // more formating of the horizontal axis var ar:AxisRenderer = new AxisRenderer(); ar.axis = hAxis; ar.placement = bottom; genericChart.horizontalAxisRenderers = [ar]; genericChart.horizontalAxis = hAxis; } else { // Define vertical axis var vAxis:LinearAxis = new LinearAxis(); vAxis.autoAdjust = true; vAxis.baseAtZero = false; genericChart.verticalAxis = vAxis; vAxis.labelFunction = formatVertLabel; vAxis.title = axis.title; // more formatting of the axis var axr:AxisRenderer = new AxisRenderer(); axr.axis = vAxis; for (var j:int=0; jaxis.getSeriesList().length; j++) { var ser:SeriesObject = axis.getSeriesList().getItemAt(j) as SeriesObject; // define series if (ser.getPlotType() == Line) { var lineSeries:LineSeries = new LineSeries(); BindingUtils.bindProperty(lineSeries, dataProvider, ser, pointList); ser.pointList.addEventListener(CollectionEvent.COLLECTION_CHANGE,updateHandler); lineSeries.verticalAxis = vAxis; lineSeries.horizontalAxis = hAxis; lineSeries.xField=point1; lineSeries.yField=point2; lineSeries.verticalAxis = vAxis; seriesArray.addItem(lineSeries); } } renderers.addItem(axr); } } genericChart.series = seriesArray.toArray().reverse(); genericChart.verticalAxisRenderers = renderers.toArray(); genericLegend.dataProvider = genericChart; chartPanel.horizontalScrollPolicy = off; chartPanel.addChild(genericChart); if (chart.getShowLegend()) chartPanel.addChild(genericLegend); }
[flexcoders] Re: appending to a dataprovider in actionscript
Maciek, thanks for all your help. Here is the code snippet arround line 1403 else if (cache[i][field] is Date) { for (; i n; i++) { v = cache[i]; v[convertedField] = v[field].getTime(); // line 1403 } }
[flexcoders] Re: appending to a dataprovider in actionscript
Hey I think I finally figured out what was going on. The initial data for the chart was read from the database and the points were in the form of Timestamp, float (in java). Since the data doesn't change very often and I wanted to speed it up for testing, I just created a new Date and a random float. I guess flex was expecting Timestamps or maybe it doesn't like Dates from java. But when I went back and generated my new data as Timestamps instead of Dates, it worked! Thanks again for all the help! --- In flexcoders@yahoogroups.com, netdeep [EMAIL PROTECTED] wrote: Maciek, thanks for all your help. Here is the code snippet arround line 1403 else if (cache[i][field] is Date) { for (; i n; i++) { v = cache[i]; v[convertedField] = v[field].getTime(); // line 1403 } }
[flexcoders] appending to a dataprovider in actionscript
I am still trying to iron out the problems with data binding in actionscript an server push. If I just replace the old array with a new one, it updates ok, but when I append to an array, it doesn't seem to work. I have to do everything in actionscript. I set up the data binding like this. BindingUtils.bindProperty(lineSeries, dataProvider, ser, pointList); Here is the way I'm currently trying to append the new data and catch the error, but this does not work. // oldArray is the same as pointlist from the data binding line of code above for (var i:int = 0; inewArray.length; i++) { oldArray.addItem(newArray.getItemAt(i)); } What's more, because the app is fired remotedly from a server process, I can't trace or run it in debug mode to find out why it's failing. Usually, I'll throw in an Alert.show to find out if the data is messed up or a variable is null, but when I do it after running this loop, the Alert just hangs the whole application. Is there anyway to throw an error to a popup box (flash seems to do this from time to time on its own) And one final related question. If I do get the new arrays to work, will the charts labels and range adjust accordingly. In other words, if the original array was from Mon-Wed, if the new data is on Thurs, will the chart auto adjust properly to show the new data?
[flexcoders] Re: updating data in Actionscript
Well I've been going back through my code and I found a logical error in which I was not getting the correct reference to the old arraycollection and so I'd just like to close this topic by saying 'mea culpa'. The data binding does work! I just had to assign the old pointList arraycollection to the new arraycollection and bingo! we're flipping pancackes. Thanks for all of the help on this topic! --- In flexcoders@yahoogroups.com, netdeep [EMAIL PROTECTED] wrote: The problem is that I'm transferring an ActionScript object to the server, populating it with the data, and then returning the ActionScript via BlazeDS and remoting (so these objects get converted to Java objects on the server and back to ActionScript when the come into flex). And the ArrayCollection is buried deep in the the object and I also build the series items for the chart on the fly in Actionscript. So I don't have access to the series items in the chart I create (for instance to reassign the dataproviders), nor do I have easy access to the ArrayCollections themselves since they are buried in the ActionScript objects. Here's some pseudocode of how the charts get created which illustrates the problem. in ReportObject for each ChartObject in ReportObject create CartesianChart for each AxisObject in ChartObject create DateTimeAxis and assign it to chart for each SeriesObject in AxisObject create Series and assign it to axis bind SeriesObject.data to Series.dataprovider So when I get the next ReportObject pushed to the flex app from the server, the structure of the Report is exactly the same (i.e. x# axes, x# series for a given axis, etc) but the data has been updated and the series do not pick this up.
[flexcoders] Re: updating data in Actionscript
Thanks for all the help everybody. I feel like I am close to getting this, but it's still not working. Here are the relevant snippets of actual code which should give a better idea of what I'm doing and why it's not working. // initial assignment when chart is created BindingUtils.bindProperty(genericChart, dataProvider, series, pointList); // reassignment when I get new data var newSeries:SeriesObject = newAxis.getSeriesList().getItemAt(p) as SeriesObject; var oldSeries:SeriesObject = oldAxis.getSeriesList().getItemAt(p) as SeriesObject; oldSeries.pointList = newSeries.pointList; The series objects get completely rebuilt with each iteration. --- In flexcoders@yahoogroups.com, Josh McDonald [EMAIL PROTECTED] wrote: This: BindingUtils.bindProperty(lineSeries, dataProvider, ser, pointList); Should work. Assuming the ser is not being changed to a new value, but ser.pointList is. So, if it doesn't work, one of those two facts is probably wrong ;-) If ser is being changed to a new value, this should fix it: BindingUtils.bindProperty(lineSeries, dataProvider, this,[ser, pointList]); If the problem is that the collection ser.pointList is being updated (but not replaced), you'll need to listen to the result event from your rpc call, and call ser.pointList.refresh() afterwards. This is because not all CollectionChangeEvent types will trigger a redraw in a DataGrid or Chart, because it would chew up insane amounts of CPU time when updating many objects in a list. -Josh On Thu, Nov 13, 2008 at 5:38 AM, netdeep [EMAIL PROTECTED] wrote: I have been trying to find an answer for this with no success. How do you get flex to refresh data bindings using objects which are passed via remoting? I initially set up my chart to reflect the ArrayCollection I pass in during initialization like this: BindingUtils.bindProperty(lineSeries, dataProvider, ser, pointList); But when I pass the flex app new data and a new pointList, nothing is getting updated. Since pointList will be new with each result passed in from the server, the binding doesn't work. Or is there something else I'm missing? How do you get this to work? -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links -- Therefore, send not to know For whom the bell tolls. It tolls for thee. Like the cut of my jib? Check out my Flex blog! :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] :: http://flex.joshmcdonald.info/ :: http://twitter.com/sophistifunk
[flexcoders] Re: updating data in Actionscript
The problem is that I'm transferring an ActionScript object to the server, populating it with the data, and then returning the ActionScript via BlazeDS and remoting (so these objects get converted to Java objects on the server and back to ActionScript when the come into flex). And the ArrayCollection is buried deep in the the object and I also build the series items for the chart on the fly in Actionscript. So I don't have access to the series items in the chart I create (for instance to reassign the dataproviders), nor do I have easy access to the ArrayCollections themselves since they are buried in the ActionScript objects. Here's some pseudocode of how the charts get created which illustrates the problem. in ReportObject for each ChartObject in ReportObject create CartesianChart for each AxisObject in ChartObject create DateTimeAxis and assign it to chart for each SeriesObject in AxisObject create Series and assign it to axis bind SeriesObject.data to Series.dataprovider So when I get the next ReportObject pushed to the flex app from the server, the structure of the Report is exactly the same (i.e. x# axes, x# series for a given axis, etc) but the data has been updated and the series do not pick this up.
[flexcoders] updating data in Actionscript
I have been trying to find an answer for this with no success. How do you get flex to refresh data bindings using objects which are passed via remoting? I initially set up my chart to reflect the ArrayCollection I pass in during initialization like this: BindingUtils.bindProperty(lineSeries, dataProvider, ser, pointList); But when I pass the flex app new data and a new pointList, nothing is getting updated. Since pointList will be new with each result passed in from the server, the binding doesn't work. Or is there something else I'm missing? How do you get this to work?
[flexcoders] running flex on a headless server
I have a nice front end chart viewing application which allows users to query the database and see the results in chart form (basically a dashboard app). However, the end users want these reports automated and broadcast as 'snapshots' every few hours. So the idea is that the chart app would run in the background on the server and export it's images every so often as png files. This all works fine in my development environment, but I have to deploy the application onto a headless oc4j server running on Solaris. And I simply cannot get the browser to launch by hook or by crook. Could someone please help me with this? I would greatly appreciate it as I have been struggling to get this to work for quite some time.
[flexcoders] Re: refreshing data via BlazeDS
I'm still wondering how to get this working. The underlying ArrayCollection data is being changed with each reload but the charts are staying the same. The data is updated via remoting wiht a Java method, by the way. How do I get the binding to work properly? Here is my method which is handling the results Attach Code private function getReloadResults(event:ResultEvent):void { // reportObject is a custom ActionScript/Java data structure // it contains the ArrayCollection objects for the charts report = event.result as ReportObject; } I have a persistent instance of my Flex App which needs to run constantly and recieve data via server push. It displays the latest data via a chart. The charts are defined in ActionScript. Here is a snippet: var lineSeries:LineSeries = new LineSeries(); BindingUtils.bindProperty(lineSeries, dataProvider, ser, pointList); // pointList is an ArrayCollection lineSeries.xField=point1; lineSeries.yField=point2; lineSeries.verticalAxis = vAxis; seriesArray.addItem(lineSeries); chart.series = seriesArray.toArray().reverse(); // chart is an instance of CartesianChart So when I push out the next data to my app, how do I let these lineSeries objects get the new data and redraw the chart?
[flexcoders] refreshing data via BlazeDS
I have a persistent instance of my Flex App which needs to run constantly and recieve data via server push. It displays the latest data via a chart. The charts are defined in ActionScript. Here is a snippet: var lineSeries:LineSeries = new LineSeries(); BindingUtils.bindProperty(lineSeries, dataProvider, ser, pointList); // pointList is an ArrayCollection lineSeries.xField=point1; lineSeries.yField=point2; lineSeries.verticalAxis = vAxis; seriesArray.addItem(lineSeries); chart.series = seriesArray.toArray().reverse(); // chart is an instance of CartesianChart So when I push out the next data to my app, how do I let these lineSeries objects get the new data and redraw the chart?
[flexcoders] Dynamic binding with slider in actionscript
I have a loop which creates a given number of charts at runtime (based on user requests) and adds them to my main application. I would like for a slider to be also associated with each chart so that the width of the chart can be adjusted. I can create everything, but I do not know how to do the bindings between the chart width and the slider since everything is in actionscript. Here is a sample of the relevant code from the loop. var vFrame:VBox = new VBox(); var zoomSlider:ZoomSlider = new ZoomSlider(); // a custom version of HSlider vFrame.addChild(zoomSlider); vFrame.addChild(chartPanel); this.addChild(vFrame); // this line doesn't work BindingUtils.bindProperty(chartPanel, width, zoomSlider, zoomSlider.value*5); How can I get the binding to work with dynamic elements like this?
[flexcoders] Re: DataGrid in custom component not updating
I'm not sure what 'item' refers to since the entire arraycollection is new. I tried: axis.seriesList.itemUpdated(axis.seriesList.getItemAt(0)); with no success... mx:DataGrid id=seriesTable dataProvider={axis.seriesList} --- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] wrote: Call collection.itemUpdated(item) after updating the item. Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of netdeep Sent: Wednesday, September 17, 2008 3:18 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] DataGrid in custom component not updating I have a custom component with a DataGrid in it. The dataprovider is an actionscript object (the variable name for this object is axis) with an ArrayCollection called seriesList. When I do axis.seriesList.addItem(), the DataGrid updates properly, but when I simply assign a new axis object (such as for a load) to my component (even for a brand new component) with a seriesList already defined, it does not update at all. How can I get the DataGrid to update properly? mx:DataGrid id=seriesTable dataProvider={axis.seriesList} mx:columns !-- columns defined here... -- /mx:columns /mx:DataGrid
[flexcoders] Re: HTTPService conversion to ArrayCollection problem
Yeah, you are right that when there are two or more items in the list, the problem does not show up. I'm not sure how to process the results in e4x or with XMLListCollection, however. --- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] wrote: This is probably the Object vs Array problem. The player is unable to differentiate between an array with a single element and an object. Test by adding another data node. I advise changing the default resultFormat to e4x and doing the conversion to ArrayCollection manually, instead of letting Flex do it for you. Or use XMLListCollection directly. Accepted best practice seems to be using resultFormat=e4x and building an ArrayCollection of strongly typed VOs. If you are committed to staying with the default resultFormat, you will need to inspect the event.result object to determine what it contains, and code for the two cases. Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of netdeep Sent: Tuesday, September 16, 2008 11:29 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] HTTPService conversion to ArrayCollection problem This is really bizarre but I have some code that was working previously and now is no longer working. I am using a servlet to output information in the following format: system data nameChannel 1/name idRep1/id /data /system But I am now getting a runtime error: Error #1034: Type Coercion failed: cannot convert mx.utils::[EMAIL PROTECTED] to mx.collections.ArrayCollection Code: public function initializeBrowser(evt:ResultEvent):void { var arr:ArrayCollection = evt.result.system.data; } mx:HTTPService id=reportsList result=initializeBrowser(event) useProxy=false method=GET url={dbURL}/
[flexcoders] DataGrid in custom component not updating
I have a custom component with a DataGrid in it. The dataprovider is an actionscript object (the variable name for this object is axis) with an ArrayCollection called seriesList. When I do axis.seriesList.addItem(), the DataGrid updates properly, but when I simply assign a new axis object (such as for a load) to my component (even for a brand new component) with a seriesList already defined, it does not update at all. How can I get the DataGrid to update properly? mx:DataGrid id=seriesTable dataProvider={axis.seriesList} mx:columns !-- columns defined here... -- /mx:columns /mx:DataGrid
[flexcoders] HTTPService conversion to ArrayCollection problem
This is really bizarre but I have some code that was working previously and now is no longer working. I am using a servlet to output information in the following format: system data nameChannel 1/name idRep1/id /data /system But I am now getting a runtime error: Error #1034: Type Coercion failed: cannot convert mx.utils::[EMAIL PROTECTED] to mx.collections.ArrayCollection Code: public function initializeBrowser(evt:ResultEvent):void { var arr:ArrayCollection = evt.result.system.data; } mx:HTTPService id=reportsList result=initializeBrowser(event) useProxy=false method=GET url={dbURL}/
[flexcoders] Generic Axis class?
I am creating a chart where the user can specify what type of horizontal axis he desires. Right now, I'm trying to allow both CategoryAxis and DateTimeAxis options. But in the API it seems like these two do not share a useable, generic ancestry. I tried AxisBase and IAxis, but neither worked. I'd like to hypothetically declare the following: var hAxis:GenericAxis; // What class type should this be? // then instantiate hAxis = new DateTimeAxis(); // or hAxis = new CategoryAxis();
[flexcoders] DateValidator not being disabled with errorString=
I have Validators for some of my TextInput and Datefields. I am loading my TextInput and DateFields first via ActionScript and then resetting them later through ActionScript so I never even click on the DateField but the Validator still triggers when I reset. Basically I want the 'reset all' behavior to not trigger validator warnings. I am resetting all of the fields in my interface and my validator is firing for the DateField but not for TextInputs. I can disable TextInput with: textInput.errorString = ; And get no red lines or errors. But when I try: dateField.errorString = ; the red box is still there. What is going on? I've tried it with both StringValidators and with DateValidators, but both exhibit the same problem. Here are my mxml definitions: mx:DateValidator id=startFixedValidator source={startDate} property=text / mx:DateField color=#00 id=startDate/
[flexcoders] dataGrid null with state change
I have a custom component with various fields and buttons. At times during my application, these components are added to the main window. The data for the fields is generated from another custom component with information like strings, arrays, etc. The problem I'm having is with databinding an array from my data component to a DataGrid in the custom fields component. Why does my DataGrid show up as null during debugging after I have set the state so it is will be visible? More importantly how to I get the DataGrid object to show the array data?
[flexcoders] RemovedEffect bug
I have a custom componenent which is an extension of VBox. In it I had defined a RemovedEffect since the user can add and remove these components to the interface. The problem I had with this is that this effect caused the program to lock up after I had added and then removed all components via this method: !-- axisInfoArea is a standard VBox component -- public function removeAllAxes():void { for (var k:int=axisInfoArea.getChildren().length-1; k0; k--) { axisInfoArea.removeChildAt(k); } } It seems like after I remove them all, then when the Removed Effect gets called, it tries to apply the effect on components which are no longer there and causes the following error. RangeError: Error #2006: The supplied index is out of bounds. at flash.display::DisplayObjectContainer/addChildAt() at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::$addChildAt()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\ core\UIComponent.as:4982] at mx.core::Container/addChildAt()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\Container.as:2208] at mx.effects::EffectManager$/removedEffectHandler()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\effects\EffectManager.as:738] at Function/http://adobe.com/AS3/2006/builtin::apply() at mx.core::UIComponent/callLaterDispatcher2()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:8460] at mx.core::UIComponent/callLaterDispatcher()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:8403] So when I remove the RemovedEffect from my component, the code works fine, but when it's there, the program freezes up. Is this a known bug or is there someway around it?
[flexcoders] LineChart display bug
I wanted to create a bar across the top of my App and since I wanted it across the whole thing, I set the width to 100%. This worked fine until I added charts to my App via actionscript. When I add one chart, it's still ok, but when I add 2 or more charts. The top bar shifts left about 10 pixels and creates a gap on the left. Furthermore, a horizontal scrollbar appears which will not go away. Try this short, easy application code out to reproduce the problem. It seems like this is a BUG in flex, but if you can figure out a way around it, please let me know. ?xml version=1.0? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; xmlns:custom=components.* paddingLeft=0 paddingRight=0 horizontalAlign=center layout=vertical mx:Script ![CDATA[ import mx.charts.LineChart; import mx.controls.Button; import mx.containers.Panel; private function clickHandler():void{ var myPanel:Panel = new Panel(); myPanel.addChild(new LineChart()); this.addChild(myPanel); } ]] /mx:Script mx:HBox width=100% backgroundColor=#113887 mx:Image source=assets/images/true.jpg/ mx:Button label=Add Panel click=clickHandler()/ /mx:HBox /mx:Application
[flexcoders] annoying scrollbar flicker
I am using a checkbox to show and hide interface elements via setting the state. When I click it once, it correctly sets the state and shows the elements. However when it reverts to the normal state and removes the elements, it flashes on a vertical scroll bar to the container from which it is being removed. How do I avoid this? I am using a move effect and don't know if that may be part of the problem. mx:states mx:State name=functionView mx:AddChild relativeTo={mainBox} position=lastChild mx:DataGrid visible={applyFunc.selected} backgroundColor=white color=black addedEffect=downWipe removedEffect=upWipe width=300 id=funcTable dataProvider={axis.functions} rowCount=2 mx:columns mx:DataGridColumn dataField=name / mx:DataGridColumn dataField=val / /mx:columns /mx:DataGrid /mx:AddChild /mx:State /mx:states mx:VBox id=mainBox verticalScrollPolicy=off !-- several HBox elements are defined here -- /mx:VBox mx:HRule width=100% moveEffect=slow/ mx:Move id=slow duration=500/ mx:WipeDown id=downWipe duration=500/ mx:WipeUp id=upWipe duration=500/
[flexcoders] Re: combobox fills in with blank element
No, and in fact when I query signalList.length, it returns the correct number. Furthermore, if I later create another component and set the signalList in it for it's combobox, it will display correctly without the blank first element... --- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] wrote: Does signalList have an extra element in it? Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of netdeep Sent: Friday, July 11, 2008 11:46 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: combobox fills in with blank element Here is the relevant code from the component with the combobox: [Bindable] private var signalList:ArrayCollection = new ArrayCollection(); public function setSignals(sig:ArrayCollection):void { signalList = sig; } mx:ComboBox dataProvider={signalList} selectedIndex=0 toolTip={signal.selectedItem.name} change=selectSignal() color=#00 id=signal labelField=name/ And here is my Application actionscript code for populating signalList: var arr:Array = archiveList.selectedItems; for (var i:int=0; iarr.length; i++) { if (!signalList.contains(arr[i].name)) { signalList.addItem(arr[i].name); } } var sort:Sort = new Sort(); // Set the sort field (case-insensitive) sort.fields = [new SortField(null,true)]; // Assign the Sort object to the view. signalList.sort = sort; // Apply the sort to the collection. signalList.refresh(); --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui aharui@ wrote: Show your code. Last time, someone was inadvertently putting a space into the CB's dataProvider From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of netdeep Sent: Friday, July 11, 2008 5:48 AM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] combobox fills in with blank element I have an ArrayCollection which is the dataProvider for a combobox in a custom component. However the ArrayCollection is located in the application so I assign it to the custom component via actionscript in the component. When I call addItem on the ArrayCollection the items go into the combobox, however the first element is always blank. How can I can get rid of this and get the combobox to add only the items I am adding to the ArrayCollection?
[flexcoders] Re: combobox fills in with blank element
I don't think that is going to work except the first time the method is called. I need to be able add more items to the array later on and this would simply overwrite signalList each time and I'd lose the items added previously. --- In flexcoders@yahoogroups.com, Mauricio Rogério Obenaus [EMAIL PROTECTED] wrote: I had a problem like that, try this: var newList:ArrayCollection(signalList); for (var i:int=0; iarr.length; i++) { if (!newList.contains(arr[i].name)) { newList.addItem(arr[i].name); } signalList = newList; I din´t compile this, no builder available here. Mauricio On Fri, Jul 11, 2008 at 12:45 PM, netdeep [EMAIL PROTECTED] wrote: Here is the relevant code from the component with the combobox: [Bindable] private var signalList:ArrayCollection = new ArrayCollection(); public function setSignals(sig:ArrayCollection):void { signalList = sig; } mx:ComboBox dataProvider={signalList} selectedIndex=0 toolTip={signal.selectedItem.name http://signal.selecteditem.name/} change=selectSignal() color=#00 id=signal labelField=name/ And here is my Application actionscript code for populating signalList: var arr:Array = archiveList.selectedItems; for (var i:int=0; iarr.length; i++) { if (!signalList.contains(arr[i].name)) { signalList.addItem(arr[i].name); } } var sort:Sort = new Sort(); // Set the sort field (case-insensitive) sort.fields = [new SortField(null,true)]; // Assign the Sort object to the view. signalList.sort = sort; // Apply the sort to the collection. signalList.refresh(); --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Alex Harui aharui@ wrote: Show your code. Last time, someone was inadvertently putting a space into the CB's dataProvider From: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com [mailto: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com] On Behalf Of netdeep Sent: Friday, July 11, 2008 5:48 AM To: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com Subject: [flexcoders] combobox fills in with blank element I have an ArrayCollection which is the dataProvider for a combobox in a custom component. However the ArrayCollection is located in the application so I assign it to the custom component via actionscript in the component. When I call addItem on the ArrayCollection the items go into the combobox, however the first element is always blank. How can I can get rid of this and get the combobox to add only the items I am adding to the ArrayCollection?
[flexcoders] combobox fills in with blank element
I have an ArrayCollection which is the dataProvider for a combobox in a custom component. However the ArrayCollection is located in the application so I assign it to the custom component via actionscript in the component. When I call addItem on the ArrayCollection the items go into the combobox, however the first element is always blank. How can I can get rid of this and get the combobox to add only the items I am adding to the ArrayCollection?
[flexcoders] Re: combobox fills in with blank element
Here is the relevant code from the component with the combobox: [Bindable] private var signalList:ArrayCollection = new ArrayCollection(); public function setSignals(sig:ArrayCollection):void { signalList = sig; } mx:ComboBox dataProvider={signalList} selectedIndex=0 toolTip={signal.selectedItem.name} change=selectSignal() color=#00 id=signal labelField=name/ And here is my Application actionscript code for populating signalList: var arr:Array = archiveList.selectedItems; for (var i:int=0; iarr.length; i++) { if (!signalList.contains(arr[i].name)) { signalList.addItem(arr[i].name); } } var sort:Sort = new Sort(); // Set the sort field (case-insensitive) sort.fields = [new SortField(null,true)]; // Assign the Sort object to the view. signalList.sort = sort; // Apply the sort to the collection. signalList.refresh(); --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: Show your code. Last time, someone was inadvertently putting a space into the CB's dataProvider From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of netdeep Sent: Friday, July 11, 2008 5:48 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] combobox fills in with blank element I have an ArrayCollection which is the dataProvider for a combobox in a custom component. However the ArrayCollection is located in the application so I assign it to the custom component via actionscript in the component. When I call addItem on the ArrayCollection the items go into the combobox, however the first element is always blank. How can I can get rid of this and get the combobox to add only the items I am adding to the ArrayCollection?
[flexcoders] Re: legend setstyle not working properly
That did it! Thanks! --- In flexcoders@yahoogroups.com, Tim Hoff [EMAIL PROTECTED] wrote: Looks like direction is a property; not a style. Try genericLegend.direction = horizontal; -TH --- In flexcoders@yahoogroups.com, netdeep deepnet@ wrote: I am trying to change the formatting for a Legend in Actionscript: genericLegend.setStyle(direction, horizontal); But this does nothing, instead it lists the items vertically. What is the proper way to do this in Actionscipt?
[flexcoders] legend setstyle not working properly
I am trying to change the formatting for a Legend in Actionscript: genericLegend.setStyle(direction, horizontal); But this does nothing, instead it lists the items vertically. What is the proper way to do this in Actionscipt?
[flexcoders] flex and automation
There are no flex user groups in my area and I've been trying for a long time to find a solution to this problem with no success. I need to generate a series of charts every few minutes/hours/days on an automated basis. I pull the data for the charts from the database and draw the chart, then save it as an image and potentially notify someone where they can find the image as a png or a pdf. I am using java on the backend to communicate with the database and flex to draw the charts. The same app which draws the chart can also be called by a user to get a live snapshot. But the automation just isn't working. It works fine on my local development machine, but this application is deployed on a headless server and the flex process never gets to launch since it needs to run on a browser. I've looked at solutions for getting it to run headless but so far I can't get it to work. Does anyone know how to automate flex in this way? I know flex is meant to be interactive, but is there anyway I can still use the flex charting for automated output?
[flexcoders] Re: flex and automation
Seth, thanks for the reply. What I'm wondering is how to trick the server into running the browser in a headless environment. Does anyone know how to get flex to run this way, in the background? Thanks, DJ --- In flexcoders@yahoogroups.com, Seth Hodgson [EMAIL PROTECTED] wrote: If you're rendering the charts in the browser player and then pushing a bitmap back to the server, that needs to run in a browser (or in AIR, also not headless). Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of netdeep Sent: Friday, June 27, 2008 7:44 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] flex and automation There are no flex user groups in my area and I've been trying for a long time to find a solution to this problem with no success. I need to generate a series of charts every few minutes/hours/days on an automated basis. I pull the data for the charts from the database and draw the chart, then save it as an image and potentially notify someone where they can find the image as a png or a pdf. I am using java on the backend to communicate with the database and flex to draw the charts. The same app which draws the chart can also be called by a user to get a live snapshot. But the automation just isn't working. It works fine on my local development machine, but this application is deployed on a headless server and the flex process never gets to launch since it needs to run on a browser. I've looked at solutions for getting it to run headless but so far I can't get it to work. Does anyone know how to automate flex in this way? I know flex is meant to be interactive, but is there anyway I can still use the flex charting for automated output?
[flexcoders] Re: image snapshot in flex
Can the data not be passed simply as a ByteArray instead of a base64 string? This is from the Adobe documentation for URLRequest: - dataproperty An object containing data to be transmitted with the URL request. This property is used with the method property. In Adobe AIR, data is sent when any HTTP method other than GET is used. In Flash Player, data is set when the POST HTTP method is used. The URLRequest API offers binary POST support and support for URL-encoded variables, as well as support for strings. The data object can be a ByteArray, URLVariables, or String object. The way in which the data is used depends on the type of object used: If the object is a ByteArray object, the binary data of the ByteArray object is used as POST data. For GET, data of ByteArray type is not supported. --- My problem is that I am also deficient in my experience with servlets and don't know how to decode a byte array there, but this is how I send the byte array var imageSnap:ImageSnapshot = ImageSnapshot.captureImage(component); var imageByteArray:ByteArray = imageSnap.data as ByteArray; var request:URLRequest = new URLRequest(imgServURL); request.data = imageByteArray; request.method = URLRequestMethod.POST; navigateToURL(request); --- In flexcoders@yahoogroups.com, leds usop [EMAIL PROTECTED] wrote: without remoting, and using string param only, encode the image as jpeg or png (depending on your requirement) . then convert it to base64 string which you can pass to the serlvet via post (or get, whatever) . Then decode at the backend accordingly as a jpeg file or png file which is you can make available to the user. This is not the fastest solution performance-wise but it does get the job done expecially for snapshots. --- On Thu, 6/26/08, netdeep [EMAIL PROTECTED] wrote: From: netdeep [EMAIL PROTECTED] Subject: [flexcoders] image snapshot in flex To: flexcoders@yahoogroups.com Date: Thursday, June 26, 2008, 12:47 AM I'd like to add a button so the user can snapshot a graph in my flex app. I can do this storing it on the server with Java, but I'd like for the user to have direct access to it. Since I don't think this can be done for instance saving to the desktop, I thought the next best solution would be to send the image to say a new browser window, possibly via a servlet? But I'm not sure how to do this or if this is the best solution. Any ideas or examples of how this should be done? Here is a little snippet of the method I use to encode the image into a byteArray: private function saveImage(e: ImageUpdateEvent ):void { var comp:UIComponent = e.comp; var imageSnap:ImageSnap shot = ImageSnapshot. captureImage( comp); var imageByteArray: ByteArray = imageSnap.data as ByteArray; imgSave.saveImage( imageByteArray, e.name+-img. png); }
[flexcoders] image snapshot in flex
I'd like to add a button so the user can snapshot a graph in my flex app. I can do this storing it on the server with Java, but I'd like for the user to have direct access to it. Since I don't think this can be done for instance saving to the desktop, I thought the next best solution would be to send the image to say a new browser window, possibly via a servlet? But I'm not sure how to do this or if this is the best solution. Any ideas or examples of how this should be done? Here is a little snippet of the method I use to encode the image into a byteArray: private function saveImage(e:ImageUpdateEvent):void { var comp:UIComponent = e.comp; var imageSnap:ImageSnapshot = ImageSnapshot.captureImage(comp); var imageByteArray:ByteArray = imageSnap.data as ByteArray; imgSave.saveImage(imageByteArray, e.name+-img.png); }
[flexcoders] Re: setting fillcolor with actionscript and stylename
Perhaps I am not understanding this properly. When I add the following style to my Panel: mx:Style .gradientBgrd { borderStyle: applicationControlBar; fillColors: #003483,#a9a7ff; fillAlphas: 0.6, 0.6; highlightAlphas: 0, 0; } /mx:Style It renders with a nice gradient background because the borderStyle is set to applicationControlBar. But how do I access the named .gradientBgrd style in my setStyle commands in actionscript? I believe if I could do that, I could effectively set the fillColors in the panel with Actionscript. --- In flexcoders@yahoogroups.com, Tim Hoff [EMAIL PROTECTED] wrote: Hi, fillColors is not a supported property (style) for a Panel. Unless you draw your own gradiant background with a programatic skin (borderSkin) or use a background image, you're going to be stuck with a solid backgroundColor on a container; except the Application tag. -TH --- In flexcoders@yahoogroups.com, netdeep deepnet@ wrote: I have a panel component: mx:Panel id=panel styleName=gradientBgrd mx:Style .gradientBgrd { borderStyle: applicationControlBar; } /mx:Style And I want to update the fillColors in actionscript: panel.setStyle(fillColors, [0xFF, 0x00]); but this doesn't work. What is the proper syntax? Thanks.
[flexcoders] AIR deployment on server
I have a Flex app which needs to run on the server in the background. I was thinking of turning into an AIR app since it really doesn't need to run on the browser. But how could I deploy this. I am sending my entire flex project as a .war file to deploy on the server and am using BlazeDS to work with some java backend code. But all of the tutorials for AIR seem to assume some sort of manual install method and I just want to bundle it with my current project. Is this possible? And if so, how is this done? As a side note, I don't know if there is a separate AIR group or forum somewhere that might be a better place to ask about these things. If you know of one, please let me know.
[flexcoders] setting fillcolor with actionscript and stylename
I have a panel component: mx:Panel id=panel styleName=gradientBgrd mx:Style .gradientBgrd { borderStyle: applicationControlBar; } /mx:Style And I want to update the fillColors in actionscript: panel.setStyle(fillColors, [0xFF, 0x00]); but this doesn't work. What is the proper syntax? Thanks.
[flexcoders] Re: automated image files on a headless server with AIR?
Java programmers all seem to think that running an image generating process in a web browser window on the server is bad practice. So I think I might just go ahead and compile it as an AIR app. I'm not sure though how to deploy AIR apps though. Can they go in a .war file? If someone has any ideas about this or if there is an aircoders list that might better answer this question or if going AIR is the wrong approach here please let me know. Thanks! --- In flexcoders@yahoogroups.com, netdeep [EMAIL PROTECTED] wrote: I am using the following method to save the image: private function captureImg(comp:UIComponent, name:String):void { var imageSnap:ImageSnapshot = ImageSnapshot.captureImage(comp); var imageByteArray:ByteArray = imageSnap.data as ByteArray; imgSave.saveImage(imageByteArray, name+-img.png); } imgSave is a RemoteObject java class. The problem is that the flex app which runs this code never gets launched on the server. When I try to launch it from java with a runtime exec and the URL, it never launches, presumably because it is running in a browser and the server is headless. That's why I am considering reconfiguring flex to run headless or converting it into an AIR app. --- In flexcoders@yahoogroups.com, Igor Costa igorcosta@ wrote: actually not need air app to do that, You can use the bytearray to encode the image and send to your java to save that each time or in meanwhile you need. Regards Igor On Mon, Jun 2, 2008 at 4:50 PM, netdeep deepnet@ wrote: I am trying to run flex as an image generator on the server. Since my server is headless, the feedback I am getting is that it is bad practice to run flex in the browser for a background app. Here's what the program does in a nutshell: The server launches my java app. It reads a list of report definitions from the data base. For each report, it spawns a thread. Each thread launches my Flex application in the browser. Flex draws the data in charts. Each time data is pushed to the flex application from the java server side, Flex calls a remote java method to save it's image to a file. This file sits in a directory where it can be viewed in a regular old html page. The problem is really the automated aspect. I want to have this chart generated every few minutes as a .png file. It works perfectly fine on my localhost machine, but the server deployment is so far not working. We have firefox installed on the server. Is there no way to launch it as a background process to draw these images? Should I turn this into an AIR app (I've never done anything with AIR up to this point) to make it run more easily in the background? -- Igor Costa www.igorcosta.com www.igorcosta.org
[flexcoders] Re: automated image files on a headless server with AIR?
I am using the following method to save the image: private function captureImg(comp:UIComponent, name:String):void { var imageSnap:ImageSnapshot = ImageSnapshot.captureImage(comp); var imageByteArray:ByteArray = imageSnap.data as ByteArray; imgSave.saveImage(imageByteArray, name+-img.png); } imgSave is a RemoteObject java class. The problem is that the flex app which runs this code never gets launched on the server. When I try to launch it from java with a runtime exec and the URL, it never launches, presumably because it is running in a browser and the server is headless. That's why I am considering reconfiguring flex to run headless or converting it into an AIR app. --- In flexcoders@yahoogroups.com, Igor Costa [EMAIL PROTECTED] wrote: actually not need air app to do that, You can use the bytearray to encode the image and send to your java to save that each time or in meanwhile you need. Regards Igor On Mon, Jun 2, 2008 at 4:50 PM, netdeep [EMAIL PROTECTED] wrote: I am trying to run flex as an image generator on the server. Since my server is headless, the feedback I am getting is that it is bad practice to run flex in the browser for a background app. Here's what the program does in a nutshell: The server launches my java app. It reads a list of report definitions from the data base. For each report, it spawns a thread. Each thread launches my Flex application in the browser. Flex draws the data in charts. Each time data is pushed to the flex application from the java server side, Flex calls a remote java method to save it's image to a file. This file sits in a directory where it can be viewed in a regular old html page. The problem is really the automated aspect. I want to have this chart generated every few minutes as a .png file. It works perfectly fine on my localhost machine, but the server deployment is so far not working. We have firefox installed on the server. Is there no way to launch it as a background process to draw these images? Should I turn this into an AIR app (I've never done anything with AIR up to this point) to make it run more easily in the background? -- Igor Costa www.igorcosta.com www.igorcosta.org
[flexcoders] configuring for a headless server
I have seen a few posts about setting up flex to run on a headless server but I'm a bit confused about how to actually do this or even if this will fix my problem. This is what the documentation says should be done to set things up: --- define the value of the headless-server tag in the flex-config.xml file. Setting this property to true is required to support fonts and SVG images in a nongraphical environment. The headless-server tag is a child tag of compiler. The following example sets headless-server to true: headless-servertrue/headless-server --- Seems straight forward enough, but when I deploy to the server using a war file, I am not providing the flex-config.xml file. Do I need to get my sys admin to update this on the server manually? What I am doing is launching flex from the server as a thread to run in the background and save snapshots of charts drawn in flex every time new data is sent from the server to the flex app running in the browser. So in this instance of flex, no user is involved. The server is a headless rack mounted computer.
[flexcoders] automated image files on a headless server with AIR?
I am trying to run flex as an image generator on the server. Since my server is headless, the feedback I am getting is that it is bad practice to run flex in the browser for a background app. Here's what the program does in a nutshell: The server launches my java app. It reads a list of report definitions from the data base. For each report, it spawns a thread. Each thread launches my Flex application in the browser. Flex draws the data in charts. Each time data is pushed to the flex application from the java server side, Flex calls a remote java method to save it's image to a file. This file sits in a directory where it can be viewed in a regular old html page. The problem is really the automated aspect. I want to have this chart generated every few minutes as a .png file. It works perfectly fine on my localhost machine, but the server deployment is so far not working. We have firefox installed on the server. Is there no way to launch it as a background process to draw these images? Should I turn this into an AIR app (I've never done anything with AIR up to this point) to make it run more easily in the background?
[flexcoders] launching flex with arguments
Is there a way to launch a flex app and pass it arguments similar to java's public static void main(String [ ] args) ?
[flexcoders] Re: launching flex with arguments
Jeff, thanks for the quick reply. Could you give me an example of passing say a single string? Is it something like the way the debugger works where you tack args on to the end of the url: http://localhost:/home/myApp.html?debug=true --- In flexcoders@yahoogroups.com, Battershall, Jeff [EMAIL PROTECTED] wrote: Yes, you can pass variables to the Flex app via flashVars. These then can be accessed via Application.application.parameters.myVarName in your application. This would mean that you'd have to modify the default html wrapper, which is easy to do. Jeff -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of netdeep Sent: Thursday, May 29, 2008 10:59 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] launching flex with arguments Is there a way to launch a flex app and pass it arguments similar to java's public static void main(String [ ] args) ? -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
[flexcoders] Re: launching flex with arguments
Thanks again. For anyone else with this problem, I ended up doing a search on the parameters for flex and stumbled across this post which works just fine: http://www.abdulqabiz.com/blog/archives/macromedia_flex/how_to_get_url.php --- In flexcoders@yahoogroups.com, Battershall, Jeff [EMAIL PROTECTED] wrote: Take a look at the default html wrapper that is produced by Flex. You'll see where the flashVars are set. Depending on what web application platform you're on, you can dynamically pass in url parameters to the application by dynamically altering a custom wrapper at runtime. Another approach would be to use SWFObject (http://blog.deconcept.com/swfobject/#examples). I'm sure there are others as well. Jeff -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of netdeep Sent: Thursday, May 29, 2008 11:28 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: launching flex with arguments Jeff, thanks for the quick reply. Could you give me an example of passing say a single string? Is it something like the way the debugger works where you tack args on to the end of the url: http://localhost:/home/myApp.html?debug=true --- In flexcoders@yahoogroups.com, Battershall, Jeff jeff.battershall@ wrote: Yes, you can pass variables to the Flex app via flashVars. These then can be accessed via Application.application.parameters.myVarName in your application. This would mean that you'd have to modify the default html wrapper, which is easy to do. Jeff -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of netdeep Sent: Thursday, May 29, 2008 10:59 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] launching flex with arguments Is there a way to launch a flex app and pass it arguments similar to java's public static void main(String [ ] args) ? -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
[flexcoders] messaging selector
I am trying to filter my channel messaging with blazeDS so that it only gets read by specific clients, but it doesn't seem to be working as expected. Here's what I'm doing. In flex: var id:String = someValue; consumer.selector = ID = '+id+'; And in java I do this to pass the message: String clientID = UUIDUtils.createUUID(); message = new AsyncMessage(); message.setDestination(factory); message.setClientId(clientID); message.setMessageId(UUIDUtils.createUUID()); message.setTimestamp(System.currentTimeMillis()); message.setHeader(ID, item.getID()); message.setBody(data); service.pushMessageToClients(message, false); But the flex app is still getting info from all of the messages sent, not just those where I set the ID to it's id in the header. How can I get this to work?
[flexcoders] Re: messaging selector
It might be hard to see, but the single quotes are actually there. If I put in some arbitrary spaces, you can see them: var id:String = someValue; consumer.selector = ID = ' +id+ ' ; // single quotes around variable id Or did you mean I need single quotes in the java setHeader method as well? --- In flexcoders@yahoogroups.com, meteatamel [EMAIL PROTECTED] wrote: Could it be because you're missing single quotes around id? -Mete --- In flexcoders@yahoogroups.com, netdeep deepnet@ wrote: I am trying to filter my channel messaging with blazeDS so that it only gets read by specific clients, but it doesn't seem to be working as expected. Here's what I'm doing. In flex: var id:String = someValue; consumer.selector = ID = '+id+'; And in java I do this to pass the message: String clientID = UUIDUtils.createUUID(); message = new AsyncMessage(); message.setDestination(factory); message.setClientId(clientID); message.setMessageId(UUIDUtils.createUUID()); message.setTimestamp(System.currentTimeMillis()); message.setHeader(ID, item.getID()); message.setBody(data); service.pushMessageToClients(message, false); But the flex app is still getting info from all of the messages sent, not just those where I set the ID to it's id in the header. How can I get this to work?
[flexcoders] Re: blazeds messaging with multiple channels multiple instances of flex
Now that I'm further down the road with this project, I am still running into problems with flex, java, blazeds, and multi-threading. The main roadblock right now is: 1. I don't know how to launch multiple instances of my flex app. Each time I do a java exec call to start the flex app, it always runs at the same url in the same window. So if I send it data for several charts, each running in a thread and sending out data over the channel periodically, it will not produce the images properly but becomes confused since it's not designed to handle multiple charts at once and even if it was, that would be very inefficient as I would have to pass ALL the data each time rather than just passing the lion's share at startup with small updates periodically thereafter. The application needs to produce .png snapshots every few minutes/seconds, etc. - a different set of images for each chart. Since I don't want to have to reload old chart data with each new snapshot (I just want to update the charts with the newer data) it seems like the flex app should be persistently running on the server, a different instance for each chart. I can do all of this with a single instance of my app and one thread no problem, but I'm running into dead ends trying to get multiple chart snapshots working. Should I try getting a single flex app to handle all of the charts? Or can I get multiple instances of my app to run simultaneously and pump out these images? --- In flexcoders@yahoogroups.com, gjessup1 [EMAIL PROTECTED] wrote: Should work...no problem. I guess you would just have each different chart invoking a different remote method, or at least handling the results differently. No reason that should not work at all. Each time the page is loaded and a chart is selected, it creates a seperate instance, and each instance invokes the method seperately...so yes, seperate threads. Seems like a fine approach to me. Unless you are going to have some huge number of users..then you may want to involve a queue to cache changes, but current approach seems good to start with. --- In flexcoders@yahoogroups.com, netdeep deepnet@ wrote: Here is a diagram of what the program needs to do: Database /\ | | \/ Manager.java queries database (for each Report in Database spawn Thread) | | \/ Thread to queries database every X sec/min/hrs to get new data for chart (thread launches Flex RIA report frontend) | | \/ Flex app subscribes to Thread as consumer to listen for new data to draw chart to messages from ONLY that thread. The desired effect is that the user could go to a master web portal and select which report he wants to see. This web portal serves up whatever chart the user requests in a separate web page. Maybe my approach is off, but that's how I've been coming at it so far. Thanks for any help you can offer.
[flexcoders] combobox set selecteditem
I've seen a half dozen solutions to this on the internet but somehow they don't work. Basically I just want to set the selectedItem of a combobox: mx:Combobox id=comboboxID dataprovider={httpserv.lastresult.system.data}/ // actionscript which won't work comboboxID.selectedItem = something; So then I tried to loop through the comboboxID.dataprovider to find the index for something but it won't ever give me the dataprovider strings, instead giving me errors like this: warning: unable to bind to property 'name' on class 'String' (class is not an IEventDispatcher) How can I get this working? Thanks.
[flexcoders] Re: chart data change events
The problem with the events is that if I listen to changes in the array, I don't have access to the chart when the event fires. You can't pass arguments to the event so the only thing it will know about is the array which fires it. And as I said before, when I create custom events, I have to dispatch them myself and they never get called when I need them to, but are always late. My best guess was to try FlexEvent.UPDATE_COMPLETE but that seems to never get fired when I simply append to the array which is the dataprovider for the axis. So I'm unsure what to do with these suggestions. Thanks, though! --- In flexcoders@yahoogroups.com, Sunil Bannur [EMAIL PROTECTED] wrote: When the dataprovider changes, each series's protected dataChanged function gets called. Also, you could access the chart's dataProvider as a ICollection and add an event listener to it to keep track of the data changes. Thanks -Sunil From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of netdeep Sent: Thursday, May 22, 2008 11:25 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] chart data change events I need to capture an event for when the data is updated in a chart. I take a snapshot of the chart and save it to a file. But when I do it via a custom event which I fire myself, it fires the event and takes the screenshot before the update and so just snapshots the previous state of the chart. And if I use FlexEvent.UPDATE_COMPLETE, it doesn't register a change since what I am doing is adding data to the array which is the dataProvider for the chart. I can't put an update event listener to the array itself since the array does not have any way to reference back to it's chart. Any help would be greatly appreciated
[flexcoders] chart data change events
I need to capture an event for when the data is updated in a chart. I take a snapshot of the chart and save it to a file. But when I do it via a custom event which I fire myself, it fires the event and takes the screenshot before the update and so just snapshots the previous state of the chart. And if I use FlexEvent.UPDATE_COMPLETE, it doesn't register a change since what I am doing is adding data to the array which is the dataProvider for the chart. I can't put an update event listener to the array itself since the array does not have any way to reference back to it's chart. Any help would be greatly appreciated
[flexcoders] Re: image factory threaded application
Actually I am using BlazeDS with messaging. The problem is getting multiple images to snapshot. In practice when I send multiple charts to the client one after the other, only the last one gets drawn and the other messages seem to get overwritten before ever completing the snapshot request. --- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] wrote: Have the Flex client poll the server for updates, or use LCDS or BlazeDS which provide push technology. Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of netdeep Sent: Tuesday, May 20, 2008 3:04 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] image factory threaded application I've reached an impass with my current development of a flex app to publish image snapshots of charts. I can get the program to run fine when I just have one chart, but I'm not sure how to produce multiple images. Here's how it's set up at the moment: When the server launches, a java app looks in the database for chart definitions. For each chart it will have data as well as a publishing frequency (say every 10 minutes or every 2 hours, etc). So for each report I thought I'd launch a thread and have that thread send the data for drawing the chart to the flex app. However in practice, the threads launch the flex app and only one of the charts gets published. How can I get a flex app to draw multiple charts like this? They have to continually update based on the publishing frequency for the chart and I have to make sure that each chart gets drawn. How would you approach implementing this image factory application?
[flexcoders] image factory threaded application
I've reached an impass with my current development of a flex app to publish image snapshots of charts. I can get the program to run fine when I just have one chart, but I'm not sure how to produce multiple images. Here's how it's set up at the moment: When the server launches, a java app looks in the database for chart definitions. For each chart it will have data as well as a publishing frequency (say every 10 minutes or every 2 hours, etc). So for each report I thought I'd launch a thread and have that thread send the data for drawing the chart to the flex app. However in practice, the threads launch the flex app and only one of the charts gets published. How can I get a flex app to draw multiple charts like this? They have to continually update based on the publishing frequency for the chart and I have to make sure that each chart gets drawn. How would you approach implementing this image factory application?
[flexcoders] Re: Sending data to the Server
I got several errors on the server when I tried to add those properties to the services and messaging config files. Where are they supposed to go exactly? My messaging channel is a ServiceAdapter defined in the messaging-config.xml file as: adapter-definition id=TerracottaGateway class=factory.ReportManager/ destination id=factory adapter ref=TerracottaGateway/ channels channel ref=my-polling-amf/ channel ref=my-streaming-amf/ /channels /destination I have defined setters and get methods for classes. I even used cut and paste to make sure the actionscript and java names are identical for all of the variables and methods. Yet I still don't get java to recognize the Axis class. It has about 12 variables. Most of the variables are Strings and ints, but one is an ArrayList (ArrayCollection in Actionscript). However this conversion seems to work fine in my Chart class. Curiously my chart class maps fine from java to actionscript, even though I have no setter methods in it, only get methods. I have only two variables there: a String, and an ArrayList. --- In flexcoders@yahoogroups.com, Seth Hodgson [EMAIL PROTECTED] wrote: Make sure your classes adhere to AMF serialization rules. You need public get/set accessors for each property. You can also use either of the following config settings for your channel-definition on the server to further debug any problems with de/serializing your custom types. channel-definition ... ... properties serialization ignore-property-errorsfalse/ignore-property-errors log-property-errorstrue/log-property-errors /serialization You could use either (or both); when ignore-property-errors is false, an exception is thrown when a property can't be handled rather than just being ignored (the historic default to match player behavior). When log-property-errors is true, you'll get a warning logged on the server when a property is ignored. If you enable this, add Endpoint.* to your log category filters to see these. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of netdeep Sent: Monday, May 12, 2008 12:07 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Sending data to the Server Thanks for the reply Seth. I am now able to send an ArrayCollection of my custom class Chart: [Bindable] [RemoteClass(alias=factory.data.Chart)] public class ChartObject { private var name:String; private var axisList:ArrayCollection; public function getAxisList():ArrayCollection { return axisList; } } And I can read the array in the java message handler, and it even detects the objects in the array as Charts but when I try to get the axisList array from within Chart, it comes up as null. The axisList is an array of objects from another custom class I have called Axis. Here is a sample of the java Chart class for reference: public class Chart { //import mx.collections.ArrayCollection; //import mx.controls.Image; public String name; public ArrayList axisList; public ArrayList getAxisList() { return axisList; } --- In flexcoders@yahoogroups.com, Seth Hodgson shodgson@ wrote: You can send any type of data as the body of a message. If you want to send an instance of a typed class, be sure to include [RemoteClass(alias=your.java.Class)] metadata in your ActionScript class so that the Player serializes it with type info and the server can deserialize it to your desired type. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of netdeep Sent: Friday, May 09, 2008 7:21 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Sending data to the Server I need to send data to the server. Up til now I've been using messaging. But as far as I can tell, I can only send strings this way. What other alternatives are there? For instance, I would like to be able to send an array or a custom data structure. I'm using Java for the backend. Ideally I would not want to launch a new RemoteObject for each send from Flex, but instead have a persistent listener to hear all requests (which is why I initially chose messaging and created a channel for the java message manager to listen to).
[flexcoders] Re: Sending data to the Server
Hey my bad, I just found out I was not instantiating my AxisObject class correctly on the flex side. So I can pass the variables find now. However I would still like to figure out how to turn on the warning messages in the config files so that in the future I can hopefully catch mistakes like this much quicker. If you have time and could post maybe a more complete sample along with which files you need to update, I'd appreciate it. Thanks for the help. --- In flexcoders@yahoogroups.com, netdeep [EMAIL PROTECTED] wrote: I got several errors on the server when I tried to add those properties to the services and messaging config files. Where are they supposed to go exactly? My messaging channel is a ServiceAdapter defined in the messaging-config.xml file as: adapter-definition id=TerracottaGateway class=factory.ReportManager/ destination id=factory adapter ref=TerracottaGateway/ channels channel ref=my-polling-amf/ channel ref=my-streaming-amf/ /channels /destination I have defined setters and get methods for classes. I even used cut and paste to make sure the actionscript and java names are identical for all of the variables and methods. Yet I still don't get java to recognize the Axis class. It has about 12 variables. Most of the variables are Strings and ints, but one is an ArrayList (ArrayCollection in Actionscript). However this conversion seems to work fine in my Chart class. Curiously my chart class maps fine from java to actionscript, even though I have no setter methods in it, only get methods. I have only two variables there: a String, and an ArrayList. --- In flexcoders@yahoogroups.com, Seth Hodgson shodgson@ wrote: Make sure your classes adhere to AMF serialization rules. You need public get/set accessors for each property. You can also use either of the following config settings for your channel-definition on the server to further debug any problems with de/serializing your custom types. channel-definition ... ... properties serialization ignore-property-errorsfalse/ignore-property-errors log-property-errorstrue/log-property-errors /serialization You could use either (or both); when ignore-property-errors is false, an exception is thrown when a property can't be handled rather than just being ignored (the historic default to match player behavior). When log-property-errors is true, you'll get a warning logged on the server when a property is ignored. If you enable this, add Endpoint.* to your log category filters to see these. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of netdeep Sent: Monday, May 12, 2008 12:07 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Sending data to the Server Thanks for the reply Seth. I am now able to send an ArrayCollection of my custom class Chart: [Bindable] [RemoteClass(alias=factory.data.Chart)] public class ChartObject { private var name:String; private var axisList:ArrayCollection; public function getAxisList():ArrayCollection { return axisList; } } And I can read the array in the java message handler, and it even detects the objects in the array as Charts but when I try to get the axisList array from within Chart, it comes up as null. The axisList is an array of objects from another custom class I have called Axis. Here is a sample of the java Chart class for reference: public class Chart { //import mx.collections.ArrayCollection; //import mx.controls.Image; public String name; public ArrayList axisList; public ArrayList getAxisList() { return axisList; } --- In flexcoders@yahoogroups.com, Seth Hodgson shodgson@ wrote: You can send any type of data as the body of a message. If you want to send an instance of a typed class, be sure to include [RemoteClass(alias=your.java.Class)] metadata in your ActionScript class so that the Player serializes it with type info and the server can deserialize it to your desired type. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of netdeep Sent: Friday, May 09, 2008 7:21 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Sending data to the Server I need to send data to the server. Up til now I've been using messaging. But as far as I can tell, I can only send strings this way. What other alternatives are there? For instance, I would like to be able to send an array or a custom data structure. I'm using Java for the backend. Ideally I would not want to launch a new RemoteObject for each send from Flex, but instead have a persistent listener to hear all
[flexcoders] Re: Sending data to the Server
Thanks for the reply Seth. I am now able to send an ArrayCollection of my custom class Chart: [Bindable] [RemoteClass(alias=factory.data.Chart)] public class ChartObject { private var name:String; private var axisList:ArrayCollection; public function getAxisList():ArrayCollection { return axisList; } } And I can read the array in the java message handler, and it even detects the objects in the array as Charts but when I try to get the axisList array from within Chart, it comes up as null. The axisList is an array of objects from another custom class I have called Axis. Here is a sample of the java Chart class for reference: public class Chart { //import mx.collections.ArrayCollection; //import mx.controls.Image; public String name; public ArrayList axisList; public ArrayList getAxisList() { return axisList; } --- In flexcoders@yahoogroups.com, Seth Hodgson [EMAIL PROTECTED] wrote: You can send any type of data as the body of a message. If you want to send an instance of a typed class, be sure to include [RemoteClass(alias=your.java.Class)] metadata in your ActionScript class so that the Player serializes it with type info and the server can deserialize it to your desired type. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of netdeep Sent: Friday, May 09, 2008 7:21 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Sending data to the Server I need to send data to the server. Up til now I've been using messaging. But as far as I can tell, I can only send strings this way. What other alternatives are there? For instance, I would like to be able to send an array or a custom data structure. I'm using Java for the backend. Ideally I would not want to launch a new RemoteObject for each send from Flex, but instead have a persistent listener to hear all requests (which is why I initially chose messaging and created a channel for the java message manager to listen to).
[flexcoders] Sending data to the Server
I need to send data to the server. Up til now I've been using messaging. But as far as I can tell, I can only send strings this way. What other alternatives are there? For instance, I would like to be able to send an array or a custom data structure. I'm using Java for the backend. Ideally I would not want to launch a new RemoteObject for each send from Flex, but instead have a persistent listener to hear all requests (which is why I initially chose messaging and created a channel for the java message manager to listen to).
[flexcoders] Reading a message with SeviceAdapters
I'm using messaging with blazeds and I can send a message with a producer from flex, but I don't know how to read its contents in my java ServiceAdapter. I have a class: public class ChannelListener extends ServiceAdapter { public Object invoke(Message message) { } } } But what do I do in the invoke method to parse out the message? All I can figure out is to call message.getBody() which returns an generic Object. But what should be done with this Object? Or is there some other method which will help me extract the info from the message?
[flexcoders] Re: Frustrations with blazeds messaging
Thanks for the reply Tom. I do have shadows turned off but it doesn't seem to help. I agree 10K points seems like too much, but here is a sample of the chart which I am trying to reproduce (There are several charts on this page and if you select 'Ch95' the top chart is the one I am currently working on) http://neutrons.ornl.gov/diagnostics/channel13/Ch13.html I think the idea is also that if the user wants to drill down and see more detail, more plot points will allow for better analysis of the data. By the way, for some reason the chart is not locking up completely today. I have no idea why though since nothing has changed. The performance is still really slow however. --- In flexcoders@yahoogroups.com, Tom Chiverton [EMAIL PROTECTED] wrote: On Tuesday 29 Apr 2008, netdeep wrote: huge. I've plotted over 140K points in some runs. But even when I filter the data and plot around 10K points, I get browser lockup while it loads and it takes 5-10 seconds to produce the chart and lately it has even been crashing on the larger data sets. Flex charting does indeed get slow, esp. if you are using shadows or a complicated point/line renderer. How is your user meant to make sense of 10K points on a single graph though ? They'll just be a mash, no ? -- Tom Chiverton Helping to greatly customize network functionalities on: http://thefalken.livejournal.com This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB. A list of members is available for inspection at the registered office. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. Regulated by The Solicitors Regulation Authority. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 2500. For more information about Halliwells LLP visit www.halliwells.com.
[flexcoders] Re: Frustrations with blazeds messaging
, but nothing that locks up the application. This is data paging in action, which is just one way of optimizing the data transfer and server load. I think BlazeDS and Flex are a great combination, especially if you're sending a big chunk of data because the compact size of the AMF protocol and the native serialization you get on the client just make the application very responsive, and the automatic type serialization made it quicker to implement and less brittle and error prone than making my own xml serialization scheme. Finally, I suggest you check out Tom Jordahl's excellent presentation on BlazeDS. It's not technical, but it gives you a good, highlevel overview of what it is and its advantages: http://my.adobe.acrobat.com/p56945801/ Best of luck. /r http://www.searchcoders.com/ On Tue, Apr 29, 2008 at 7:43 AM, netdeep [EMAIL PROTECTED] wrote: I've been working for quite a while on a project to display real-time data in a flex chart and just can't seem to 'turn the corner' on it. While the code works, it is plagued by terrible performance and frequently locks up the browser. And I'm wondering if I am just doing something wrong or if there are resources available to navigate out of this quagmire. The BlazeDS website claims it enables Real-time server push over standard HTTP, but what is the expected performance for something like this? How much data can it handle? I realize most charts don't require tons of data points, often needing only 10-100 separate sets of data to display. But for small data sets, why not just use standard HTTP and XML? Why bother with BlazeDS? But in my experience, BlazeDS isn't handling large sets of data very well. I am needing to output scatter plots for scientific data so the data sets can be huge. I've plotted over 140K points in some runs. But even when I filter the data and plot around 10K points, I get browser lockup while it loads and it takes 5-10 seconds to produce the chart and lately it has even been crashing on the larger data sets. Is it the conversion from Java objects to Actionscript which is the problem? Am I not using the right channel? I realize this may be too open-ended of a question to get a specific solution, but if anyone knows a book I could buy, or a course available, or a more in-depth forum, please let me know. There just doesn't seem to be much in-depth material available for this functionality right now. And if there are a few standard things to check for when dealing with messaging or just a performant approach to real-time server push in general please share your insights. I am the only developer working with flex at my job and I can tell that people here are skeptical about my choice to make flex the front end for this application. I'm beginning to wonder myself if I have not made the wrong decision. The graphs we produce look great, but in terms of usability, no one would want to use this product in its current state, its way too sluggish and clunky. Sorry this post ended up so long. Thanks for the help the others have offered in the past and if you have any insights into this, I'd sure appreciate hearing from you. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
[flexcoders] Frustrations with blazeds messaging
I've been working for quite a while on a project to display real-time data in a flex chart and just can't seem to 'turn the corner' on it. While the code works, it is plagued by terrible performance and frequently locks up the browser. And I'm wondering if I am just doing something wrong or if there are resources available to navigate out of this quagmire. The BlazeDS website claims it enables Real-time server push over standard HTTP, but what is the expected performance for something like this? How much data can it handle? I realize most charts don't require tons of data points, often needing only 10-100 separate sets of data to display. But for small data sets, why not just use standard HTTP and XML? Why bother with BlazeDS? But in my experience, BlazeDS isn't handling large sets of data very well. I am needing to output scatter plots for scientific data so the data sets can be huge. I've plotted over 140K points in some runs. But even when I filter the data and plot around 10K points, I get browser lockup while it loads and it takes 5-10 seconds to produce the chart and lately it has even been crashing on the larger data sets. Is it the conversion from Java objects to Actionscript which is the problem? Am I not using the right channel? I realize this may be too open-ended of a question to get a specific solution, but if anyone knows a book I could buy, or a course available, or a more in-depth forum, please let me know. There just doesn't seem to be much in-depth material available for this functionality right now. And if there are a few standard things to check for when dealing with messaging or just a performant approach to real-time server push in general please share your insights. I am the only developer working with flex at my job and I can tell that people here are skeptical about my choice to make flex the front end for this application. I'm beginning to wonder myself if I have not made the wrong decision. The graphs we produce look great, but in terms of usability, no one would want to use this product in its current state, its way too sluggish and clunky. Sorry this post ended up so long. Thanks for the help the others have offered in the past and if you have any insights into this, I'd sure appreciate hearing from you.
[flexcoders] Browser lockup with remote object
The code I have uses a Java Remote Object to receive results from the server and plot them in a chart. This code previously has worked with datasets as large as 180K. Recently, I began querying results from a different database with data in the same format and the code no longer works. It locks up the entire browser and crashes. I've read about this but never specifically with regards to remoting and never with a good solution to the problem or even an understanding as to why this occurs except for an infinite loop. Given that it still works with the old data, I'm wondering what could be causing this to crash now? I've checked the data and its the same kind of information from both queries. In fact, it crashes even if I kill the process immediately after the message begins sending. Error #1502: A script has executed for longer than the default timeout period of 15 seconds
[flexcoders] Re: Browser lockup with remote object
By the way, the only difference I can see in the data is the precision of milliseconds in the date objects: OLD data: 2008-04-14 15:51:02.31 vs. NEW data: 2008-04-15 02:41:14.675756 --- In flexcoders@yahoogroups.com, netdeep [EMAIL PROTECTED] wrote: The code I have uses a Java Remote Object to receive results from the server and plot them in a chart. This code previously has worked with datasets as large as 180K. Recently, I began querying results from a different database with data in the same format and the code no longer works. It locks up the entire browser and crashes. I've read about this but never specifically with regards to remoting and never with a good solution to the problem or even an understanding as to why this occurs except for an infinite loop. Given that it still works with the old data, I'm wondering what could be causing this to crash now? I've checked the data and its the same kind of information from both queries. In fact, it crashes even if I kill the process immediately after the message begins sending. Error #1502: A script has executed for longer than the default timeout period of 15 seconds
[flexcoders] passing parameters to eventlistener functions
I need to pass a parameter to a function using actionscript. However by default, all you can pass are events to the function called by an eventlistener. I know this is easy to do in MXML, but can it be done in actionscript? The documentation has this to say about it: Because the second parameter of addEventListener() is a function, you cannot specify parameters of that function in the addEventListener() call. So, to pass additional parameters to the listener function, you must define them in the listener function and then call the final method with those parameters. But what does it mean to call the final method with those parameters. No examples are given. Could someone give me a quick example of how this is done?
[flexcoders] Re: passing parameters to eventlistener functions
Thanks for the reply Todd. What about processing the event though? For example if I have: foo.addEventListener(MouseEvent.MOUSE_DOWN, processResult); But I want to define processResult so that I can pass it a number or an object, how do I use Custom events? The even I'm want to listen for is the moue down event. When I define this listener, I know the value I want to associate with that event. Later on, I won't know it so that when processResult gets called, it needs that extra parameter to work. I'm a bit confused about how to use the custom event there, since I won't be the one dispatching it. --- In flexcoders@yahoogroups.com, twcrone70 [EMAIL PROTECTED] wrote: Create a custom event that has a field or fields that hold your parameter(s). When you create the event for dispatching you can then add the parameter(s) and since that event is passed in to the handler method, you will have the parameter(s) in the event instance. package mypkg { import flash.events.Event; /** * Custom event that holds extra data. Insipred by Cliff Hall's PureMVC framework * and usage of Notifications. * * @author Todd Crone */ public class CustomEvent extends Event { /** * The data associated with the event. */ public var body:Object; /** * Constructor. * * @param type *The event type. * @param body *The body for this custom event. * @param bubbles *Whether or not this event bubbles up the component hierarchy or not. * @param cancelable *Is this event cancelable by a listener. */ public function CustomEvent( type:String, body:Object, bubbles:Boolean = false, cancelable:Boolean = false ) { super( type, bubbles, cancelable ); this.body = body; } } } Hope this helps! - Todd --- In flexcoders@yahoogroups.com, netdeep deepnet@ wrote: I need to pass a parameter to a function using actionscript. However by default, all you can pass are events to the function called by an eventlistener. I know this is easy to do in MXML, but can it be done in actionscript? The documentation has this to say about it: Because the second parameter of addEventListener() is a function, you cannot specify parameters of that function in the addEventListener() call. So, to pass additional parameters to the listener function, you must define them in the listener function and then call the final method with those parameters. But what does it mean to call the final method with those parameters. No examples are given. Could someone give me a quick example of how this is done?
[flexcoders] Re: data reading for charts inconsistent with Dates?
Am I the first to ever have this problem with muliple series charts? My dates are read from an SQL timestamp and are too precise so even though they are on the same day, they don't show up if one is taken at May 5-2006 10:15:20 and another is at May 5-2006 10:15:21. So unless you match up your data exactly from two independent sources, flex seems forced to choose only one and ignore the other. Is there a way to draw both when the data does not match? --- In flexcoders@yahoogroups.com, netdeep [EMAIL PROTECTED] wrote: Well, actually I've discovered that the problem is that it is a multi-series plot. So whichever series I set the horizontal (CategoryAxis) axis dataprovider to is the one that gets drawn because the dates don't match up exactly (they are precise down to hundredths of seconds so not much chance of hitting the same values. Not sure if there is a solution to this. Anyone have any ideas? Maybe I will have to merge the two date arrays and use that for the horizontal axis dataprovider... --- In flexcoders@yahoogroups.com, netdeep deepnet@ wrote: I am pulling in data for drwaing on a chart. My data formerly displayed properly, but when the data set changed, it no longer displays properly. I can see the data in a dataGrid so I know its there: mx:DataGrid dataProvider={axis2.data} width=400 mx:columns mx:DataGridColumn dataField=point1 width=300 / mx:DataGridColumn dataField=point2 / /mx:columns /mx:DataGrid axis2.data is an ArrayCollection point1 is a Date point2 is a Number But with charts, the display gets flaky. I can get it to show up in an Line chart, but not in a Plot chart. I'm wondering if it is failing to see the Date object. But then why does it work in the Line chart? What in the data would cause the entire chart to choke?
[flexcoders] data reading for charts inconsistent with Dates?
I am pulling in data for drwaing on a chart. My data formerly displayed properly, but when the data set changed, it no longer displays properly. I can see the data in a dataGrid so I know its there: mx:DataGrid dataProvider={axis2.data} width=400 mx:columns mx:DataGridColumn dataField=point1 width=300 / mx:DataGridColumn dataField=point2 / /mx:columns /mx:DataGrid axis2.data is an ArrayCollection point1 is a Date point2 is a Number But with charts, the display gets flaky. I can get it to show up in an Line chart, but not in a Plot chart. I'm wondering if it is failing to see the Date object. But then why does it work in the Line chart? What in the data would cause the entire chart to choke?
[flexcoders] Re: data reading for charts inconsistent with Dates?
Well, actually I've discovered that the problem is that it is a multi-series plot. So whichever series I set the horizontal (CategoryAxis) axis dataprovider to is the one that gets drawn because the dates don't match up exactly (they are precise down to hundredths of seconds so not much chance of hitting the same values. Not sure if there is a solution to this. Anyone have any ideas? Maybe I will have to merge the two date arrays and use that for the horizontal axis dataprovider... --- In flexcoders@yahoogroups.com, netdeep [EMAIL PROTECTED] wrote: I am pulling in data for drwaing on a chart. My data formerly displayed properly, but when the data set changed, it no longer displays properly. I can see the data in a dataGrid so I know its there: mx:DataGrid dataProvider={axis2.data} width=400 mx:columns mx:DataGridColumn dataField=point1 width=300 / mx:DataGridColumn dataField=point2 / /mx:columns /mx:DataGrid axis2.data is an ArrayCollection point1 is a Date point2 is a Number But with charts, the display gets flaky. I can get it to show up in an Line chart, but not in a Plot chart. I'm wondering if it is failing to see the Date object. But then why does it work in the Line chart? What in the data would cause the entire chart to choke?
[flexcoders] messaging to a specific client
I want to send a message to a specific client with messaging. The closest thing I could find was this method from the API: --- pushMessageToClients public void pushMessageToClients(Set subscriberIds, Message message, boolean evalSelector) This method is not invoked across a cluster, it is always locally invoked. The passed message will be pushed to the subscribers in the passed set, conditionally depending upon the execution of their selector expressions. Parameters: subscriberIds - The set of subscribers to push the message to. message - The Message to push. evalSelector - true to evaluate each subscriber's selector before pushing the message to them; false to skip selector evaluation. - But I don't know how to get the subscriberIds associated with a particular client. I can call getSubscriberIds to get a Set of IDs, but I have no idea how to process this information, what format the IDs are in or how to determine which of my flex apps has a given subscriberId. Does anyone have any ideas about how to do this? Thanks.
[flexcoders] Re: blazeds messaging with multiple channels multiple instances of flex
Well, my efforts to get all the parts working have failed to achieve the desired results. Here's what's happening: My Manager class gets loaded when the server starts up. It spawns a thread for each report in the database. Each thread launches an instance of the flex charting app. Now here is where is breaks down... Previously, I had the thread broadcast every few minutes the new data (these are historical charts), but since I only had one channel and channels are defined in the config files, I saw no way to couple each Thread's sendMessages to that specific instance of the flex app. So I thought I'd try Remoting. I told the flex app the reportID it was associated with and then it would call the Manager class which would look for the Thread serving that report and return the results. But the RemoteObject just creates a new instance of the Manager class each time it calls the Manager's getReportData method. So the Threads I initialized on startup never get used and the call to the RemoteObject by flex has no threads running in it, so it returns a null data set How do I get this working? Are channels the way to go? Remoting? Something else? --- In flexcoders@yahoogroups.com, gjessup1 [EMAIL PROTECTED] wrote: Should work...no problem. I guess you would just have each different chart invoking a different remote method, or at least handling the results differently. No reason that should not work at all. Each time the page is loaded and a chart is selected, it creates a seperate instance, and each instance invokes the method seperately...so yes, seperate threads. Seems like a fine approach to me. Unless you are going to have some huge number of users..then you may want to involve a queue to cache changes, but current approach seems good to start with. --- In flexcoders@yahoogroups.com, netdeep deepnet@ wrote: Here is a diagram of what the program needs to do: Database /\ | | \/ Manager.java queries database (for each Report in Database spawn Thread) | | \/ Thread to queries database every X sec/min/hrs to get new data for chart (thread launches Flex RIA report frontend) | | \/ Flex app subscribes to Thread as consumer to listen for new data to draw chart to messages from ONLY that thread. The desired effect is that the user could go to a master web portal and select which report he wants to see. This web portal serves up whatever chart the user requests in a separate web page. Maybe my approach is off, but that's how I've been coming at it so far. Thanks for any help you can offer.
[flexcoders] java RemoteClass null ArrayCollection/List
I am sending an object in java to a flex app via messaging. Some of the data is coming across ok (Strings) but my List object is coming across as null even though the original java class: import java.util.ArrayList; public class Axis { String title; List axisList; // constructors and other methods here public List getAxisList() { return axisList; } public String getTitle() { return title; } } And here is the mapped ActionScript version: package com.data { import mx.collections.ArrayCollection; [Bindable] [RemoteClass(alias=com.data.Axis)] public class AxistObject { public var title:String; public var axisList:ArrayCollection; public function getAxisList():ArrayCollection { return axisList; } public function getTitle():String { return title; } } } Why is it coming across as null?