[flexcoders] flex toggle button question
Hi All, I have a toggle button (play / pause), that needs to be 'clicked' externally from flash (e.g. a javascript call thru external interface to pause the video). I am able to make the button switch state by saying playPauseButton.selected=true This succeeds in toggling the skin for the button, but doesn't seem to toggle the internal state of the button. So the next time the button is clicked with the mouse, the click action doesn't fire, and you have to click the button twice to have it work. Has anyone seen this before? Thanks, Adrian
Re: [flexcoders] Help with AdvancedDataGrid - Urgent
Hi Santosh, Check out GroupingCollection. Adrian Santosh Varghese wrote: Hi, I am new to Flex development. I wanted to use the AdvancedDataGrid to display data in a tree structure. coming from a remoteobject . The remote object is a java Collections object. I could read this data and get into Flex ArrayCollection. The data in the ArrayCollection contians complex data structure, which cannot be displayed directly into AdvancedDataGrid. So i need to create a seperate ArrayCollection object , which serves as the dataprovider for AdvancedDataGrid. I am not able to create the ArrayCollection in the format AdvancedDataGrid needed to display it in a tree structure. Does anybody have any sample code to share ?. I am not able to set the label field(eg : Region and children) programatically , instead of creating it directly as shown below. private var dpHierarchy:ArrayCollection = new ArrayCollection([ {Region:Southwest, children: [ {Region:Arizona, children: [ {Territory_Rep:Barbara Jennings, Actual:38865, Estimate:4}, {Territory_Rep:Dana Binn, Actual:29885, Estimate:3}]}, {Region:Central California, children: [ {Territory_Rep:Joe Smith, Actual:29134, Estimate:3}]}, {Region:Nevada, children: [ {Territory_Rep:Bethany Pittman, Actual:52888, Estimate:45000}]}, {Region:Northern California, children: [ {Territory_Rep:Lauren Ipsum, Actual:38805, Estimate:4}, {Territory_Rep:T.R. Smith, Actual:55498, Estimate:4}]}, {Region:Southern California, children: [ {Territory_Rep:Alice Treu, Actual:44985, Estimate:45000}, {Territory_Rep:Jane Grove, Actual:44913, Estimate:45000}]} ]} ]); Regards, Santosh Varghese
[flexcoders] Re: event propagation in FLex
The developer controls that by applying the listener to the correct objects. --- In flexcoders@yahoogroups.com, veena pandit v.kri...@... wrote: How do you prevent the app from confusing two events? On Thu, Jul 30, 2009 at 12:12 PM, Pedro Sena sena.pe...@... wrote: http://livedocs.adobe.com/flex/3/html/16_Event_handling_6.html On Thu, Jul 30, 2009 at 1:05 PM, veena_kris2003 v.kri...@...wrote: I have one class that generates the event. I want another class to consume the event. How do I do this? -- /** * Pedro Sena * Systems Architect * Sun Certified Java Programmer * Sun Certified Web Component Developer */
[flexcoders] Manipulate y-axis of built-in tooltip?
Hi all, Quick question...is there a way to manipulate the y-axis position of a tooltip without using a custom tooltip? For example, I have an image that has uses the builtin tooltip and I need to have it display above the image. I have a series of images, side by side, in the bottom right of my screen...when a user hovers over one of the images, because they are already grounded in the bottom right, the tooltip shows up and covers the images so the user has to really pay attention to the text to realize which image they are clicking. mx:Image id=cascadePic source={cascadeBtn} buttonMode=true click=cascadeWindows() verticalCenter=0 right=70 toolTip=Click to rearrange your widgets staggered one on another. / I'm trying to see if there is an easy way to deal with this without having to dig into custom tooltips. Appreciate the help! Adrian
[flexcoders] Re: AIR app, need MouseMove events NOT bounded by screen
Do I understand correctly that you want to track when the mouse cursor/joystick leaves the Air App window? I don't see why you shouldn't be able to reset the x y coordinates when they go off of the main application window. Not that logic always has anything to do with it. This is another one of those things that should be a given. Maybe this will help: http://nexus.zteo.com/2008/11/02/flex-how-i-worked-around-mouse_outs-inefficiencies/ --- In flexcoders@yahoogroups.com, Tracy Spratt tr...@... wrote: This AIR app is to be embedded in a consumer electronics product. It is a transparent UI that indirectly controls an underlying map application by sending messages via sockets. The product actually has a joystick and not a mouse and one requirement is that moving the joystick will cause the map to pan. In development, using a real mouse, when the mouse pointer hits a screen boundary, MouseMove events are no longer dispatched in that direction. In a corner, all events cease. This is causing me problems with continuing to send messages to the application to continue panning. I am hoping the joystick will behave differently, but am also looking for any other suggestions. I have considered using a timer to send repeated increments (the back-end app only needs position deltas), but I haven't figured out how to stop that. As far as I can tell, there is no way to set the position of the system cursor. If I could reset the mouse x,y to some positive values when it approached an edge, that would work as well. Is there anyway I can get deeper into the mouse event? If I could get a generic moving event, that would also suffice. Any thoughts? Tracy Spratt
[flexcoders] Next Question: digital pen ink?
This is something that I would expect Adobe to do, but can't find any clues. I may be looking for the wrong thing. Has anyone worked with digital scribblings using Flex? A. Resa Jones
[flexcoders] Re: Flex Browse File Video
Thanks Jeff Gilbert. I think that my only solution is to upload the video in order to preview it if I can't access the path. This is not an ideal solution! A. Resa Jones --- In flexcoders@yahoogroups.com, gilbert_mizrahi mizr...@... wrote: In AIR loading a video works fine. In Flex (FP10) I was able to load the file as a ByteArray, but I don't know how to process it to view it on a VideoDisplay or FLVPlayback component. I asked that question in another thread, but got no answers. --- In flexcoders@yahoogroups.com, Battershall, Jeff jeff.battershall@ wrote: I've done similar things with AIR and images but not with video. Seems to me you might be able to do it with FileReference.load(), which gives you access to the btyearray of the uploaded file. Requires FP10. -Original Message- From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Adrian Resa Jones Sent: Tuesday, July 07, 2009 2:19 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Flex Browse File Video Maybe I'm missing somethingCan you use the flex file browse as a source so that users can preview video before uploading it? Do I need to know where the file comes from? I saw another question about this here and did not see an answer. --- In flexcoders@yahoogroups.com, Adrian Resa Jones noregrets62@ wrote: I want to provide a preview function prior to uploading a file. Well, what's your use case ? Why do you care where the file comes from ? -- 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: Flex Browse File
I want to provide a preview function prior to uploading a file. Well, what's your use case ? Why do you care where the file comes from ?
[flexcoders] Re: ArrayCollection Does Not Show Items In Order When Passed to .NET WebService
Do you think that it would help if you converted your array collection to an array collection of typed objects before sending it to .net? --- In flexcoders@yahoogroups.com, Angelo Anolin angelo_ano...@... wrote: Hi Sam Lai, THanks for the input and my apologies for replying late since I felt the need to get deeper on the issue I am encountering. In my web service, the arraycollection is received as an array list and yes, it is like an array of xml nodes. In my arraycollection, say I have 5 columns and when one of the columns contains an empty string, when I pass it to my .NET webservice, the arraylist will have an array which only contains 4 columns (instead of the expected 5).� That is why the empty field is actually causing me some problems. I am trying to find some E4x documentation / article specifically tackling this kind of .NET and Flex integration. Do you know of some? Thanks and regards, Angelo From: Sam Lai samuel@... To: flexcoders@yahoogroups.com Sent: Saturday, 4 July, 2009 12:54:53 Subject: Re: [flexcoders] ArrayCollection Does Not Show Items In Order When Passed to .NET WebService I just wrote up a simple C# web service that accepts an ArrayList: [WebMethod] public bool ArrayListTest( System.Collectio ns.ArrayList a) { ... } Then in Flex I wrote this, mx:Script ![CDATA[ import mx.collections. ArrayCollection; private function sendWebServiceCall( ):void { trace(appComplete ); ws.ArrayListTest( new ArrayCollection( [ {name:bob, id:808 }, { name:fred, id: }])); } ]] /mx:Script mx:WebService wsdl=http://localhost: 63868/Service1. asmx?WSDL id=ws mx:operation name=ArrayListTest result=trace( event.result) fault=trace( event.fault. faultString) / /mx:WebService When sendWebServiceCall is triggered, it calls the C# web service and passes the ArrayCollection to it. In the web service, the ArrayCollection is received as an array list of XmlNodes. Each XmlNode contains a node for each field, even if it is an empty string. tns:id xmlns:tns=http://tempuri. org/808/tns:id tns:name xmlns:tns=http://tempuri. org/bob/tns:name tns:id xmlns:tns=http://tempuri. org//tns:id tns:name xmlns:tns=http://tempuri. org/fred/tns: name Is this anything like what you're getting? The edge case you described in another email about an empty string causing problems doesn't seem to cause problems. Also see inline. 2009/7/3 Angelo Anolin angelo_anolin@ yahoo.com: I think by doing things like this, it may not be the best way. You mentioned you'd map the XML to typed objects in .NET.� How can I do this? As you're using a dataset, this isn't really an option. A dataset as opposed to a collection of typed objects are two ways of handling data from data sources; it is arguable which way is better. The problem in your case, is that the XML generated as a result of passing an ArrayCollection to a web service method cannot be passed into the dataset's readXml method. (Even if it could by inferring a schema, it would be different to your database's schema.) The only way I know of to do seamless transfer of data without having to parse XML is to use WebORB. Otherwise you will have to parse the XML produced on both sides to re-create the dataset/object. Instead of using arraycollection as dataprovider in my datagrid, can I use another which would be much easier when I pass back to the .NET function? I wonder if it is possible to bind your datagrid directly to the e4x XML? That way you can pass the entire XML doc back to .NET via the web service, and hence you can re-create the dataset using dataset.readXML. _ _ __ From: Sam Lai samuel@gmail. com To: flexcod...@yahoogro ups.com Sent: Friday, 3 July, 2009 13:52:12 Subject: Re: [flexcoders] ArrayCollection Does Not Show Items In Order When Passed to .NET WebService Instead of using an array list and trying to emulate the type-less abilities of AS3, I'd try to map the XML to typed objects in .NET. Or does the XML from your Flex app differ too wildly to do this? Are you using the XmlSerializer to deserialize this? Or are you using WCF? Or are you doing it some other way, or manually? I'd provide an example, but I don't know enough details on your situation to give something useful :) 2009/7/3 Angelo Anolin angelo_anolin@ yahoo.com: Hi Sam, Care to show some examples? I am parsing the arrayCollection into an ArrayList on .NET.� This is particularly not too appealing since I just discovered that for example, if one of the objects in the arraycollection would have an empty string value, the number of items inside the array is not reflected properly in .NET. Like: private var arrR:ArrayCollectio n = new ArrayCollection( [{ID:001 , Value:Select },
[flexcoders] Re: Flex Browse File Video
Maybe I'm missing somethingCan you use the flex file browse as a source so that users can preview video before uploading it? Do I need to know where the file comes from? I saw another question about this here and did not see an answer. --- In flexcoders@yahoogroups.com, Adrian Resa Jones noregret...@... wrote: I want to provide a preview function prior to uploading a file. Well, what's your use case ? Why do you care where the file comes from ?
[flexcoders] Re: Flex Browse File
I am using something similar in one case where part of the path is a category but in other circumstances, this just wouldn't be acceptable in a software application. There are plenty of users who don't even know what cut paste means. I really need a better solution... --- In flexcoders@yahoogroups.com, grg_blls grg_b...@... wrote: Hi all, As I have a similar situation with a Flex app, I came to the following that works for me: Any Flex SWF is running withing the client's browser and for security reasons (as already mentioned) Flex is always running in sandbox, contrary to AIR. But there is no reason why in the local environment, the user/client can't switch from his browser to his system tray, copy the full path of a certain file and paste it to, say, a TextArea in the Flex app. This of course doesn't give any access to the file through the Flex app, but I was only needing the full path... Thanks, George --- In flexcoders@yahoogroups.com, reversible_82 reversible_82@ wrote: Thanks, but what I'm trying to accomplish is get the String with the folder path, for example: D:/Files/Pic, with FileReference.browse(); I select the folder, so how could I get the String of the folder path... Thanks for your support --- In flexcoders@yahoogroups.com, Tom Chiverton tom.chiverton@ wrote: On Friday 26 Jun 2009, reversible_82 wrote: No, it seem like this class do not exist in flex, should be a way to do this on flex, does anyone have an Idea? FileReference.browse(); -- Helping to ambassadorially participate clicks-and-mortar materials as part of the IT team of the year, '09 and '08 This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB. A list of members is available for inspection at the registered office together with a list of those non members who are referred to as partners. We use the word ?partner? to refer to a member of the LLP, or an employee or consultant with equivalent standing and qualifications. Regulated by the Solicitors Regulation Authority. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 2500. For more information about Halliwells LLP visit www.halliwells.com.
[flexcoders] Data Pushing
The software (flex or air) needs to allow more than one user to work on the same data at the same time in a collaborative effort and to reflect the changes made by the other users. Has anyone worked with data pushing? What products have you used for .Net or for .Php and which tools worked best for you? Would flex + ajax be the best way to go, flourinefx, WebOrb? A. Resa Jones
[flexcoders] Re: Flex Browse File
PLEASE let me know if you come up with a solution! Thank you! A. Resa Jones --- In flexcoders@yahoogroups.com, reversible_82 reversible...@... wrote: This is bad. the only way I think I can get around this is using an applet inside an html wrapper inside a cotainer object. Thanks. --- In flexcoders@yahoogroups.com, Adrian Resa Jones noregrets62@ wrote: Annoyingly enough, it appears that you can't get the path in Flex, only in Air for security reasons I guess. --- In flexcoders@yahoogroups.com, reversible_82 reversible_82@ wrote: Thanks, but what I'm trying to accomplish is get the String with the folder path, for example: D:/Files/Pic, with FileReference.browse(); I select the folder, so how could I get the String of the folder path...
Re: [flexcoders] Hi integration Flex Applicaitons with .NET Environment
Hi Satish, We have this exact configuration. Our front end (client-side) is served by our Flex apps, which interact with our database via our .net layer. There are packages out there that you can use (WebOrb is one) but we ended up simply setting up a web service on our .NET side and our flex just interacts directly with it. Adrian Satish Chowdary wrote: Hi All, could u please provide the information about how to integrate FLEX application with .NET Environment.. sending sample code appreciated Thanks inAdvance సతà±EURà°·à±? *From:* golnooshp golnoo...@yahoo.com *To:* flexcoders@yahoogroups.com *Sent:* Monday, 29 June, 2009 3:43:39 PM *Subject:* [flexcoders] How to add custom sorting to AdvancedDataGrid to worked on grouped Data? Hi, I have an advancedDataGrid that I need to add custom sorting to it which overrides the original sort! my sorting should work using a combobox to select ascending and desending from with a sort button! I know this is a bug in flex that its original sorting only works in hierarchical data and not for groupingCollection the dataProvider of my grid is a flat data. however, in the UI, the user can add grouping to the AdvancedDataGrid. so I want the sort to work on grouped data! let's say the columns are : country, province, city. population and there is grouping on country and province so the sorting should do the following: 1) if the user does a descending sort on country: only unitedStates will go up and Canada will go down. 2)if the user does a descending sort on province: the order of the grouping of province will change to Quebec, Ontario, British Columbia 3) if the user does a soring on city: although this is not a grouped column, it should do the sorting on all the cities. Thanks, Love Cricket? Check out live scores, photos, video highlights and more. Click here http://in.rd.yahoo.com/tagline_cricket_2/*http://cricket.yahoo.com.
[flexcoders] Re: Hi integration Flex Applicaitons with .NET Environment
Satish, You can create your own example by creating a Flex project with ASP.Net - Create a Flex Project, Choose Asp.Net as the application server type. Once your project is created, choose the Data menu Item and then Create Application from Database. Create a connection to your database, choose a table, etc. I've been known to use the generated code just as a starting point to save time and then to modify it drastically. I don't think that the code generated this way is great but it's a decent way to learn how the code works. The web service calls should return array collections, not tables and the generated code on the flex side re-loads the tables every time that you make a change, including sorts so requires some tweeks and it's bloody slow. I happen to be working on some demo examples for my own purposes, and have also cobbled together some code to upload files and to login. A. Resa Jones --- In flexcoders@yahoogroups.com, Satish Chowdary chinnu_...@... wrote: Hi All, could u please provide the information about how to integrate FLEX application with .NET Environment.. sending sample code appreciated Thanks inAdvance సతà±à°·à± From: golnooshp golnoo...@... To: flexcoders@yahoogroups.com Sent: Monday, 29 June, 2009 3:43:39 PM Subject: [flexcoders] How to add custom sorting to AdvancedDataGrid to worked on grouped Data? Hi, I have an advancedDataGrid that I need to add custom sorting to it which overrides the original sort! my sorting should work using a combobox to select ascending and desending from with a sort button! I know this is a bug in flex that its original sorting only works in hierarchical data and not for groupingCollection the dataProvider of my grid is a flat data. however, in the UI, the user can add grouping to the AdvancedDataGrid. so I want the sort to work on grouped data! let's say the columns are : country, province, city. population and there is grouping on country and province so the sorting should do the following: 1) if the user does a descending sort on country: only unitedStates will go up and Canada will go down. 2)if the user does a descending sort on province: the order of the grouping of province will change to Quebec, Ontario, British Columbia 3) if the user does a soring on city: although this is not a grouped column, it should do the sorting on all the cities. Thanks, Cricket on your mind? Visit the ultimate cricket website. Enter http://cricket.yahoo.com
[flexcoders] Re: Flex Browse File
Annoyingly enough, it appears that you can't get the path in Flex, only in Air for security reasons I guess. --- In flexcoders@yahoogroups.com, reversible_82 reversible...@... wrote: Thanks, but what I'm trying to accomplish is get the String with the folder path, for example: D:/Files/Pic, with FileReference.browse(); I select the folder, so how could I get the String of the folder path...
[flexcoders] Copy ToolTip to Clipboard
Hi all, I have a challenging little req't. We're using tooltips all over the place on our app. I need to be able to setup the tooltips so that we can have a copy button or text in the tooltip that our user can click to copy the contents of the tooltip to the system clipboard. This needs to be usable on everything from a large ADG with thousands of tooltips to the simple stuff. I thought I had seen a solution for this at one point in time but cannot for the life of me find it again. Help!? Thanks, adrian
[flexcoders] Re: Problems using ItemRenderers in DataGrid
A couple of possibilities: Are you using binding for the checked value? The other possibility is that after clearing values in your data array you may need to refresh() your data array in order to have the changes reflected in your datagrid. Hope that helps. --- In flexcoders@yahoogroups.com, vin.flex vin.f...@... wrote: I have created a check box item renderer for my datgrid. I will update the arraycollection by checking or unchecking the checkbox. I will submit the data to backend and I will assign the dataprovider with updated dataprovider. My data is getting updated but the some checkboxes are appearing as checked. They are not getting reinitialized. Can any body help me solve this issue.Its urgent Thanks vin thanks in advance vin
Re: [flexcoders] Drag Drop - maually show red cross or green plus icon
Hi there... You need to take a look at this: DragManager.showFeedback(DragManager.MOVE); hth adrian bhaq1972 wrote: During a dragOver event I want to manually show the green plus or red cross icon on the dragProxy image. How do I do that? thanks
Re: [flexcoders] Flex and .NET
Hi there... We have a rather large RIA using C#.Net as the backend...and we have a large number of arrayCollections and dataGrids/advancedDataGrids We don't massage any of the data that we are passing with our web services...we literally pass as as it's created...i.e. as an Array or as a Object... For example, we may have an AdvancedDataGridthat is asking for data from our web service...in our .net code we'd simply have something like: public ListMainClass BuildTheArray(string Group, string Admin) { ListMainClass configs = new ListMainClass(); SqlParameters[] sqlParams = new SqlParameters[2]; sqlParams[0] = new SqlParameter(@Group, Group); sqlParams[1] = new SqlParameter(@Admin, Admin); try { using (SqlDataReader dr = (SqlDataReader)DB.Instance().ExecuteReader(main_stored_procedure, sqlParams)) { while (dr != null dr.Read()) { configs.Add(new MainClass( Convert.ToString(dr[Name]), Convert.ToString(dr[Email]), etc... } } } return configs; } Then in our Flex webservice def, we are defining the result as Object (which I've seen a number of folks sugges E4X, but I've not delved into the pros/cons of this). mx:operation name=GetConfigs resultFormat=object result=getConfigsResult(event) / Now, since it's an object, in our web service result handler, you can cast it a number of ways, but for the list as created above on the .net side and since we are putting this data in an AdvancedDataGrid, we simply say: private function getConfigsResult(event:ResultEvent):void { configs = event.result as ArrayCollection; ourDataGrid.dataProvider = configs; } Generally speaking, out of the 100+ web service calls we have, any that return any kind of dataset we cast directly as an Array, ArrayCollection or Object. Now that said, we have seen something that is aggravating...with large datasets, we see a lag in the transport time over our web service. For example, we have a data set that returns 5000 rows of 125 columns of data...our T-SQL stored proc generates the data set in 6 seconds or less but then it still takes anywhere from 45s to 1.5m to transport that dataset to the client side...and that's over a fast connection...then, once it's in the client side, depending on how much custom rendering we are doing, it takes up to 10-15 sec's to render the data. So we have a bottleneck in our web service that causes a lengthy delay on large data setswe are still researching on why this is happening and the fix but just wanted to let you know as a heads up. -HTH -adrian Sam Lai wrote: Considering the time required for serialization/deserialization, using something like webORB would improve parsing time, as it uses a binary format which can be parsed more easily than a text format. But unless you're using large datasets/doing lots of web service calls, the advantages are probably negligible. Are you transmitting everything in the array collection back to the web service, or just the IDs of the selected rows? Transferring everything including the row data would remove the need for another database hit, but for large datasets, that could be quite a bit of traffic. I'd say it would be better just to transmit the IDs back to the webservice, and let the webservice hit the database for the row data (some caching on the server-side would help too). 2009/6/8 Angelo Anolin angelo_ano...@yahoo.com mailto:angelo_anolin%40yahoo.com: Hi Sam, Thanks for your reply. As of now, I actually prefer to utilize what I know on .NET and what I am learning on Flex. Adding another utility (Web Orb) in my learning process may complicate things a bit. I might consult this later if I feel that the needs for is getting tremendous. Anyway, I am actually able to generate the report from what I am currently doing (no error encountered), where the ArrayCollection I am parsing into a delimited string, passing the string to the webservice call, and letting the webservice de-serialize the string to populate a Crystal report document which I subsequentlt display in another browser window which I call from the Flex application. I mentioned that I did not feel it is the BEST way because I am literally storing all datagrid (report) information in a string variable. Assuming for example that the data displayed in the datagrid is quite huge, then creating the delimited string would take some time and additional processing time could also be consumbed by the back end web service to parse the string and populate the report. As of now, this is what the application does. 1
Re: [flexcoders] Re: DataGrid not releasing memory on removeAll()
Hi there, We had a similar problem albeit with the AdvancedDataGrid...it wouldn't release the custom renderers even after we told it to...in the end, we had to write a custom script that would track our renderers and when we wanted to GC things, we had to call the script to release the renderers. Additionally, a removeAll didn't seem to do the trick for us either...we had to set the dataProvider to null. HTH -adrian Dharmendra Chauhan wrote: * Hi All, Thanks for the response. 1) I agree with the fact - that memory is not necessarily released just after you remove the items from datagrid. Now my question is how long I have to wait for GC to run and If they are eligible for GC then memory should be coming down after I issue Sytem.gc(). Why Memory usage is not coming down even after Force GC ??? 1) I do not have any event listerner attached to dataGrid or ArrayCollection, In fact, In my sample App , I just crated a data Grid with data provider and thats it. I suspect , dataGrid does not release its itemerenderer even after removing all item After digging the DG code I found following . Why FreeItemRenderersTable is Strongly Referenced ?? public function DataGridBase() { super(); listType = vertical; defaultRowCount = 7;// default number of rows is 7 columnMap = {}; freeItemRenderersTable = new Dictionary(false); } Is this the only reason for itemrenderes not being eligible for GC ?? Please throw some light on it Regards, Dharmendra * --- In flexcoders@yahoogroups.com, Pedro Sena sena.pe...@... wrote: The memory is not necessarily released just after you remove the items from datagrid. Removing them, you make them eligible by the garbage collector, but this does not necessarily means that it will be collected. HTH, PS On Sat, Jun 6, 2009 at 3:02 PM, Dharmendra Chauhan chauhan_i...@...wrote: Hi All, My DataGrid based application running into a Memory issue.The issue is dataGrid does not release the memory even after emptying it. Initially I thought Its my code which is causing the issue, but later I crated a sample application with just a dataGrid and a ArraCollection (no eventListener) and found the same issue. Memory should come down at least some MB when I remove all item from data provider. Memory usage with 10k row - 220 MB Memory usage after removing all item - STILL 220 MB Is this the standard behavior of datGird or do i need to apply some workaround to get rid of this ? Regards, Dharmendra -- /** * Pedro Sena * Systems Architect * Sun Certified Java Programmer * Sun Certified Web Component Developer */
Re: [flexcoders] Problem loading signed RSL
Hi Denis, If you've compiled using the RSL instead of merged code, you will need to locate the framework file (in your case: framework_3.2.03958.swf) on the computer used to compile and push that file to your web server along with your application swf's...when you use the RSL's and make any changes after the fact, that framework file adds digest entries that have to be available to your app on the server. We had this problem quite a bit and it took awhile to figure out that this was the issue. Now, whenever we push our code to our server, we make sure to push the framework file as well and we haven't had the problem since. HTH, -adrian Denis wrote: Hi all, I am trying to publish an app with the signed framework RSL. The application works fine when accessed online from my machine (developer). However, when I try to access it from any other machine, I get this error: RSL framework_3.2.03958.swf failed to load. Error #2032. For some reason, the Flash player does not want to load the framework.swf or framework.swz. I have checked that all machines have the Flash player of a version higher than what I am running. This app is running under SSL. Would that matter? Thanks, Denis
Re: [flexcoders] Links in Flex Data Grid Collumns
You need to take a look at setting up a custom item renderer for the dg column. As for an example, try searching flex datagrid itemRenderer to get a good start. in a nutshell, you create your itemRenderer as a separate component then reference that component in your DG column...such as: mx:DataGridColumn itemRenderer=rendererdirectory.URLRenderer/ we generally use this for hyperlinking email addys and it works great. Our actual renderer is based on a Label and we override the set data function, passing our dataItem into htmlText with the url info and then we return the renderer. We have a click listener on the Label declaration that (in the end) fires a navigateToURL() function. Good luck! Adrian guess what wrote: I have a Flex Data Grid Populated from XML . In of the collumns I want to have the collumn as a href with some parameters . Is it possible . It would be helpful if someone has an actual example . --- On *Fri, 5/29/09, mark.jonk...@comcast.net /mark.jonk...@comcast.net/* wrote: From: mark.jonk...@comcast.net mark.jonk...@comcast.net Subject: Re: [flexcoders] Re: Need Alternative for enterFrame event (Causing Memory leak ) To: flexcoders@yahoogroups.com Date: Friday, May 29, 2009, 2:23 PM Hi Dharmendra While you don't have access to JavaScript, would the old school methods still work such as setting a Flash variable on the active x control. Back in older versions of Flash the only way to communicate between the browser and the ActiveX was to use things like setVariable then inside Flash you would have a watch expression that watched for changes to that variable, and reacted. The variable value could only be a string (I think). Back then we would change the value of the variable from outside, have Flash react to the change, reset the value of the variable to its non-set state. Assuming this would still work, when the .NET application regained focus you would tell the ActiveX instance to setVariable( focusReceived , true); and in Flash it would see that, reset the listeners. One word of warning, if your resetting your listeners constantly, are you doing anything to remove the old listeners first - if not that may well be the source of your memory leak. I used the setVariable method in VB with the old Flash active x controls a number of years ago and it worked flawlessly, you just have to set it up right to begin with and it was obviously messier then the ExternalInterface method. Sincerely Mark R. Jonkman - Original Message - From: Dharmendra Chauhan chauhan_icse@ yahoo.com To: flexcod...@yahoogro ups.com Sent: Friday, May 29, 2009 3:00:46 PM GMT -05:00 US/Canada Eastern Subject: [flexcoders] Re: Need Alternative for enterFrame event (Causing Memory leak ) Hi Manish, Thanks for the suggestion. I wish , I could use java script to set the Focus but I do not have luxury of Java Script as My application is running as ActiveX control inside dot net based application. Once the callback broken , communication from Ashokwave lib to swf is not possible. This is really a serious issue, I need some work around to fix it as I could not wait till the adobe fix it. Regards, Dharmendra --- In flexcod...@yahoogro ups.com, Manish Jethani manish.jethani@ ... wrote: On Fri, May 29, 2009 at 12:40 AM, Dharmendra Chauhan chauhan_icse@ ... wrote: The issue is with callBack ,what is happening is as soon you hide Flex application by opening another application( any app) and then again you come back to your flex app , call back does not work , they are broken.I found following related jira for this. http://bugs. adobe.com/ jira/browse/ FP-143 To solve this issue , I am re-registering all callBacks on ENTER_FRAME event and issue appears to be solved but this is leading to memory leak. Neither Activate nor FocusEvent.FOCUS_ IN does serve my purpose , both required a mouse Clk before they dispached. I thought you'd get 'activate' when the player got focus. You could try setting the focus back to Flash through JavaScript (I don't remember how to do this now). You should be getting a focus event on the HTML/JS side at least. Manish - - -- -- Flexcoders Mailing List FAQ: http://groups. yahoo.com/ group/flexcoders /files/flexcoder sFAQ.txt Alternative FAQ location: https://share. acrobat.com/ adc/document. do?docid= 942dbdc8- e469-446f- b4cf-1e62079f684 7 Search Archives: http://www.mail- archive.com/ flexcoders% 40yahoogroups. comYahoo! Groups Links
Re: [flexcoders] Tree Structure in advanced data grid
take a look at adg.expandAll this will expand all the available nodes in your grouping collection. -adrian senthilkumarirtt wrote: hi all,I need to expand the tree structure (in advanced datagrid)automatically when application loaded Give some ideas to implement this... Thanks in advance, S.Senthilkumar
Re: [flexcoders] Display ADG Data Asynch (was: Advanced Datagrid performance)
Hi Valdhor, When you say set it to display async what do you mean? Adrian valdhor wrote: Thousands. It slows down a lot when you have grouping collections but I set it to display asynchronously so the user sees it updating. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com, Scott h...@... wrote: I'm using the advanced datagrid component to display data from my Coldfusion server. Realistically, how many records can I load into this component and still have it function? Thanks Scott
Re: [flexcoders] loading status for DataGrid
Hi, We just have a simple Loading Data clip the we setup in a swfLoader and we toggle the visibility on when we make our web service call to get our data, then after it's been returned, we toggle the visibility off. -adrian Dharmendra Chauhan wrote: Hi All, I have flex DataGrid which asynchronously receive data throw LCDS deployed on Jboss.Initially It loads around 2k to 3k rows I need to show loading status which would just keep showing Data Loading until data load is complete. DataService class does not have any event which would serve this purpose Does anybody have any idea on it ?
[flexcoders] Flex Bug Fix Changelists Correlate to What?
Hi all, I've been keeping an eye on a couple bugs that we've opened with Adobe and see they have been fixed, but can't figure out what that translates to in terms of when we can get our hands on the fix and from where. For example we see: Fixed in changelist 227803 I can't seem to find information out there that will give us the answers to where this fix lives. Anyone know? Best, Adrian
Re: [flexcoders] Weblink to item in linkbar
Hi Paul, Read up on the navigateToURL() function. Syntax is along the lines of: url = http://www.google.com/;; navigateToURL(new URLRequest(url), _self); HTH, Adrian ptretter wrote: I have an item on my linkbar that says forum. I want to be able to click on this and immediately follow a hyperlink to my forum which is a phpbb forum. Can someone tell me how this is possible as I'm having difficulty finding help on this. I found something about getURL but understand that is no longer in actionscript 3.0. Paul
Re: [flexcoders] Re: Weblink to item in linkbar
Hi Paul, What is the component you are using that the user will click on to hit the link? I would imagine you can attach a simple onClick event to it that calls a short function for the navigateToURL... Adrian Paul Tretter wrote: Thanks Adrian, I actually couldn't get navigateToUrl to work with the item on the linkbar also and I think it is because when the linkbar is attached to the viewstack it is a canvas and it seems canvas control doesn't work with navigateToUrl. At least it didn't for me. Paul
Re: [flexcoders] Re: RegEx string via cell ItemRenderer to colorize specific characters or a better method?
Hi Tim, This is perfect! It very nicely replaces ALL the instances of the find value. Thanks!! Adrian Tim Hoff wrote: Hi Adrian, I came across this function recently, that may suit you needs: *public* *static* *function* StringReplaceAll( source:String, find:String, replacement:String ) : String { * return* source.split( find ).join( replacement ); } -TH --- In flexcoders@yahoogroups.com, Adrian Williams adri...@... wrote: Hi Tracy, This is an interesting idea...but you have me at a bit of a lossI was already heading down part of the same path you laid out here...here is my renderer code thus far: First, the column from my ADG: mx:AdvancedDataGridColumn id=groupedHVR1 dataField=Hvr1M headerText=HVR1 Mutations headerWordWrap=true textAlign=left wordWrap=true editable=false width=100 showDataTips=true itemRenderer=renderers.GeneralRenderers.AminoAcidRenderer / now the AminoAcidRenderer.mxml: ?xml version=1.0 encoding=utf-8? mx:Label xmlns:mx=http://www.adobe.com/2006/mxml; implements=mx.core.IFactory truncateToFit=true width=100% height=100% paddingLeft=2 paddingRight=2 mx:Script ![CDATA[ import mx.utils.ObjectProxy; override public function set text(value:String):void { if (value != null value !=value != ) { value = String(value.replace(G,'font color=blackG/font')); value = String(value.replace(A,'font color=greenA/font')); value = String(value.replace(T,'font color=redT/font')); value = String(value.replace(C,'font color=blueC/font')); super.htmlText = value; } else { super.htmlText = value; } } public function newInstance():* { return new AminoAcidRenderer(); } ]] /mx:Script /mx:Label But, alas, there are a couple of problems here. First, the string.replace() only affects the first occurrence of the pattern and not every occurrence (I wonder if a regex would remedy that?). Then although the substitution gets done for those patterns that are found, the htmlText isn't getting rendered...and I wonder if it's due to the function set text instead of function set htmlText, which I tried and literally got nothing. I've also looked at the TextRange that someone else suggested but not sure how to possibly use that as it needs a begin/end index and the letters are sporadic from one string to the next. How would I setup the labelFunction to parse the string to get the letters? Thanks in advance! Adrian Tracy Spratt wrote: I suggest that you use a labelFunction feeding a renderer that uses htmlText. The label function would simply parse the strings to get the letters, and wrap them in a Font tag specifying the color. This would be very easy. Tracy Spratt, Lariat Services, development services available *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On Behalf Of *valdhor *Sent:* Wednesday, April 22, 2009 4:44 PM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] Re: RegEx string via cell ItemRenderer to colorize specific characters or a better method? Have a look into TextRange. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com, Adrian Williams adrianw@ wrote: Hi All, Here's a fun one! I have a column in an ADG, and the cells can contain a variety of data including: 16223T,16290T,16319A,16362C,16524G or 73G,249-,263G,290-,291-,309.1C,315.1C,489C,493G,522-,523- What I need to do is for each of the letters (there's four possible - A,T,C,G) I need to be able to change the font color specific to each letter...i.e. all the A's need to be green, the C's need to be blue, the G's need to be black and the T's need to be red. As I've been thinking about it, I figure I'm going to have to use a custom itemRenderer for the cell to manipulate the data to begin with. But within the renderer, I'm quasi-stuck. I figure the simplest way to ID the letters is to RegExp the data...then possibly using a switch/case to set the colors for the letters...but not sure how to affect just the individual letters in the overall string and then return that with the cell's renderer?? Anyone have any thoughts on this? Thanks! Adrian
[flexcoders] RSL Linkage Error 1001 - Digest Mismatch? Umm....WHAT?
Hey Y'all, Ok, so I'm stumped... I update my FB SDK to 3.3 and now, when I run the compiled swf's, I get this error: Flex Error #1001: Digest mismatch with RSL http://localhost/GAP-Pages/framework_3.0.0.477.swf. Redeploy the matching RSL or relink your application with the matching library. So, I understand (to a point) what the problem is...but I'm not sure how to fix it. I can work around it by changing the Project - Properties - Flex Build Path - Library Path - Framework Linkage from Runtime shared library (RSL) to Merged into code. But by doing this, then my .swf sizes get fugly and so it's not a viable solution for the long term. Can anyone explain to me exactly what I need to re-link to fix this problem? Best, Adrian
Re: [flexcoders] SOLVED (sort of) - RSL Linkage Error 1001 - Digest Mismatch? Umm....WHAT?
Ok, so I tried a couple more things and found what appears to have cleaned up the problem. I ended up doing a project - clean which went thru and rebuilt the entire project and...wellcleaned up the references (??). This appears to have fixed the digest mismatch and compiling with the RSL's works again! WOOT! -aw Adrian Williams wrote: Hey Y'all, Ok, so I'm stumped... I update my FB SDK to 3.3 and now, when I run the compiled swf's, I get this error: Flex Error #1001: Digest mismatch with RSL http://localhost/GAP-Pages/framework_3.0.0.477.swf. Redeploy the matching RSL or relink your application with the matching library. So, I understand (to a point) what the problem is...but I'm not sure how to fix it. I can work around it by changing the Project - Properties - Flex Build Path - Library Path - Framework Linkage from Runtime shared library (RSL) to Merged into code. But by doing this, then my .swf sizes get fugly and so it's not a viable solution for the long term. Can anyone explain to me exactly what I need to re-link to fix this problem? Best, Adrian
[flexcoders] RegEx string via cell ItemRenderer to colorize specific characters or a better method?
Hi All, Here's a fun one! I have a column in an ADG, and the cells can contain a variety of data including: 16223T,16290T,16319A,16362C,16524G or 73G,249-,263G,290-,291-,309.1C,315.1C,489C,493G,522-,523- What I need to do is for each of the letters (there's four possible - A,T,C,G) I need to be able to change the font color specific to each letter...i.e. all the A's need to be green, the C's need to be blue, the G's need to be black and the T's need to be red. As I've been thinking about it, I figure I'm going to have to use a custom itemRenderer for the cell to manipulate the data to begin with. But within the renderer, I'm quasi-stuck. I figure the simplest way to ID the letters is to RegExp the data...then possibly using a switch/case to set the colors for the letters...but not sure how to affect just the individual letters in the overall string and then return that with the cell's renderer?? Anyone have any thoughts on this? Thanks! Adrian
Re: [flexcoders] Re: RegEx string via cell ItemRenderer to colorize specific characters or a better method?
Hi Tracy, This is an interesting idea...but you have me at a bit of a lossI was already heading down part of the same path you laid out here...here is my renderer code thus far: First, the column from my ADG: mx:AdvancedDataGridColumn id=groupedHVR1 dataField=Hvr1M headerText=HVR1 Mutations headerWordWrap=true textAlign=left wordWrap=true editable=false width=100 showDataTips=true itemRenderer=renderers.GeneralRenderers.AminoAcidRenderer / now the AminoAcidRenderer.mxml: ?xml version=1.0 encoding=utf-8? mx:Label xmlns:mx=http://www.adobe.com/2006/mxml; implements=mx.core.IFactory truncateToFit=true width=100% height=100% paddingLeft=2 paddingRight=2 mx:Script ![CDATA[ import mx.utils.ObjectProxy; override public function set text(value:String):void { if (value != null value !=value != ) { value = String(value.replace(G,'font color=blackG/font')); value = String(value.replace(A,'font color=greenA/font')); value = String(value.replace(T,'font color=redT/font')); value = String(value.replace(C,'font color=blueC/font')); super.htmlText = value; } else { super.htmlText = value; } } public function newInstance():* { return new AminoAcidRenderer(); } ]] /mx:Script /mx:Label But, alas, there are a couple of problems here. First, the string.replace() only affects the first occurrence of the pattern and not every occurrence (I wonder if a regex would remedy that?). Then although the substitution gets done for those patterns that are found, the htmlText isn't getting rendered...and I wonder if it's due to the function set text instead of function set htmlText, which I tried and literally got nothing. I've also looked at the TextRange that someone else suggested but not sure how to possibly use that as it needs a begin/end index and the letters are sporadic from one string to the next. How would I setup the labelFunction to parse the string to get the letters? Thanks in advance! Adrian Tracy Spratt wrote: I suggest that you use a labelFunction feeding a renderer that uses htmlText. The label function would simply parse the strings to get the letters, and wrap them in a Font tag specifying the color. This would be very easy. Tracy Spratt, Lariat Services, development services available *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On Behalf Of *valdhor *Sent:* Wednesday, April 22, 2009 4:44 PM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] Re: RegEx string via cell ItemRenderer to colorize specific characters or a better method? Have a look into TextRange. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com, Adrian Williams adri...@... wrote: Hi All, Here's a fun one! I have a column in an ADG, and the cells can contain a variety of data including: 16223T,16290T,16319A,16362C,16524G or 73G,249-,263G,290-,291-,309.1C,315.1C,489C,493G,522-,523- What I need to do is for each of the letters (there's four possible - A,T,C,G) I need to be able to change the font color specific to each letter...i.e. all the A's need to be green, the C's need to be blue, the G's need to be black and the T's need to be red. As I've been thinking about it, I figure I'm going to have to use a custom itemRenderer for the cell to manipulate the data to begin with. But within the renderer, I'm quasi-stuck. I figure the simplest way to ID the letters is to RegExp the data...then possibly using a switch/case to set the colors for the letters...but not sure how to affect just the individual letters in the overall string and then return that with the cell's renderer?? Anyone have any thoughts on this? Thanks! Adrian
[flexcoders] Re: Datagrid question
There are a few ways to do this but the easiest is to add a value to your object that will be updated in the item renderer, perhaps in the set data function. You could also use an event and a public property in your item renderer. var myObject = new myClass(); override public function set data(value:Object):void { //value is the object from your list myObject = value as MyClass; } private function buttonClick() { myObject.randomNumber = MyRandomNumberGen(); } You should now be able to access randomNumber in your application. This will require you to parse your ArrayCollection into an object. --- In flexcoders@yahoogroups.com, Pilby i...@... wrote: Thanks for responding, Tracy. Let's say this is an application that allows generation of license numbers. Imagine this: You have 3 columns in the datagrid. The first and second columns are the first and last names of a person. The third column is a button (which is really part of an MXML component) that has it's 'label' set as Click to generate license number. When the user clicks the button, the logic to generate the license number is within the component and will be output to the label property of the button, and the button will no longer be clickable. The application allows multiple people to be listed in the datagrid. Outside the datagrid, there is a button that says Click to print all. Given the specs I described so far, it's clear that I have to be able to iterate through each row in the datagrid, extracting the data from each column of each row. Typically, I would just get the dataProvider array collection object, and the problem would be solved. But because the license number is being output through the label property of the button (which is part of a MXML component) and is not part of the original dataProvider data, I can't go that route. I figured I now have to somehow iterate through each row, grabbing the data of each column of the row and storing it somehow. Is there a way for me to get the license number from the label property of the buttons?
[flexcoders] Socket Timeout on Profiler....help?
Hi all, I've used the FB Profiler with success much in the past, though admittedly, I've had to shut off my windows firewall to avoid socket problems. However, I am having trouble getting it to run again. I had to update my flash player and SDK version to take advantage of a couple classes that are only available in these newer versions and ever since, I cannot get the profiler to run. Does anyone know of any particulars about the config that is needed to run it? I am on: FB Pro - 3.0.194161 SDK - 3.3 Flash Player (Firefox) - 10.0.r12 Thanks, Adrian
Re: [flexcoders] error whenr .swf file tries to access variable like this Application.application.variableName
Hi Jigar, Have you made sure that the variable you are trying to access is set to public? Also, which app level does the variable exist in...the main app or the first-loaded swf? And if you are getting an error, can you post the stack here please? Adrian Jigar Kapadia wrote: I am loading a .swf file which is buit in FLEX 3 into an AIR project. and that .swf file again loads another .swf file I get error whenever .swf file tries to access variable like this Application.application.variableName How can it be fixed.? ~ Jigar
Re: [flexcoders] Ellipsis in Advanced datagrid(in flex)
Hey there, You'll want to use the truncateToFit property of the item renderer ClassFactory. var rendererFactory:ClassFactory; rendererFactory = new ClassFactory(Label); rendererFactory.properties = { truncateToFit: true, styleName: cellText }; column.itemRenderer = rendererFactory; Adrian senthilkumarirtt wrote: hi i want to implement the ellipsis concept in Advanced datagrid in flex to avoid truncation of lengthy name of data.
Re: [flexcoders] truncateToFit in flex
Hi, I posted the answer in your last email about this...using ellipses in the ADG Adrian senthilkumarirtt wrote: hi,i want to know about use of truncateToFit in advanced datagrid.
Re: [flexcoders] Panel access
Hi Christophe, Try accessing the panel.enabled property. If the user is not logged in, set panel.enabled = false and they won't be able to interact with it. Adrian christophe_jacquelin wrote: Hello, I have a tab navigator with Panels. I want that the user access some panel only if he is logged. How to unvalidate the access to a Panel ? Thank you, Christophe,
Re: [flexcoders] ADG Memory leak.
Hi All, Here is the Adobe bug that this issue is attached to, including the test case I mentioned (though it returns super() vs. .this) ...as of this morning, they have the bug marked as fixed/resolved in changelist 227803. http://bugs.adobe.com/jira/browse/FLEXDMV-1968 Best, Adrian Tom Chiverton wrote: On Monday 23 Mar 2009, Adrian Williams wrote: a sieve. And as an experiment, we setup a custom renderer that simply returned .this and it leaked like crazy. We have a fairly large ADG (100+ columns) and every time we'd scroll right to see more columns, Could you attach this as a test case to an issue in the DMV project on bugs.adobe.com ? -- Tom Chiverton Helping to continuously mesh compelling e-tailers as part of the IT team of the year, '09 and '08 This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB. A list of members is available for inspection at the registered office together with a list of those non members who are referred to as partners. We use the word ?partner? to refer to a member of the LLP, or an employee or consultant with equivalent standing and qualifications. Regulated by the Solicitors Regulation Authority. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 2500. For more information about Halliwells LLP visit www.halliwells.com http://www.halliwells.com/.
Re: [flexcoders] Rowcount in Advanceddatagrid
Hi Venkat, Would taking the adg.dataProvider.length work for you? Adrian venkat eswar wrote: How to get the actual row count of an advanceddatagrid with Open nodes and closed nodes
Re: [flexcoders] Add/remove columns dynamically to AdvancedDataGridColumnGroup
Joao, We faced a similar challenge (we have a report that the user can customize and persist which columns to display) and instead of actually removing the columns, we found it much simpler to manage the visibility instead...affecting the column.visible property. So when their report is loaded, we read their report/column setting from the db, then build the report and cycle thru the columns, determining which ones are visible and turn off the ones that aren't. Adrian Joao Coelho wrote: Anyone knows if it is possible to add and remove columns to an AdvancedDataGridColumnGroup at runtime? So far I had no luck doing so. What I have tried: - pushing new columns into the children property; - setting children property to a newly created and populated array; - getting the children property into a new array, altering the array and setting de children property to this array. None of this worked. I'm avoiding creating the AdvancedDataGridColumnGroup dynamically also due to the columns having to be created based on a result from a service call and the grid having other columns before and after this group. Thanks, Joao
[flexcoders] ADG to .csv - Not finding any solutions out there
Hi All, I've been searching for a few hours and I'm coming up short...I'm not finding much info out there on ways to export the data contained in an ADG to a .csv format (for later import into Excel). I've seen several solutions for doing this with a standard DataGrid, but nothing for the Advanced, including searching thru the flexcoders archive. I've seen mention of doing this server side (though nothing in solutions for C#.NET) but we'd MUCH prefer to do this client-side. I'm wondering if anyone out there knows of a solution for this before I go thru the trouble of trying to manipulate the DG export classes out there to use an ADG? Best, Adrian
Re: [flexcoders] ADG Memory leak.
Hi Wesley, We work with ADG's extensively including some intense custom renderers and have had horrible problems with memory leaks. Turns out, there are known problems with the ADG's internal renderers leaking like a sieve. And as an experiment, we setup a custom renderer that simply returned .this and it leaked like crazy. We have a fairly large ADG (100+ columns) and every time we'd scroll right to see more columns, more renderers would be created in addition to the one's already present...and scrolling back left would recreate them again instead of using the one's that had already been created...at one point, we had several hundred instances of renderers running for a single grid. Insanity! And, because the ADG and the DG are maintained by two separate teams at Adobe, one is not related to the other and in this case, the DG does not have the same leaks as the ADG. In the end, we had to write a serious piece of code to manage our renderers, which finally rid us of the leaks we were encountering. I've been working on trying to encapsulate our logic so I can post it here as I know a lot of other folks have run into the same problems and could probably use the help. Best, Adrian Wesley Acheson wrote: I've wasted most of the day trying to figure out why my application was leaking memory. I was dynamically adding and removing columns from the AdvancedDataGrid. I noticed that it was slowing down a lot. I naturally assumed that it was my custom item renderer and even after reading Alex's blog entry about using the profiler I couldn't figure out what was holding references to my item renderer. Anyway the error continued to happen after I commented out all the code in my item renderer. I even changed it to subclass AdvancedDataGridItemRenderer, still no joy. So I removed the custom item renderer and noticed that instead of my ItemRenderer the ADG didn't remove references to its own item renderer. Anyway I changed to a standard DataGrid and all worked correctly. The references were removed when garbage collection occurred I had to change my code a bit. This isn't really a question more of a complaint really. I don't know if it was my code or just a problem with the ADG though I suspect the latter. A couple of things I noticed with the standard DG. Firstly if setting the itemrenderer on the DG itself it also uses the same ItemRenderer on the header rows. Is this correct behaviour. Setting the ItemRenderer on the column seems to keep the normal header renderer. This I admit has me confused is this the way its supposed to work? How would I set all the cells to a custom IR and leave the headers alone? It seems inconsistent. I have read the excellent Articles on Alex's blog. Anyway that's all. Regards, Wes
Re: [flexcoders] calling a function from swf
This is pretty straightforward. We do a lot of this in our dashboard app where we have a function called registerSWF(). This helps us keep tabs on all the swf objects that are loaded on the dash. private var registeredSWF:ArrayCollection = new ArrayCollection(); public function registerSWF(swf:Object):void { registeredSWF.addItem(swf); } Each child swf calls this functions when they load: application.registerSWF(this); Then, when we need to access a function from within the child swf, we pull it from the AC (so we can reference it) and directly call the function: for each (var swf:Object in registeredSWF) { swf.someFunction(vars); } Keep in mind that the function in your child swf must be in the public scope or the parent app cannot see it. HTH, Adrian thibodeau.alain wrote: Hi all, I am thinking this is simple, but I cannot find the proper way of doing this. I have a flex application that loads a swf file. I want to be able to call a function that is in the flex application from the swf file. From my fla I tried calling _root, Application.application, _parent... Anyone know how I can do this ? thanks!
Re: [flexcoders] hiding an applicationcontrolbar button
Hi Greg, does this not work for you? if (MyModel.getInstance().currentUser.useraccess == 99) { aHeadlines.visible = true; } else { aHeadlines.visible = false; } Greg Morphis wrote: I'm trying to hide or destroy a button that's showing in an ApplicationControlBar. Basically when the user logs into the tool their information is checked and one button or another will show. The code currently looks like mx:VBox... mx:ApplicationControlBar ... mx:ToggleButtonBar id=adminMenu dataProvider={adminVS} /mx:ApplicationControlBar mx:ViewStack ... id=adminVS ... AdminVW:AdminUser id=aUser ... / AdminVW:AdminSecurity id=securityBox ... / AdminVW:AdminMenu id=aMenu ... / AdminVW:AdminNews id=aNews ... / AdminVW:AdminTopAgentsid=aUser ... / AdminVW:AdminHeadlines id=aHeadlines ... / ... What if I only wanted to show the AdminHeadlines button if when they log in thier access is 99. The access is stored in MyModel.getInstance().currentUser.useraccess I've tried using a function and setting the visiable and includeInLayout to the return value, I.E.: private function showHeadlines ():Boolean { return (MyModel.getInstance().currentUser.useraccess == 99) } But that's not working.. Ideas? Thanks!
Re: [flexcoders] Recommended MVC for Flex/AS?
Hi Alex, Thanks so much for the link! That was exactly the kind of information I was looking for. Thanks, Adrian Alex Ninan wrote: Take a look at the attached link http://www.summa-tech.com/blog/2009/01/14/selecting-the-right-flex-application-framework/ http://www.summa-tech.com/blog/2009/01/14/selecting-the-right-flex-application-framework/ On Tue, Mar 3, 2009 at 11:38 AM, Adrian Williams adri...@familytreedna.com mailto:adri...@familytreedna.com wrote: Hi All, I'm curious as to what our overall community would recommend, why and the pros/cons of the various MVC's that are out there for Flex/AS. Thanks, Adrian
Re: [flexcoders] Detecting other type of mouse event
Will listening for MOUSE_DOWN then MOUSE_MOVE then MOUSE_UP help? carlo giordano wrote: Is possible in the Flex Framework detecting the continuous press of mouse click like when we drag and drop a UIComponent ? And then detecting when the mouse is released ? I have not found anything in the network, anyone has ideas about ? Very Thanks.
[flexcoders] Recommended MVC for Flex/AS?
Hi All, I'm curious as to what our overall community would recommend, why and the pros/cons of the various MVC's that are out there for Flex/AS. Thanks, Adrian
Re: [flexcoders] Passing parameter to swf
Hi Chandru, This is actually pretty easy...one the swfLoader.source, simply add the traditional ? and tabs to the source with the values you want to pass...then in your called swf, you access the passed values via the document.parameters.valueName i.e. Main App: var swf:SWFLoader = new SWFLoader(); swf.source = swfFile.swf?label=Login; swfFile.swf: button.label = document.parameters.label; HTH, Adrian chandruflex wrote: Hi, I have a requirement where I have to send a String value as a parameter to a swf (created from Flash). If this is possible, can anybody let me know how this can be done? Example Usage: I want an animated button like thing in Flex. I would be given an swf file created in Flash, which looks like an animated button, but with no Label on it. I will load this animated swf into my Flex application using SWFLoader component. Say, I want to pass in a String value - Login to this swf, so that, I can use it as an animated button with the label - Login. -Chandru
Re: [flexcoders] SWF in a Panel
Hi Christophe, var swf:swfLoader = new swfLoader(); swf.source = //location of your swf file panel.addChild(swf); HTH, Adrain christophe_jacquelin wrote: Hello, How to draw an existing SWF file into a Panel ? Thank you, Christophe,
Re: [flexcoders] Dynamic Advanced Datagrid
Venkat, More details about what you want to do would help elicit a better response. Adrian venkat eswar wrote: How to do Dynamic tree inside advanced datagrid
Re: [flexcoders] Converting strings to numbers before sorting?
Hi Keith, Have you tried casting your string to a number via the number() function first? Number() handles floating points well. We have the same problem sorting kit numbers in true numerical fashion as we can have some that begin with a letter versus a true number. So in our sort compare we do this: public static function compareKitNumbers(obj1:Object, obj2:Object):int { var value1:Number = (obj1.KitNum == '' || obj1.KitNum == null) ? null : new Number(obj1.KitNum); var value2:Number = (obj2.KitNum == '' || obj2.KitNum == null) ? null : new Number(obj2.KitNum); var kitnum1:String = obj1.KitNum as String; var kitnum2:String = obj2.KitNum as String; var kit1Length:int = kitnum1.length - 1; var kit2Length:int = kitnum2.length - 1; if (isNaN(value1) isNaN(value2)) { if (kitnum1.substr(0,1) kitnum2.substr(0,1)) { return -1; } else if (kitnum1.substr(0,1) kitnum2.substr(0,1)) { return 1; } else { value1 = new Number(kitnum1.substr(1,kit1Length)); value2 = new Number(kitnum2.substr(1,kit2Length)); } } if (value1 value2 || (isNaN(value2) !isNaN(value1))) { return -1; } else if (value1 value2 || (isNaN(value1) !isNaN(value2))) { return 1; } else { return 0; } } HTH, Adrian Keith Hughitt wrote: Hi all, I have a problem related to sorting type-casted numeric data, and was wondering if someone could help me out: Given some numeric data stored as strings (11.5), how can I populate it into a DataGrid and have it sort properly? From the Flex API docs http://livedocs.adobe.com/flex/3/langref/mx/controls/dataGridClasses/DataGridColumn.html#sortCompareFunction it appears that when you use a labelFunction instead of a dataField to specify what should be displayed in a column, that the output of the label function is what is then used for sorting: If you specify a value of the |labelFunction| property, you must also provide a function to the |sortCompareFunction| property, unless sorting is not allowed on this column. So my first attempt was to simply cast the strings to numbers within the label function and hope that the default sorters would still be available: private function testLabel2(item:Object, col:DataGridColumn):Number { return parseFloat(item.string); } ... I also tried using Number(item.string), however, neither worked so I went to manually specifying the sort compare function: public function sortAsIs(obj1:Object, obj2:Object):int { if (obj1 obj2) return -1; else if (obj1 == obj2) return 0; else return 1; } This didn't do the trick either. So finally, I decided to try doing the conversion in the sortCompareFunction, just in case it was comparing the original data fields and not the output of the label function. Again no luck. Anyone have any suggestions? Any help would be greatly appreciated. Here is the full code for the test case I am describing: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; mx:Script ![CDATA[ import mx.collections.ArrayCollection; [Bindable] public var test:ArrayCollection = new ArrayCollection([ {string: 11.0, number: 11.0}, {string: 0, number: 0}, {string: 7.75, number: 7.75}, {string: 8, number: 8}, {string: 3, number: 3}, {string: 8.93, number: 8.93} ]); private function testLabel1(item:Object, col:DataGridColumn):Number { return Number(item.string); } private function testLabel2(item:Object, col:DataGridColumn):Number { return parseFloat(item.string); } public function sortAsIs(obj1:Object, obj2:Object):int { if (obj1 obj2) return -1; else if (obj1 == obj2) return 0; else return 1; } public function sortAfterCasting(obj1:Object, obj2:Object):int { var a:Number = Number(obj1); var b:Number = Number(obj2); if (a b) return -1; else if (a == b) return 0; else return 1; } ]] /mx:Script mx:DataGrid id=testDG dataProvider={test} mx:columns mx:DataGridColumn dataField=string / mx:DataGridColumn dataField=number
Re: [flexcoders] add tooltip in Line chart
Check out the dataTipFunction abilities. Adrian abhishekchess1 wrote: hello frnd, plz check theis code ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml layout=vertical verticalAlign=top horizontalAlign=center backgroundGradientColors=0x00,0x323232] paddingTop=0 viewSourceURL=srcview/index.html mx:Script ![CDATA[ import mx.collections.ArrayCollection; [Bindable] private var expensesAC:ArrayCollection = new ArrayCollection ( [ { Month: Jan, Profit: 2000, Expenses: 1500, Amount: 450 }, { Month: Feb, Profit: 1000, Expenses: 200, Amount: 600 }, { Month: Mar, Profit: 1500, Expenses: 500, Amount: 300 }, { Month: Apr, Profit: 1800, Expenses: 1200, Amount: 900 }, { Month: May, Profit: 2400, Expenses: 575, Amount: 500 } ]); ]] /mx:Script mx:Panel title=LineChart Control layout=horizontal color=0xff borderAlpha=0.15 width=600 height=240 paddingTop=10 paddingRight=5 paddingBottom=10 paddingLeft=5 horizontalAlign=center mx:LineChart id=linechart color=0x323232 height=100% showDataTips=true dataProvider={expensesAC} mx:horizontalAxis mx:CategoryAxis categoryField=Month/ /mx:horizontalAxis mx:series mx:LineSeries yField=Profit form=curve displayName=Profit/ /mx:series /mx:LineChart mx:Legend dataProvider={linechart} color=0x323232/ /mx:Panel /mx:Application this code is working fine, but is thr any way with i can do the 1 thing that is when i rollover on any name of month(which at X axis, like Jan), it should show tooltip, and on this tooltip i can see the profit , month,amount like save i can see when i rollover on that line. thx in advanced, :)
[flexcoders] Can't seem to get Myriad Pro to encode in Flex
I'm trying to embed couple versions of Myriad Pro into my Flex project: Myriad Pro Semibold Condensed Myriad Pro Semibold Condensed Italic Myriad Pro Condensed I've tried two different methods to embed the fonts using CSS: 1. Using an OTF file. 2. Using a fla file with embedded fonts using dynamic text boxes. I can embed fonts that has any combination of these styles: bold, italic, or normal. But it does not seem to allow me to transcode fonts that have anything outside of those styles, such as semibold, condensed, etc. Has anyone successfully dealt with this problem or knows how to? Thanks, Adrian
[flexcoders] Re: Can't seem to get Myriad Pro to encode in Flex
By the way, I used Flash CS4 to create my font swf. --- In flexcoders@yahoogroups.com, Adrian Gillette gille...@... wrote: I'm trying to embed couple versions of Myriad Pro into my Flex project: Myriad Pro Semibold Condensed Myriad Pro Semibold Condensed Italic Myriad Pro Condensed I've tried two different methods to embed the fonts using CSS: 1. Using an OTF file. 2. Using a fla file with embedded fonts using dynamic text boxes. I can embed fonts that has any combination of these styles: bold, italic, or normal. But it does not seem to allow me to transcode fonts that have anything outside of those styles, such as semibold, condensed, etc. Has anyone successfully dealt with this problem or knows how to? Thanks, Adrian
[flexcoders] swfLoaded charts dataTips lose parent container boundaries -- WAS: 3.0.2 Upgrade Causes PieChart dataTipFunction placement to go haywire???
OK, after a half day of waste on this, I've narrowed down the problem that I am having with my pie chart dataTips. It seem most likely that the problem exists somewhere in changes that were made to the swfLoader code between v3.0 and v3.2. When I have my charts loaded via a swfLoader into a panel on my dashboard, my dataPoints go grape ape on me and instead of keeping their positioning within the panel, they default to the parent container and get way ugly. When I hard code the same charts from the swf to the dashboard code, the dataTips function perfectly. I have attached two files here. The first (chartTesters.mxml) is a basic layout with two panels on a cavas. One panel and piechart set has been created in the mxml. This works beautifully. You will also see a second panel setup dynamicaly in the AS code, creating the panel and calling the swfLoader to load the swf created from the second file attached here (testHGWidget.mxml). It is the same code as the pie charts in the mxml. This one's dataTips are jacked. When you run it, you will notice that hovering over the pie wedges on the Static/Hardcoded charts provide dataTips just above and to the right of the mousewhere they should be. When you hover over the pie wedges on the Dynamic/swfLoaded charts, your dataTips are forced to the top left of the main canvas instead of staying within the panel. Any help with this would be GREATLY appreciated as I really need to fix this and am suspecting it is an Adobe bug. Best, Adrian Tom Chiverton wrote: On Monday 23 Feb 2009, Adrian Williams wrote: Notice that I've captured it when my cursor is over the Haplogroup Charts, mtDNA haplogroups, wedge H. These must be your own components, right ? Do you have a simple test case ? -- Tom Chiverton Helping to elementarily aggregate market-driven revolutionary impactful customers This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB. A list of members is available for inspection at the registered office together with a list of those non members who are referred to as partners. We use the word ?partner? to refer to a member of the LLP, or an employee or consultant with equivalent standing and qualifications. Regulated by the Solicitors Regulation Authority. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 2500. For more information about Halliwells LLP visit www.halliwells.com http://www.halliwells.com/. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute creationComplete=initApp() viewSourceURL=srcview/index.html mx:Script ![CDATA[ import mx.collections.*; import mx.collections.ArrayCollection; import mx.controls.SWFLoader; import mx.containers.Canvas; import mx.containers.Panel; import mx.charts.series.PieSeries; import mx.charts.series.items.PieSeriesItem; import mx.charts.chartClasses.Series; import mx.charts.ChartItem; import mx.collections.ArrayCollection; import mx.rpc.events.ResultEvent; import mx.charts.HitData; import mx.formatters.NumberBaseRoundType; [Bindable] private var yHaplos:ArrayCollection = new ArrayCollection( [ {Count: 3, YHaplogroup: I-M170, Snp: M170, Haplo: I, Description: Haplogroup I dates to 23,000 years ago or longer. Lineages not in branches I1, I2a or I2b are found distributed at low frequency throughout Europe.}, {Count: 3, YHaplogroup: J-M172, Snp: M172, Haplo: J2, Description: This lineage originated in the northern portion of the Fertile Crescent where it later spread throughout central Asia, the Mediterranean, and south into India. As with other populations with Mediterranean ancestry this lineage is found within Jewish populations.}, {Count: 2, YHaplogroup: R-M198, Snp: M198, Haplo: R1a1, Description: The R1a lineage is believed to have originated in the Eurasian Steppes north of the Black Caspian Seas. This lineage is thought to descend from a population of the Kurgan culture, known for the domestication of the horse (circa 3000 B.C.E.). These people were also believed to be the first speakers of the Indo-European language group. This lineage is found in central western Asia, India, and in Slavic populations of Europe.}, {Count: 1
[flexcoders] Wicked Memory Leaks and Massive Loitering Objects
Hi all, My forehead is becoming flatter by the minute as I bang my head against the wall on this one In my dashboard application, I have a tab navigator with a canvas that defines each tab. A single tab/canvas has numerous panels and each panel has a swfloader swf file. When a user clicks on a different tab, I'm trying to unload all the components on the tab (canvas.removeAll()) before making the switch...in an effort to free up the memoryI've made sure to go thru and add appropriate listener removals but when I run the app, I end up like an ant standing in front of Hoover dam, yelling Bring it on!!. After clicking the third tab, memory is maxed and FF crashes So, I've run this sucker through the flex profilertaken snapshots and compared to find loitering objects...holy crapthere are PAGES of loitering objects...with the top two offenders being 62,000 String instances taking up 3,233,462 (30.01%) of memory and 439 Class instances taking up 3,308,623 (30.71%) of memory. Upon investigation, every freakin string that is returned from my web service calls and used in the panels is saved in memory... The rest of the top ten list are: UITextField, Function, Object, Array, Button, QName, WSDLMessagePart and UIComponent. (wtf is QName???) I've poured thru what I can find on the net about getting rid of all this junk...and haven't found much. I'm seriously hoping for some help because we cannot go public beta with this until I get the memory problems ironed out. I found some information that is perplexing... 1.) The removeAll() doesn't actually unload anything from memory?? It only removes it from the container?? What!?! 2.) I scrapped the removeAll() and tried instead to use the delete() function, cycling thru all the panels on the canvas and doing a delete panel. That pukes on me with the error 1189: Attempt to delete the fixed property mdiwindow. Only dynamically defined properties can be deleted. 3.) It seems that renderer's like to hang out for a while and enjoy the show...with no clear way to get rid of them (kinda like my Uncle Jesse) So, folks, all help here would certainly be appreciatedhow in the world do I get this stuff cleared out? Should I be trying to unload the swf's or will that results in the same thing as the removeAll()...gone...but not really? Looking forward to getting this resolved, Adrian
Re: [flexcoders] Is there any way to use predefined functions for a sortCompareFunction?
I don't think you can use the sortCompareFunction that way...it needs a function to process your data against. We use a number of customized sorting functions on a number of our fields via both sort.compareFunction as well as adg.sortCompareFunction, though funny enough, the compareFunction is a bit different depending on which way you are using it. If you are tying it to an ADG sortCompareFunction, it takes two arguments while when using a Sort() compareFunction, it takes three. When trying to do an alphabetical sort (on the ADG), we do this: public static function compareLastNames(name1:Object, name2:Object):int { var newName1:String = name1.LastName + name1.FirstName + name1.MiddleName; var newName2:String = name2.LastName + name2.FirstName + name2.MiddleName; if (newName1.toLowerCase() newName2.toLowerCase()) { return -1; } else if (newName1.toLowerCase() newName2.toLowerCase()) { return 1; } else { return 0; } } and when using a Sort() we do the very same logic but we have to add a fields parameter into the method signature: public static function compareLastNamesWithFields(name1:Object, name2:Object, fields:Array = null):int In this case, we've automatically set the fields array to null as we never have any fields to pass in but without it, flex throws errors (we've long thought this to be a bug). Also note that these are public and static because we've abstracted them into a class. Hope this helps! Adrian Jeffry Houser wrote: Keith Hughitt wrote: When working with DataGrid ItemRenderers, you can say something like itemrenderer=Text, and Flex will know how to deal with the data. I just tested, this gives me a compiler error both on a ComboBox and DataGrid. What are you doing that I'm not doing? Is there anyway you can do this with a sortCompareFunction, e.g. sortCompareFunction=Numeric or sortCompareFunction=String? Will using the sortOptions property on a DataGridColumn do what you want? http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/fl/controls/dataGridClasses/DataGridColumn.html#sortOptions http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/fl/controls/dataGridClasses/DataGridColumn.html#sortOptions http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/Array.html#sort http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/Array.html#sort() -- Jeffry Houser, Technical Entrepreneur Adobe Community Expert: http://tinyurl.com/684b5h http://tinyurl.com/684b5h http://www.twitter.com/reboog711 http://www.twitter.com/reboog711 | Phone: 203-379-0773 -- Easy to use Interface Components for Flex Developers http://www.flextras.com?c=104 http://www.flextras.com?c=104 -- http://www.theflexshow.com http://www.theflexshow.com http://www.jeffryhouser.com http://www.jeffryhouser.com -- Part of the DotComIt Brain Trust
Re: [flexcoders] How to reload a SWFLoader swf in place
Hi Gregor, This primary reason this isn't feasible is that a couple of the datasets are incredibly complex and immense, including some serious grouping collection work. We toyed with the idea of doing just what you suggested, but it would be a coding nightmare to force, for example, a new parent node created in one widget to be added to a completely separate ADG in another widget (which has the same hierarchical structure, but displays a different dataset)...unless someone has some ideas on how to implement this easily Thanks, Adrian Gregor Kiddie wrote: have a scenario (or six) where a user may change data in one widget that needs to be reflected in another widget. Why can't you use localconneciton or shared object to move the data rather than doing a reload? Gk. **Gregor Kiddie** Senior Developer *INPS* Tel: 01382 564343 Registered address: The Bread Factory, 1a Broughton Street, London SW8 3QJ Registered Number: 1788577 Registered in the UK Visit our Internet Web site at www.inps.co.uk blocked::http://www.inps.co.uk/ The information in this internet email is confidential and is intended solely for the addressee. Access, copying or re-use of information in it by anyone else is not authorised. Any views or opinions presented are solely those of the author and do not necessarily represent those of INPS or any of its affiliates. If you are not the intended recipient please contact is.helpd...@inps.co.uk
[flexcoders] Re: Problem calling a web service - error 2032
This is a very annoying error that appears to have a zillion different causes - all it means is that something went wrong when flex tried to execute your code - it could mean that the file was not found or it could mean that it bombed for some reason. After hunting around on the web for endless hours, I figured out that the only way to resolve this error is to debug the webservice or function call by typing in the url directly. In my case, It turned out to be the simple fact that I copied over the wrong (buggy) file to my server thanks to the way that flexbuilder caches source code to my local host. --- In flexcoders@yahoogroups.com, guy.tomer guy.to...@... wrote: Hello, I've been struggling half a day with this Error 2032 returning from one of the APIs in my webservice. This API already worked and somehow after regenerating the proxies it stopped! Finally I figured out the only difference between this API and the others that work is that this one gets no parameters... crazy as it sounds when I added a parameter to the API and regenerated the classes everything began to work... Does anyone have an explanation? or do I have to leave this ugly dummy and mark it as another bug in the generated classes implementation... Anyway - at least maybe this will save others the fight. Guy
Re: [flexcoders] Re: Events and Child SWFs
Hi Wally, Looking at your question in blue, the simple solution is from your parent app, reference a function in your swf that will set the flag...remember it has to be public for the app to be able to reference it. (parent document) var childSWF:SWFLoader = new SWFLoader(); parentDoc.addChild(childSWF); private function onDelete(event:MouseClick):void { childSWF.setDeleteFlag(); } (child swf) private var deleteFlag:Boolean = false; public function setDeleteFlag():void { deleteFlag = true; } HTH, Adrian Wally Kolcz wrote: I thought the child of the parent (main application) would be *up* the chain. The child has to listen and react to the event dispatched by the main application. I've got a parent application with a 'delete' button. When it's clicked, I want to set a flag in a child swf, which is loaded via SWF loader. *From*: Tracy Spratt tspr...@lariatinc.com *Sent*: Thursday, February 12, 2009 10:16 AM *To*: flexcoders@yahoogroups.com *Subject*: RE: [flexcoders] Re: Events and Child SWFs You are misunderstanding how listeners work. You add the listener to the component that **dispatches** the event, and have it call a method where you want the action to take place. parent just goes up one component. The surest way to do this is to use Application.application.addEventListener(). A bubbling event will hot help you going in this direction (down to the child) Tracy Spratt Lariat Services Flex development bandwidth available *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On Behalf Of *stldvd *Sent:* Thursday, February 12, 2009 1:02 PM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] Re: Events and Child SWFs Hi Steve, But I need the child swf to react, not the parent. So I think the listener has to be in the child, not the parent. David --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com, Steve Mathews happy...@... wrote: You are assigning the listener to the wrong object. this is your child swf, but it is the parent that dispatches the event. Depending on the rest of the app this.parent might work. So: this.parent.addEventListener(inDeleteMode, deleteModeHandler); Steve On Thu, Feb 12, 2009 at 10:44 AM, stldvd stl...@... wrote: Hi guys, I've got a parent application with a 'delete' button. When it's clicked, I want to set a flag in a child swf, which is loaded via SWF loader. So in the parent app on the button's click event I'm dispatching an event: dispatchEvent(new Event(inDeleteMode)); In the child SWF's init function I've got this: this.addEventListener(inDeleteMode, deleteModeHandler); And then the deleteModeHandler function (stubbed in for testing): private function deleteModeHandler():Boolean { Alert.show(got it!); return true; } It ain't working. Can someone see what I'm doing wrong? Thanks, David -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
[flexcoders] How to reload a SWFLoader swf in place
Hi All, Have our dashboard application with numerous widgets (individual panels with a swf loaded with via a SWFLoader. We have a scenario (or six) where a user may change data in one widget that needs to be reflected in another widget. Short of making them completely reload the app just to see the one widget get updated, I've added a reload icon to the panel controls, thinking that they can reload the single widget at will. So now the key questions are these: 1.) How do I get a SWFLoader object to reload in place? 2.) How do I get the document.parameters that were passed when the original SWFLoader was created passed again into the reloaded swf? Thanks in advance!! Adrian
Re: [flexcoders] What comes out of a datagrid
Hi Wally, We have something that's practically identical to what you have described. For ours, instead of waiting until all the people have been dragged, we setup a number of listeners on our blank ADG (DRAG_START, DRAG_ENTER, DRAG_DROP) and as soon as the person is dropped, we reference our sourceGrid.selectedItems property which has the pertinent information about the 'fella' that was droppedonce we have that, we hit our web service, passing the information, including the group change info to our db. Alternatively, you can take a look at your teamDG.dataProvider and see the data that's been dropped in it... HTH, Adrian Wally Kolcz wrote: Lets say I have 2 DataGrids, one has user info in it (populated with a binded ArrayCollection) and the other is blank (lets call it id=teamDG). You can drag the people from the populated to the blank to populate it. Got that part to work fine. When you have dragged all the people you wanted to the blank one and then wanted to save that new group of people, how can you go about saving them? Is there a specific array or object associated with that DataGrid (teamDG) which then you can pass to a function to populate a database? Any examples or tutorials out there? Thanks.
Re: [flexcoders] Re: Default sorting for Datagrid
We handle this in a couple different fashions...for data already in the grid, (albeit for an ADG vs. a DG), by setting up a custom sorter. var sorter:Sort = new Sort(); sorter.compareFunction = sortKitNums; sorter.fields = new Array(); memberReportData.sort = sorter; memberReportData.refresh(); In the code above, we instantiate our sorter and then point the compareFunction to our custom sort function. Then we invoke the sort against our arrayCollection, refresh, then do a validateNow on our ADG and poof! Usually, though, we also sort the data on the server before it ever gets to our flex layer. We are using a MS-SQL Db and via a ton of stored procedures, our data sets are ordered as we need them before they are returned to the flex...this way, we use the horsepower of the server vs. relying on the host machine. This would be easily done for you as well if you have a date field as the ORDER BY function of most DB languages will correctly sort your data by a date field. HTH, Adrian valdhor wrote: I don't know if this is overly helpful but I normally do my initial sort on the server (It is much easier for the database to do the sorting). If you really want to do the sort at Flex end you should sort the underlying dataprovider using the sort and sortfield classes. See: http://blog.flexexamples.com/2007/08/05/sorting-an-arraycollection-using-the-sortfield-and-sort-classes/ http://blog.flexexamples.com/2007/08/05/sorting-an-arraycollection-using-the-sortfield-and-sort-classes/ --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com, sleblang sc...@... wrote: I am looking to have a datagrid initially sort its data by one of its columns, the date column. Is the only way to set an initial sort value is by simulating a DataGridEvent.HEADER_RELEASE event? This is the only solution I could seem to find (http://www.bealearts.co.uk/blog/2007/06/15/default-sorting-for-a-flex-d\ http://www.bealearts.co.uk/blog/2007/06/15/default-sorting-for-a-flex-d atagrid/ http://www.bealearts.co.uk/blog/2007/06/15/default-sorting-for-a-flex-d\ http://www.bealearts.co.uk/blog/2007/06/15/default-sorting-for-a-flex-d atagrid/ ) . Thanks for any and all replies.
[flexcoders] [Fwd: UPDATE: how to forcibly minimize a window via flexmdi window]
Ok, So once my morning caffeine jolt hit me, I realized that I already know how to force a mouseclick in the event: newPanel.minimize(new MouseEvent(MouseEvent.CLICK, true, false)); So, I fire the event and even walked the code thru the debugger to watch it go into the function and act normally...but my window still defiantly sits un-minimizedsigh... Adrian Original Message Subject:how to forcibly minimize a window via flexmdi window Date: Mon, 02 Feb 2009 09:12:40 -0600 From: Adrian Williams adri...@familytreedna.com To: flexcoders@yahoogroups.com Hi gang, I've been toying with the outstanding flexmdi component from flexlib and have found something challenging... One of the pieces of the MDIWindow is the minimize() function. I'm creating the windows on the canvas dynamically based on the users last know settings...including whether they have minimized any of the windows on their dashboard. I have a variable in their record for each window called isCollapsed (bit/bool). What I'm trying to do is when the records are read and the windows are dynamically created, I check to see if the isCollapsed == true and if so, I'm trying to fire the MDIWindow.minimize() function. However, it's expecting a mouseEvent and I'm not sure how to force a non-existent event into the function??? Basically, I need to programmatically emulate a mouseclick on the minimize button of the window. I've tried a number of alternative methods without success, including these: newWindow.minimize(); newWindow.minimize(null); newWindow.dispatchEvent(MDIWindowEvent.MINIMIZE); dispatchEvent(new MDIWindowEvent(MDIWindowEvent.MINIMIZE, newWindow)); Here is the minimize function: public function minimize(event:MouseEvent = null):void { // if the panel is floating, save its state if(windowState == MDIWindowState.NORMAL) { savePanel(); } dispatchEvent(new MDIWindowEvent(MDIWindowEvent.MINIMIZE, this)); windowState = MDIWindowState.MINIMIZED; showControls = false; } Has anyone tried to do this or have any ideas on what to try next? Thanks, Adrian
[flexcoders] how to forcibly minimize a window via flexmdi window
Hi gang, I've been toying with the outstanding flexmdi component from flexlib and have found something challenging... One of the pieces of the MDIWindow is the minimize() function. I'm creating the windows on the canvas dynamically based on the users last know settings...including whether they have minimized any of the windows on their dashboard. I have a variable in their record for each window called isCollapsed (bit/bool). What I'm trying to do is when the records are read and the windows are dynamically created, I check to see if the isCollapsed == true and if so, I'm trying to fire the MDIWindow.minimize() function. However, it's expecting a mouseEvent and I'm not sure how to force a non-existent event into the function??? Basically, I need to programmatically emulate a mouseclick on the minimize button of the window. I've tried a number of alternative methods without success, including these: newWindow.minimize(); newWindow.minimize(null); newWindow.dispatchEvent(MDIWindowEvent.MINIMIZE); dispatchEvent(new MDIWindowEvent(MDIWindowEvent.MINIMIZE, newWindow)); Here is the minimize function: public function minimize(event:MouseEvent = null):void { // if the panel is floating, save its state if(windowState == MDIWindowState.NORMAL) { savePanel(); } dispatchEvent(new MDIWindowEvent(MDIWindowEvent.MINIMIZE, this)); windowState = MDIWindowState.MINIMIZED; showControls = false; } Has anyone tried to do this or have any ideas on what to try next? Thanks, Adrian
Re: [flexcoders] Re: DataGrid Drop Deny based on dropIndex
Hi S, That's a toughie...I haven't tried to selectively deny a drop depending on an index... I don't know of any methods that will reject the drag-drop other than the stopPropagation and stopImmediatePropagation methods. You might try looking the DRAG_OVER event to see if you can selectively showDropFeedback and hideDropFeedback depending on what rows you are over and then in your listener, if it's dropped where its not supposed to be cancel the op. Another idea would be if you know which row's you don't want drop enabled on, see if you can manipulate the drop properties of those row to deny the drop?? Not really sure what else to do herebut am interested to know if you find out how! Best, Adrian park96 wrote: Hi Adrian, Thanks for the response. So I didn't know about the hideDropFeedback method on the ListBase class. That helps a bit but the problem I'm encountering now, is that when I start dragging, it denies it at first, but once it passed over a row that it's able to drop, it becomes droppable over all the rows. It looks like the DragManager.acceptDragDrop() toggles on and won't turn back off even if I hide the dragDropFeedback. Is there a method like DragManager.rejectDragDrop() so that when I'm dragging a row over all the rows, that it will reject certain rows, but accepts others? Thanks s.park --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com, Adrian Williams adri...@... wrote: Hi, We handle something very similar to this, and although we don't deny a drop based on the index, we use the index to persist the drop location in the database...the same logic applies. We are using this on an ADG and hence my example below: You could grab the internal targetGrids dropData get the dropData.index...check it and if its not the value you want, perform an event.preventDefault and stopPropagation... private function adg_DragEvent(event:DragEvent):void { var targetGrid:AdvancedDataGrid = event.currentTarget as AdvancedDataGrid; use namespace mx_internal; var dropData:Object = targetGrid.mx_internal::_dropData; adgIndex = dropData.index; if (adgIndex 4) { targetGrid.hideDropFeedback(event); targetGrid.selectedItems = new Array(); event.preventDefault(); event.stopPropagation(); } } HTH! Adrian park96 wrote: Anyone have an example of how to deny a drop based on the drop index? The problem I'm facing is that even though my dragEnter event handler doesn't call the DragManager.acceptDragDrop(UIComponent), it still allows me to drop it.
Re: [flexcoders] adding components in alert control
The only way I have seen this possible is to use the PopUpManager. For our app, a user can delete a participant from their group (by dragging their ADG row to a trash can), but have to provide a reason why. So, we created a TitleWindow component that we pull in via the PopUpManager. Here's the code. I imagine there is a better way to do this, but this is what works for us. The component (called DeleteParticipantTitleWindow.mxml): ?xml version=1.0? mx:TitleWindow xmlns:mx=http://www.adobe.com/2006/mxml; showCloseButton=true width=350 height=100% borderAlpha=1 verticalAlign=middle horizontalAlign=center mx:Script ![CDATA[ import mx.managers.PopUpManager; ]] /mx:Script mx:Text text=Please enter a reason for removing this participant:/ mx:TextInput id=reason width=300/ mx:HBox mx:Button id=okButton label=OK/ mx:Button id=cancelButton label=Cancel/ /mx:HBox /mx:TitleWindow Then we reference it in our code like this: First, we alert them (using our custom alert which extends the standard alert class) that their delete is permanent: private function deleteParticipantDrop(event:DragEvent):void { var component:IUIComponent = IUIComponent(event.currentTarget); dragComponent = component; DragManager.acceptDragDrop(component); isEditingParticipantInfo = false; isDeletingParticipant = true; deleteParticipantDropEvent = event; event.stopImmediatePropagation(); alert.confirm(Are you sure you want to delete this participant from the project? This cannot be reversed!! An email will be + sent to notify this participant and you will receive a copy of it for your records., confirmRemoveParticipant); } Then, on confirmation, we popup a window where they have to provide the reason for delete (the key here is the deleteReason = ... in the third line of the conditional): private function confirmRemoveParticipant(event:CloseEvent):void { if (event.detail == Alert.YES) { deleteParticipantDropEvent.action = DragEvent.DRAG_COMPLETE; dispatchEvent(deleteParticipantDropEvent); deleteReason = DeleteParticipantTitleWindow(PopUpManager.createPopUp( this, DeleteParticipantTitleWindow , true)); PopUpManager.centerPopUp(deleteReason); deleteReason.showCloseButton = true; deleteReason.title = Reason for removal from project; deleteReason.addEventListener(close, cleanupRemoveParticipant); deleteReason[cancelButton].addEventListener(click, cleanupRemoveParticipant); deleteReason[okButton].addEventListener(click, finalizeDeleteParticipant); isDeletingParticipant = false; } else { cleanupRemoveParticipant(); } } Then, once they enter ok, we validate their text entry and continue with the delete, which I've removed all that code for this, but wanted to show how to access the text field from the popup. public function finalizeDeleteParticipant(event:Event):void { if (deleteReason.reason.text != null) { memberReportData.removeItemAt(memberRpt.selectedIndex); } else { alert.info(You must provide a reason for removing a participant from your project!!); } cleanupRemoveParticipant(); } Hope this helps! Adrian stinasius wrote: hi how can i add a text/text input, in an alert control in flex?
Re: [flexcoders] DataGrid Drop Deny based on dropIndex
Hi, We handle something very similar to this, and although we don't deny a drop based on the index, we use the index to persist the drop location in the database...the same logic applies. We are using this on an ADG and hence my example below: You could grab the internal targetGrids dropData get the dropData.index...check it and if its not the value you want, perform an event.preventDefault and stopPropagation... private function adg_DragEvent(event:DragEvent):void { var targetGrid:AdvancedDataGrid = event.currentTarget as AdvancedDataGrid; use namespace mx_internal; var dropData:Object = targetGrid.mx_internal::_dropData; adgIndex = dropData.index; if (adgIndex 4) { targetGrid.hideDropFeedback(event); targetGrid.selectedItems = new Array(); event.preventDefault(); event.stopPropagation(); } } HTH! Adrian park96 wrote: Anyone have an example of how to deny a drop based on the drop index? The problem I'm facing is that even though my dragEnter event handler doesn't call the DragManager.acceptDragDrop(UIComponent), it still allows me to drop it.
Re: [flexcoders] DataGrid Drop Deny based on dropIndex
Hi Tracy... Ummm.epic brain fart fail? Can't see the forest for the trees? Out of the 23,598 methods...we remembered all but that one :-) Adrian Tracy Spratt wrote: Any reason you are not using the List.calculateDropIndex() method? Tracy Spratt Lariat Services Flex development bandwidth available *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On Behalf Of *Adrian Williams *Sent:* Tuesday, January 27, 2009 4:33 PM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] DataGrid Drop Deny based on dropIndex Hi, We handle something very similar to this, and although we don't deny a drop based on the index, we use the index to persist the drop location in the database...the same logic applies. We are using this on an ADG and hence my example below: You could grab the internal targetGrids dropData get the dropData.index...check it and if its not the value you want, perform an event.preventDefault and stopPropagation... private function adg_DragEvent(event:DragEvent):void { var targetGrid:AdvancedDataGrid = event.currentTarget as AdvancedDataGrid; use namespace mx_internal; var dropData:Object = targetGrid.mx_internal::_dropData; adgIndex = dropData.index; if (adgIndex 4) { targetGrid.hideDropFeedback(event); targetGrid.selectedItems = new Array(); event.preventDefault(); event.stopPropagation(); } } HTH! Adrian park96 wrote: Anyone have an example of how to deny a drop based on the drop index? The problem I'm facing is that even though my dragEnter event handler doesn't call the DragManager.acceptDragDrop(UIComponent), it still allows me to drop it.
Re: [flexcoders] Re: AdvancedDataGrid group filtering openNode
Hi folks, We actually have the same need and including the things y'all have already tried, we even tried to cycle thru the open nodes and write their object to an array, then refreshed then tried to do an open nodes for each in the array without success Alex, et al...any input to this one because it seems like a lot of folks need it! Best, Adrian Angela wrote: I am having the same problem and can't find a solution. Has anyone solved this? Angela --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com, Eric Jones gig...@... wrote: Adnan or Nigel, Did either of you resolve this? Any change you could post a solution? jonese --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com, nigelrmtaylor ntaylor@ wrote: Adnan Did you get any further with this? It looks like I'm trying to solve the same problem as you. Cheers Nigel --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com, Adnan Doric astronaute@ wrote: Hello guys, I'm trying to filter my ADG without success : I created a GroupingCollection from a flat ArrayCollection. ADG's dataProvider is GroupingCollection. First issue : refresh if I filter the underlaying ArrayCollection, the related groupingCollection doesn't refresh automatically (bug? feature?) Actually I menaged to force gc.refresh() with some event( it is impossible to listen on CollectionEventKind.REFRESH because of infinite loop ac.refresh = gc.refresh ) Second issue (more important) : openNodes Ok now that my gc is refreshed, the Tree in the ADG collapses itself (ok let say that is normal), and I need it to expand all nodes that were opened before. I tried to do something like this : var openNodes : Object = IHierarchicalCollectionView( myADG.dataProvider ).openNodes; gc.refresh(); myADG.dataProvider.openNodes = openNodes; and it doesn't works. next I tried this : var openNodes : Object = IHierarchicalCollectionView( myADG.dataProvider ).openNodes; for each( var node : Object in openNodes ) { IHierarchicalCollectionView( myADG.dataProvider.openNode( node ) } guess what, doesn't work :) I'm calling myADG.invalidateList() each time too. I don't know what to do to achieve this simple task, I'm a bit disappointed because I expected lot more from the brand new AdvancedDataGrid and this basic functionality actually seems too hard to implement. I still hope I'm wrong and someone can show me the correct solution :) Thank you all, Adnan
Re: [flexcoders] SOLVED...Simply!!! Re: Passing variables from .swf to .swf
Hi All, First, thanks very much to all the great ideas that were thrown at me on this one...in the end, we were all very much over complicating this... Quite simply, from the dashboard, in each SWFLoader, I simply add a deeplink (probably not needed but...) with a simple name-pair. I.E. SWFLoader.source = widget.source + #project= + projectName; Then in the widgets, I simply access this.url, which is unique to each instantiation of the widget and simply substring the url to get the projectName... var urlString:String = String(this.url); projectName = urlString.substring(urlString.search(=)+1); This works perfectly and gets the data that is specific to the taband in this way, my users only have to endure one data load event instead of multiply recurring events every time they change tabs. Thanks! Adrian Amy wrote: --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com, Tracy Spratt tspr...@... wrote: Using a model and events is probably best, but you can also go straight through dom references. Listeners can be added to dynamically created components, so you would not need specific, named references to the child swfs. Note that you probably want to still keep references to your swfs somewhere, so that you can remove the listeners if you need to make sure they get garbage collected. You'll probably want to do this in an Array or ArrayCollection so that it can expand with the number of swfs you create. Or you can just use one swf and move it around :) HTH; Amy
Re: [flexcoders] SOLVED...Simply!!! Re: Passing variables from .swf to .swf
Hi Alex, Just for giggles, I tried that and while the document.parameters object exists, it's empty. I also tried several other possible areas and they are the same. Was worth trying though! Thanks, Adrian Alex Harui wrote: In theory, instead of decoding this.url, you can look at the document.parameters.projectName *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On Behalf Of *Adrian Williams *Sent:* Thursday, January 22, 2009 9:35 AM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] SOLVED...Simply!!! Re: Passing variables from .swf to .swf Hi All, First, thanks very much to all the great ideas that were thrown at me on this one...in the end, we were all very much over complicating this... Quite simply, from the dashboard, in each SWFLoader, I simply add a deeplink (probably not needed but...) with a simple name-pair. I.E. SWFLoader.source = widget.source + #project= + projectName; Then in the widgets, I simply access this.url, which is unique to each instantiation of the widget and simply substring the url to get the projectName... var urlString:String = String(this.url); projectName = urlString.substring(urlString.search(=)+1); This works perfectly and gets the data that is specific to the taband in this way, my users only have to endure one data load event instead of multiply recurring events every time they change tabs. Thanks! Adrian Amy wrote: --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com, Tracy Spratt tspr...@... wrote: Using a model and events is probably best, but you can also go straight through dom references. Listeners can be added to dynamically created components, so you would not need specific, named references to the child swfs. Note that you probably want to still keep references to your swfs somewhere, so that you can remove the listeners if you need to make sure they get garbage collected. You'll probably want to do this in an Array or ArrayCollection so that it can expand with the number of swfs you create. Or you can just use one swf and move it around :) HTH; Amy
Re: [flexcoders] SOLVED...AGAIN!!!! Re: Passing variables from .swf to .swf
Hi Tracy, You were correct! By changing the delimiter to ?, the parameters value was picked up. I am assuming that it will also populate each name pair instance such as: ?project=projectNameloginId=username Would this give me document.parameters.project and document.parameters.loginId? Thanks, Adrian Tracy Spratt wrote: It may be the #. If you append url parameters to the swf url, you can access them in this.parameters. ...myWidget.swf?project=myProject I have done this, sorry I didn't think to suggest it. Tracy Spratt Lariat Services Flex development bandwidth available *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On Behalf Of *Adrian Williams *Sent:* Thursday, January 22, 2009 1:51 PM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] SOLVED...Simply!!! Re: Passing variables from .swf to .swf Hi Alex, Just for giggles, I tried that and while the document.parameters object exists, it's empty. I also tried several other possible areas and they are the same. Was worth trying though! Thanks, Adrian Alex Harui wrote: In theory, instead of decoding this.url, you can look at the document.parameters.projectName *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On Behalf Of *Adrian Williams *Sent:* Thursday, January 22, 2009 9:35 AM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] SOLVED...Simply!!! Re: Passing variables from .swf to .swf Hi All, First, thanks very much to all the great ideas that were thrown at me on this one...in the end, we were all very much over complicating this... Quite simply, from the dashboard, in each SWFLoader, I simply add a deeplink (probably not needed but...) with a simple name-pair. I.E. SWFLoader.source = widget.source + #project= + projectName; Then in the widgets, I simply access this.url, which is unique to each instantiation of the widget and simply substring the url to get the projectName... var urlString:String = String(this.url); projectName = urlString.substring(urlString.search(=)+1); This works perfectly and gets the data that is specific to the taband in this way, my users only have to endure one data load event instead of multiply recurring events every time they change tabs. Thanks! Adrian Amy wrote: --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com, Tracy Spratt tspr...@... mailto:tspr...@... wrote: Using a model and events is probably best, but you can also go straight through dom references. Listeners can be added to dynamically created components, so you would not need specific, named references to the child swfs. Note that you probably want to still keep references to your swfs somewhere, so that you can remove the listeners if you need to make sure they get garbage collected. You'll probably want to do this in an Array or ArrayCollection so that it can expand with the number of swfs you create. Or you can just use one swf and move it around :) HTH; Amy
[flexcoders] Passing variables from .swf to .swf
Hi All, I've been researching this challenge and am not sure which of the methods I've found is the best...need some input on this one. I have a dashboard application (dashboard.swf) that uses multiple swfloaders to load the various widgets that the user needs (which are also .swf's). The trick is that I need to pass a variable into the widgets to let them know which user logged in which allows the widget to load the data specific to that user. I've seen a method that utilizes a localConnection to pass a connection string, a method and parameters...my concern is the local connection...there can be up to 20 widgets on a dashboard and opening an LC for each doesn't seem like it's be efficient... Help?! Thanks, Adrian
Re: [flexcoders] Passing variables from .swf to .swf
Hi Tracy, We are already using a cental db here...we are running a pretty massive DB via SQL, use C#.Net for our control layer and use Flex/AS for our presentation, which calls for the data using a WSDL...the dashboard is for project managers...when they login to the dashboard, I need to be able to pass their loginId to the widgets so they can load the various data points for the project that person manages...i.e. widget-A loads project statistics...and it needs to know which project's statistics to load...the only way it will know that is by having the userId that logged in. Or am I not understanding what you are referring to as a central data model? Adrian Tracy Spratt wrote: How about just having a central data model? Tracy Spratt Lariat Services Flex development bandwidth available *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On Behalf Of *Adrian Williams *Sent:* Wednesday, January 21, 2009 11:53 AM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] Passing variables from .swf to .swf Hi All, I've been researching this challenge and am not sure which of the methods I've found is the best...need some input on this one. I have a dashboard application (dashboard.swf) that uses multiple swfloaders to load the various widgets that the user needs (which are also .swf's). The trick is that I need to pass a variable into the widgets to let them know which user logged in which allows the widget to load the data specific to that user. I've seen a method that utilizes a localConnection to pass a connection string, a method and parameters...my concern is the local connection...there can be up to 20 widgets on a dashboard and opening an LC for each doesn't seem like it's be efficient... Help?! Thanks, Adrian
Re: [flexcoders] What is the results of a web service
Hi Wally, Any particular reason you are not setting a resultFormat on your mx:operation? For example: mx:operation name=service resultFormat=object result=serviceResult(event)/ Adrian Wally Kolcz wrote: I am having fits trying to figure out how to use the information coming back from a webservice. I created a web service call in my code: mx:WebService id=storyGateway wsdl=http://www2.med.umich.edu/prmc/media/newsroom/stories.cfc?wsdl; fault=Alert.show(event.fault.message,'Story Gateway Error') mx:operation name=listBySubject result=buildBookHandler(event) fault=Alert.show(event.fault.message,'Story Gateway Error') / /mx:WebService It returns the data as requested, I can see it in my debugging, but I cannot figure out how to set it to a variable and then call the various elemenets (linkText, story, photo, defaultLogo) I tried to set it to a variable as an ArrayCollection: [Bindable] public var storyFeed:ArrayCollection = new ArrayCollection(); public function buildBookHandler(e:ResultEvent):void { storyFeed = e.result as ArrayCollection; for (var i:uint = 0; i e.result.data.length; i++){ ... //Story Area var storyArea:TextArea = new TextArea(); storyArea.text = storyFeed.getItemAt(i).story; storyArea.wordWrap = true; storyArea.height = 550; storyArea.width = 400; storyArea.editable = false; magPage.addChild(storyArea); storyArea.x = 0; storyArea.y = 25; ... } rssMag.flipOnClick = true; } But still getting errors.. TypeError: Error #1009: Cannot access a property or method of a null object reference. at RSSMagazine/buildBookHandler()[D:\wkolcz\My Documents\Flex Builder 3\RSSMagazine\src\RSSMagazine.mxml:36] Line 36 is: storyArea.text = storyFeed.getItemAt(i).story; Help!
Re: [flexcoders] Passing variables from .swf to .swf
Hi Tracy, Oh if only it were that easy!! Looks like it's gonna have to be much deeperhere's why... A project manager can have any number of projects they run... The dashboard is setup so they have access to all their projects via one dashboard Basically, when they login, I get a list of all the projects they manageand then create a simple viewStack with tabNavigator, one tab for each of the projects they run. Each tab has the same widgets, only loaded with the data specific to the project for the tab they are looking at (much akin to having several tabs opened in Firefox, all of them on Amazon, yet on each one, I'm looking for a book different from the other tabs.) The widgets are simple stand-alone apps that are repatedly used in each tab...i.e. projectStatistics.swf is used once on every tab (i.e. for every project) on the dashboard. For each instance of the widget, it needs to know the project name so it can query the data for that specific project. All of this is created dynamically in my actionscript (will paste below). In addition, the user can customize (and persist in the db) their widget configuration for each project (tab). So, with my 3-column layout, they might have, on [Tab1] Project 1, column 1, Widgets A, C and D while on [Tab2] Project 2, column 1, Widgets A, B, F, Q. All of this persistence is read from the database upon their login and the code simply builds their dashboard, tabs and widgets based on their last know setup. Since this is so dynamic, I don't think I can get away with trying to access any static public variables via application.application. I've taken a look at your example on cflex.net on manipulating the .content property, but it looks like I need to specifically reference each of the loaded widgets, which is not very simple considering their dynamic loading... Any other ideas? And I cannot seem to find much regarding the data model in flex you mentioned... Best, Adrian private function getGapWidgetConfigurationsResult(event:ResultEvent):void { gapWidgetConfigs = event.result as ArrayCollection; buildViewstack(); } private function buildViewstack():void { for each (var project:Object in projectsArray) { var projectName:String = project.label; var newCanvas:Canvas = new Canvas(); newCanvas.id = canvas + projectName; newCanvas.label = projectName; newCanvas.percentHeight = 100; newCanvas.percentWidth = 100; dashboardMainViewstack.addChild(newCanvas); var newHBox:HBox = new HBox(); newHBox.id = hbox + projectName; newHBox.percentHeight = 100; newHBox.percentWidth = 100; newCanvas.addChild(newHBox); for (var i:int = 0; i 3; i++) { var newVBox:VBox = new VBox(); newVBox.id = col + i + projectName; newVBox.percentWidth = 33; newVBox.percentHeight = 100; newVBox.setStyle(borderStyle, solid); newVBox.setStyle(borderThickness, 1); newVBox.setStyle(cornerRadius, 4); newVBox.setStyle(horizontalAlign, center); newVBox.setStyle(horizontalCenter, 0); newVBox.setStyle(paddingTop, 5); newVBox.setStyle(paddingBottom, 5); newVBox.setStyle(backgroundColor, #FCF3D3); newVBox.addEventListener(MouseEvent.MOUSE_DOWN,setMouseDownTrue); newVBox.addEventListener(MouseEvent.MOUSE_UP,setMouseDownFalse); newVBox.addEventListener(DragEvent.DRAG_ENTER,checkAndHandleDE); newVBox.addEventListener(DragEvent.DRAG_DROP,checkAndHandleDD); newHBox.addChild(newVBox); for each (var widgets:Object in gapWidgetConfigs) { if (widgets.DisplayColumn == i + 1 widgets.BcgGroup == projectName widgets.Active == 1) { var newPanel:SuperPanelPlus = new SuperPanelPlus(); newPanel.id = widgets.PanelId; newPanel.title = widgets.Title; newPanel.y = 0; newPanel.percentHeight = widgets.Height; newPanel.percentWidth = 98; newPanel.collapsed
[flexcoders] DandD of row to last row of last node in grouped ADG throws RTE...looks like Adobe Bug to me...thoughts?
All, I have an ADG that contains a grouped collection. In the dataset, there are 21 nodes...each node has 1 to many children. When I attempt to drag a row, either from another node or within the last node, and drop it below the last item in the last node(i.e. make it the very last row in the group and ADG overall), the systems treats it like I'm trying to drop it at the node level instead of the child level and throws an out of bounds (which is probably due to my code that persists the orders in the database). In watching it in debugger, here are the values that occur. Here's the setup: 21 groups (nodes) in the adg. The last group has 4 children (rows). If I expand only the last node...and drag the first row of that node to the next to last row, the adg.dropData.index == 3 and the adg.dropData.parent == the node object that I am in, which is should because I am dropping it within that grouping. If I drag the first row of that node to just below the last row, intending on making it last in the group, the adg.dropData.index == 25 and the adg.dropData.parent == null. It obvious that the adg doesn't realize that I am dropping it within the last position of the group because it's the final row in the overall adg. So I tried to outsmart it. I created a handler to determine if the adg.dropData.index = (the hierarchical tree length + the length of the all the open nodes in the tree), using the assumption that if this is true, then the user is trying to put the row at the end (keep in mind I am also checking to make sure it's not a node that is being dragged to reorder). If this is true, then I manipulate the actual event.dragInitiator._dropData and the adg.dropData values and force the index (which I calculate from the number of children in the last node) and parent information into them. To a point, this works and my drop is persisted to my database per design. However, the dropped row disappears from the grid, only appearing in its correct position on refreshing the grid. The problem appears in the AdvancedDataGrid.as class.within the updateDropData function where calculations are being done to re-place the row...because the index value is 25, the top and bottom parent calculations seem to get all jacked up and in the end, the _dropData gets reset to the old values, completely overriding my efforts to cheat. Has anyone else ever seen this...know of a way to get around it. It certainly seems like an Adobe bug to me. Best, Adrian
Re: [flexcoders] a followup with example! DandD of row to last row of last node in grouped ADG throws RTE...looks like Adobe Bug to me...thoughts?
mx:AdvancedDataGridColumn dataField=Region/ mx:AdvancedDataGridColumn dataField=Territory/ mx:AdvancedDataGridColumn dataField=Territory_Rep headerText=Territory Rep/ mx:AdvancedDataGridColumn dataField=Actual/ mx:AdvancedDataGridColumn dataField=Estimate/ /mx:columns /mx:AdvancedDataGrid /mx:Panel mx:HBox width=100% mx:Button id=expandAllButton click={myADG.expandAll();} label=Expand All/ mx:Button id=collapseAllButton click={myADG.collapseAll();} label=Collapse All/ /mx:HBox /mx:VBox /mx:Application Adrian Williams wrote: All, I have an ADG that contains a grouped collection. In the dataset, there are 21 nodes...each node has 1 to many children. When I attempt to drag a row, either from another node or within the last node, and drop it below the last item in the last node(i.e. make it the very last row in the group and ADG overall), the systems treats it like I'm trying to drop it at the node level instead of the child level and throws an out of bounds (which is probably due to my code that persists the orders in the database). In watching it in debugger, here are the values that occur. Here's the setup: 21 groups (nodes) in the adg. The last group has 4 children (rows). If I expand only the last node...and drag the first row of that node to the next to last row, the adg.dropData.index == 3 and the adg.dropData.parent == the node object that I am in, which is should because I am dropping it within that grouping. If I drag the first row of that node to just below the last row, intending on making it last in the group, the adg.dropData.index == 25 and the adg.dropData.parent == null. It obvious that the adg doesn't realize that I am dropping it within the last position of the group because it's the final row in the overall adg. So I tried to outsmart it. I created a handler to determine if the adg.dropData.index = (the hierarchical tree length + the length of the all the open nodes in the tree), using the assumption that if this is true, then the user is trying to put the row at the end (keep in mind I am also checking to make sure it's not a node that is being dragged to reorder). If this is true, then I manipulate the actual event.dragInitiator._dropData and the adg.dropData values and force the index (which I calculate from the number of children in the last node) and parent information into them. To a point, this works and my drop is persisted to my database per design. However, the dropped row disappears from the grid, only appearing in its correct position on refreshing the grid. The problem appears in the AdvancedDataGrid.as class.within the updateDropData function where calculations are being done to re-place the row...because the index value is 25, the top and bottom parent calculations seem to get all jacked up and in the end, the _dropData gets reset to the old values, completely overriding my efforts to cheat. Has anyone else ever seen this...know of a way to get around it. It certainly seems like an Adobe bug to me. Best, Adrian
[flexcoders] Search Function within a Flex App -- Not Filter
Hi All, I have another wild one...has anyone seen or figured out how to embed a search function within a flex app? I have seen the information on creating filters but they all filter out (read: remove from visibility) all the data that falls outside the filter. In other words, I need to figure out how enable a search that acts the same as doing a 'find' in a webbrowser...a user enters a search criteria and the focus goes to any instance of that search criteria. Thanks, Adrian
Re: [flexcoders] Re: Setting a specific row in the ADG to editable vs. the entire grid?
Hi Tim, Thanks for the slick move here...that works to do exactly what I needed. It works perfectly for the ADG. Thanks! Adrian Tim Hoff wrote: Hi Adrian, As far as I know, you can't allow editing of specific cells/rows by default. You can however add an event listener for the itemEditBeginning event. In the event handler function, if the cell/row meets you're editable criteria, allow the function to set the editedItemPosition property. Otherwise, call the preventDefault() method, to prevent editing. I haven't tried this for ADG, but maybe this will help. -TH --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com, Adrian Williams [EMAIL PROTECTED] wrote: Hi All, I have a new question that I haven't seen anyone hit yet. I have my ADG that is not editable...however, I need to be able to make a couple of specific rows editable so the user can modify the values in the cells of the row. All of the documentation seems to identify setting up columns to be editable and not, but I've not seen anything on how to setup a specific row as editable. Anyone done this or know the trick? Thanks! Adrian
[flexcoders] Printing ADG - Livedocs code results in printing gray box
Hi all, I posted this problem awhile back with no response and am going to try again before I call Adobe. I've seen others with the same issue, but no resolutions pending. I have used the code from Adobe's labs website: http://labs.adobe.com/wiki/index.php/Flex_3:Feature_Introductions:_Advanced_DataGrid The problem is that when using this function, as written, and I try to print my ADG, all that is output from the printer is a gray box. Has anyone else found the solution to this one? Here is the code: private function doPrint():void { var printJob:FlexPrintJob = new FlexPrintJob(); // Create an instance of the FlexPrintJob class. var printADG:PrintAdvancedDataGrid = new PrintAdvancedDataGrid(); // Initialize the PrintAdvancedDataGrid control. if (printJob.start() == true) { printADG.includeInLayout = false; // Exclude the PrintAdvancedDataGrid control from layout. printADG.source = memberRpt; // Provide the data source for the report addChild(printADG); // Add the print-specific control to the application. printJob.addObject(printADG, FlexPrintJobScaleType.MATCH_WIDTH); // Add the object to print. Scale it to fit width of page. printJob.send(); // Send the job to the printer. removeChild(printADG); // Remove the print-specific control to free memory. } } Many thanks, Adrian
Re: [flexcoders]Correction! Printing ADG - Livedocs code results in printing gray box
I pointed to the wrong link. I am actually using the example given in the livedocs material and not the labs. Here is the correct link: http://livedocs.adobe.com/flex/3/langref/mx/printing/PrintAdvancedDataGrid.html Adrian Adrian Williams wrote: Hi all, I posted this problem awhile back with no response and am going to try again before I call Adobe. I've seen others with the same issue, but no resolutions pending. I have used the code from Adobe's labs website: http://labs.adobe.com/wiki/index.php/Flex_3:Feature_Introductions:_Advanced_DataGrid The problem is that when using this function, as written, and I try to print my ADG, all that is output from the printer is a gray box. Has anyone else found the solution to this one? Here is the code: private function doPrint():void { var printJob:FlexPrintJob = new FlexPrintJob(); // Create an instance of the FlexPrintJob class. var printADG:PrintAdvancedDataGrid = new PrintAdvancedDataGrid(); // Initialize the PrintAdvancedDataGrid control. if (printJob.start() == true) { printADG.includeInLayout = false; // Exclude the PrintAdvancedDataGrid control from layout. printADG.source = memberRpt; // Provide the data source for the report addChild(printADG); // Add the print-specific control to the application. printJob.addObject(printADG, FlexPrintJobScaleType.MATCH_WIDTH); // Add the object to print. Scale it to fit width of page. printJob.send(); // Send the job to the printer. removeChild(printADG); // Remove the print-specific control to free memory. } } Many thanks, Adrian
Re: [flexcoders] Disable Column reordering on Advanced Data Grid?
We had a similar challenge except we needed to persist to the DB the rearrangement of columns...to do this, we extended the event class for our listeners so we could capture column selection events...You might try using the same thing and on column selected, perform a preventDefault() which would halt any action from happening... Here's the class: package com.ftdna { import flash.events.Event; public class ColumnSelectedEvent extends Event { public var colIdx:int; public static const COLUMN_SELECTED:String = columnSelected; public static const LABEL_SELECTED:String = labelSelected; public static const COLUMN_DROP_TARGET:String = columnDropTarget; public function ColumnSelectedEvent(type:String, colIdx:int) { super(type); this.colIdx = colIdx; } override public function clone():Event { return new ColumnSelectedEvent(type, colIdx); } } } And here is an application of the class: adg.addEventListener(ColumnSelectedEvent.COLUMN_SELECTED, denySelect) private function denySelect(event:ColumnSelectedEvent):void { if (event.type == ColumnSelectedEvent.COLUMN_SELECTED) event.preventDefault(); } HTH, Adrian scottyale2008 wrote: Is it possible to disable column reordering on Advanced Data Grid? I've looked at all the properties and I don't see one such as (allowHeaderMove, allowHeaderReorder, etc.) Thanks!
[flexcoders] Tricky one...adding attachments to an email generated from the app
Hi guys, And yet another one that I haven't seen... Part of our app allows a user to send an email to one or more folks in their view. We simply provide a state that has a simple email form they fill out and then we pass that information back through our web service (.NET) that actually has the procedure to send the email. What I need to be able to do is allow the user to add attachments to the email they want to send out. Is there any way to do this and is there a better method to the email solution? We briefly toyed with the idea of just creating the hyperlink to use their own email client, but a user can literally send a bulk email to several thousand people and a hyperlink would die a slow, miserable death trying to handle that. Thanks! Adrian
Re: [flexcoders] Flash being cached
Hey there... We had the same issue and were able to work around it by adding the following three lines to the html wrapper...in the head section: meta http-equiv=Expires content=Mon, 04 Dec 1999 21:29:02 GMT / meta http-equiv=CACHE-CONTROL content=NO-CACHE / meta http-equiv=PRAGMA content=NO-CACHE / HTH, Adrian flexaustin wrote: Is there a way to prevent your swf file from being cached? I would like to prevent this in production and when using the template files (in bin-debug and bin-release) . When using these two html files my browser seems to cache the swf requiring me to do a couple of cntrl-r's and sometimes a clear cache in Firefoxs options. Anyone else have this issue?
[flexcoders] Setting a specific row in the ADG to editable vs. the entire grid?
Hi All, I have a new question that I haven't seen anyone hit yet. I have my ADG that is not editable...however, I need to be able to make a couple of specific rows editable so the user can modify the values in the cells of the row. All of the documentation seems to identify setting up columns to be editable and not, but I've not seen anything on how to setup a specific row as editable. Anyone done this or know the trick? Thanks! Adrian
Re: [flexcoders] Re: Alex et al, Could this be a bug in the AdvancedDataGridBaseEx? WAS- Strange ADG error on deleting entire nodes at once...
Alex, when you say a debug build what do you mean? and how do I access the stack trace? whenever I've heard/used stack trace before, its always been on the C# side and the entire listing that's provided when an exception is thrown...which in this case was included in the original thread (at the bottom of this email). Thanks, Adrian oneworld95 wrote: Hi, Adrian, Wow. That's a doozey of an issue. When you're on the bleeding edge, you tend to bleed a lot. My recent experience with the ADG wasn't pretty or pleasant, and I bled a lot. But by posting to this group and various blogs, I found kind souls who helped and finally, through trial-and-error, found the solution. Some thoughts on the problem, - Could it be that after the first (and each) delete, you might need to refresh your dataprovider for the ADG? It might be worth a try. - I know the myADG.invalidateDisplayList() helped a lot. It forced the ADG to fetch the latest data. I overrode the set data() method in the itemRenderer. No explicit validateDisplayList() method. - I also used the myADG.invalidateList() elsewhere when the screen wasn't refreshing. As Alex Harui suggested, do a debug build and post the entire stack trace with the linenumbers here. Good luck :) Alex --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com, Adrian Williams [EMAIL PROTECTED] wrote: Ok, I have spent the morning pouring through the debugging trying to figure out what this error is and am completely stymied. I have been able to determine it has nothing to do with my delete functions...the code never makes it to them anyway...I suspect it may be a bug in the core AdvancedDataGridBaseEx code. The actions that are being done are: 1.) A user drags a grouped node off the 6-column ADG to the trash can image on the app control bar... mx:Image source={trashImage} right=80 buttonMode=true toolTip=drag a subgroup here to delete them from the project dragDrop=deleteSubgroupDrop(event) dragEnter=deleteSubgroupEnter(event) id=image2/ 2.) my drag manager is listening and accepts the dragEnter: private function deleteSubgroupEnter(evt:DragEvent):void { var obj:IUIComponent = IUIComponent(evt.currentTarget); DragManager.acceptDragDrop(obj); } 2.) and then accepts the dragDrop. On the drop, I am throwing an alert box up to confirm that the user wants to do this: private function deleteSubgroupDrop(event:DragEvent):void { partsToDelete = new Array; partsToDelete = currentSubgroups.selectedItems; subgroupToRemove = currentSubgroups.selectedItem.GroupLabel; alert.confirm(Are you sure you want to delete this subgroup: ' + subgroupToRemove + ' from the project?? This cannot be reversed!!, deleteSubgroupAction); } 3.) When it hits the alert box, the code then jumps into the core to render the alert box. The code eventually ends up in the LayoutManager.as code on line 592, function validateDisplayList():void. 4.) The logic steps thru all of the objects that are on the stage and for each of them calls the obj.validateDisplayList(); function. All goes well until it gets to my ADG. Via the validate leg, it goes to the ADGBaseEx.as code to the function commitEditedItemPosition(coord:Object):void. During the course of this function, the columnIndex is manhandled all over the place. Eventually, it gets to line 4406 where it is checking: if(colIndex lockedColumnCount) and passes this check, stepping to the next line of if (colIndex horizontalScrollPosition + lockedColumnCount) which fails, then executing a loop against the colIndex. Once the loop is completed, the final line actualColIndex = absoluteToVisibleColumnIndex(displayToAbsoluteColumnIndex(colIndex)); is called, which is on line 7164 of the AdvancedDataGridBaseEx.as code. Within this function is a single method: return displayableColumns[columnIndex].colNum; As I stepped thru the code, I watched the values. columnIndex == 6 and on the execution of this line, the error is thrown. When I hover the mouse over the components of the line, I get tooltips on displayableColumns (Array displayableColumns - mx.controls.AdvancedDataGridBaseEx) and over [columnIndex] (columnIndex = 6). However, when I hover over the .colNum...I get nothing. In this case, the error is: TypeError: Error #1010: A term is undefined and has no properties. I am really hoping that someone, especially Alex or the like, can provide some insight to what the heck is happening here because I really, really need to get past this error. Best, Adrian oneworld95 wrote: What does your delete method look like? Try adding some IF statements to check for null or undefined values before you run the delete. If it's null or undefined, do a return. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com, Adrian Williams adrianw@ wrote: All, I could really use some help in identifying where even
Re: [flexcoders] Re: Alex et al, Could this be a bug in the AdvancedDataGridBaseEx? WAS- Strange ADG error on deleting entire nodes at once...
Thanks for the link Alex I am quite familiar with the flex builder debugger and have used it extensively...in fact used it to help nail down where the problem was occurring and why. As fate would have it, the error is now gone. My coding partner and I both merged in some changes we were making to that particular ADG (persisting re-ordering nodes via drag and drop and adding another column to the grid) and something we've done has made this error disappear...when we get a breathe, we'll take a look at what we did to see if we can figure out what made the error disappear. I can post the code for the page in here if that's what would help...but keep in mind it's a couple thousand lines... Finally, here is the stack dump that is created when the exception was thrown: TypeError: Error #1010: A term is undefined and has no properties. at mx.controls::AdvancedDataGridBaseEx/displayToAbsoluteColumnIndex()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\controls\AdvancedDataGridBaseEx.as:7166] at mx.controls::AdvancedDataGridBaseEx/commitEditedItemPosition()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\controls\AdvancedDataGridBaseEx.as:4426] at mx.controls::AdvancedDataGridBaseEx/updateDisplayList()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\controls\AdvancedDataGridBaseEx.as:1807] at mx.controls::AdvancedDataGrid/updateDisplayList()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\controls\AdvancedDataGrid.as:5924] at mx.controls.listClasses::AdvancedListBase/validateDisplayList()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\controls\listClasses\AdvancedListBase.as:3071] at mx.managers::LayoutManager/validateDisplayList()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:602] at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:675] 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] Thanks a ton!!! Adrian oneworld95 wrote: I'm hoping others will chime in. Try this presentation on Flex debugging: http://www.authorstream.com/Presentation/Edolf-30961-flex-builder-debugger-Debugging-Applications-Beginning-trace-Beyond-happen-as-Entertainment-ppt-powerpoint/ http://www.authorstream.com/Presentation/Edolf-30961-flex-builder-debugger-Debugging-Applications-Beginning-trace-Beyond-happen-as-Entertainment-ppt-powerpoint/ -Alex --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com, Adrian Williams [EMAIL PROTECTED] wrote: Alex, when you say a debug build what do you mean? and how do I access the stack trace? whenever I've heard/used stack trace before, its always been on the C# side and the entire listing that's provided when an exception is thrown...which in this case was included in the original thread (at the bottom of this email). Thanks, Adrian oneworld95 wrote: Hi, Adrian, Wow. That's a doozey of an issue. When you're on the bleeding edge, you tend to bleed a lot. My recent experience with the ADG wasn't pretty or pleasant, and I bled a lot. But by posting to this group and various blogs, I found kind souls who helped and finally, through trial-and-error, found the solution. Some thoughts on the problem, - Could it be that after the first (and each) delete, you might need to refresh your dataprovider for the ADG? It might be worth a try. - I know the myADG.invalidateDisplayList() helped a lot. It forced the ADG to fetch the latest data. I overrode the set data() method in the itemRenderer. No explicit validateDisplayList() method. - I also used the myADG.invalidateList() elsewhere when the screen wasn't refreshing. As Alex Harui suggested, do a debug build and post the entire stack trace with the linenumbers here. Good luck :) Alex --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com, Adrian Williams adrianw@ wrote: Ok, I have spent the morning pouring through the debugging trying to figure out what this error is and am completely stymied. I have been able to determine it has nothing to do with my delete functions...the code never makes it to them anyway...I suspect it may be a bug in the core AdvancedDataGridBaseEx code. The actions that are being done are: 1.) A user drags a grouped node off the 6-column ADG to the trash can image on the app control bar... mx:Image source={trashImage} right=80 buttonMode=true toolTip=drag a subgroup here to delete them from the project dragDrop=deleteSubgroupDrop(event) dragEnter
[flexcoders] Alex et al, Could this be a bug in the AdvancedDataGridBaseEx? WAS- Strange ADG error on deleting entire nodes at once...
Ok, I have spent the morning pouring through the debugging trying to figure out what this error is and am completely stymied. I have been able to determine it has nothing to do with my delete functions...the code never makes it to them anyway...I suspect it may be a bug in the core AdvancedDataGridBaseEx code. The actions that are being done are: 1.) A user drags a grouped node off the 6-column ADG to the trash can image on the app control bar... mx:Image source={trashImage} right=80 buttonMode=true toolTip=drag a subgroup here to delete them from the project dragDrop=deleteSubgroupDrop(event) dragEnter=deleteSubgroupEnter(event) id=image2/ 2.) my drag manager is listening and accepts the dragEnter: private function deleteSubgroupEnter(evt:DragEvent):void { var obj:IUIComponent = IUIComponent(evt.currentTarget); DragManager.acceptDragDrop(obj); } 2.) and then accepts the dragDrop. On the drop, I am throwing an alert box up to confirm that the user wants to do this: private function deleteSubgroupDrop(event:DragEvent):void { partsToDelete = new Array; partsToDelete = currentSubgroups.selectedItems; subgroupToRemove = currentSubgroups.selectedItem.GroupLabel; alert.confirm(Are you sure you want to delete this subgroup: ' + subgroupToRemove + ' from the project?? This cannot be reversed!!, deleteSubgroupAction); } 3.) When it hits the alert box, the code then jumps into the core to render the alert box. The code eventually ends up in the LayoutManager.as code on line 592, function validateDisplayList():void. 4.) The logic steps thru all of the objects that are on the stage and for each of them calls the obj.validateDisplayList(); function. All goes well until it gets to my ADG. Via the validate leg, it goes to the ADGBaseEx.as code to the function commitEditedItemPosition(coord:Object):void. During the course of this function, the columnIndex is manhandled all over the place. Eventually, it gets to line 4406 where it is checking: if(colIndex lockedColumnCount) and passes this check, stepping to the next line of if (colIndex horizontalScrollPosition + lockedColumnCount) which fails, then executing a loop against the colIndex. Once the loop is completed, the final line actualColIndex = absoluteToVisibleColumnIndex(displayToAbsoluteColumnIndex(colIndex)); is called, which is on line 7164 of the AdvancedDataGridBaseEx.as code. Within this function is a single method: return displayableColumns[columnIndex].colNum; As I stepped thru the code, I watched the values. columnIndex == 6 and on the execution of this line, the error is thrown. When I hover the mouse over the components of the line, I get tooltips on displayableColumns (Array displayableColumns - mx.controls.AdvancedDataGridBaseEx) and over [columnIndex] (columnIndex = 6). However, when I hover over the .colNum...I get nothing. In this case, the error is: TypeError: Error #1010: A term is undefined and has no properties. I am really hoping that someone, especially Alex or the like, can provide some insight to what the heck is happening here because I really, really need to get past this error. Best, Adrian oneworld95 wrote: What does your delete method look like? Try adding some IF statements to check for null or undefined values before you run the delete. If it's null or undefined, do a return. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com, Adrian Williams [EMAIL PROTECTED] wrote: All, I could really use some help in identifying where even to begin looking to figure out what's causing this problem. I have a ADG that is displaying a GroupingCollection. I have an application control bar that has a trash image. A user can drag a node from the ADG and drop it in the trash to delete the node and all it's children. When you initially get into the application and drag the first node of the tree to the trash, the delete fires correctly and without error. When you try to drag the (now) first node of the tree into the trash, I get the following error: TypeError: Error #1010: A term is undefined and has no properties. at mx.controls::AdvancedDataGridBaseEx/displayToAbsoluteColumnIndex()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\controls\AdvancedDataGridBaseEx.as:7166] at mx.controls::AdvancedDataGridBaseEx/commitEditedItemPosition()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\controls\AdvancedDataGridBaseEx.as:4426] at mx.controls::AdvancedDataGridBaseEx/updateDisplayList()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\controls\AdvancedDataGridBaseEx.as:1807] at mx.controls::AdvancedDataGrid/updateDisplayList()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx
[flexcoders] Strange ADG error on deleting entire nodes at once...
All, I could really use some help in identifying where even to begin looking to figure out what's causing this problem. I have a ADG that is displaying a GroupingCollection. I have an application control bar that has a trash image. A user can drag a node from the ADG and drop it in the trash to delete the node and all it's children. When you initially get into the application and drag the first node of the tree to the trash, the delete fires correctly and without error. When you try to drag the (now) first node of the tree into the trash, I get the following error: TypeError: Error #1010: A term is undefined and has no properties. at mx.controls::AdvancedDataGridBaseEx/displayToAbsoluteColumnIndex()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\controls\AdvancedDataGridBaseEx.as:7166] at mx.controls::AdvancedDataGridBaseEx/commitEditedItemPosition()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\controls\AdvancedDataGridBaseEx.as:4426] at mx.controls::AdvancedDataGridBaseEx/updateDisplayList()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\controls\AdvancedDataGridBaseEx.as:1807] at mx.controls::AdvancedDataGrid/updateDisplayList()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\controls\AdvancedDataGrid.as:5924] at mx.controls.listClasses::AdvancedListBase/validateDisplayList()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\controls\listClasses\AdvancedListBase.as:3071] at mx.managers::LayoutManager/validateDisplayList()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:602] at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:675] 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] This only errors when manipulating the second time you try to delete the first node. You can delete any of the other nodes, repeatedly, without error. I suspect there is some kind of out of index problem happening but the dump gives me no ideas on where to look. Anyone?! Thanks, Adrian
Re: [flexcoders] How to apply a custom sort to ArrayCollection??
Thanks Josh, That was exactly what I was looking for...didn't think to access the compareFunction property of the sort() function... Adrian Josh McDonald wrote: var s : Sort = new Sort(); s.compareFunction = myComparer; collection.sort = s; -Josh On Fri, Nov 14, 2008 at 9:14 AM, Adrian Williams [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: All, I have an ArrayCollection that I'd like to perform an advanced, custom sort on before it's loaded into a List...the custom sort is one that i am using for my ADG, using the column's sortCompareFunction and in a grouping collections compareFunction. I can't seem to figure out how to use it as well for my AC...any ideas? Here's some code snippets: ungroupedParticipantsForTileList = new ArrayCollection; for each (var uPart:Object in ungroupedParticipantsArray) { listInfo = uPart.KitNum + - + uPart.ParticipantName; ungroupedParticipantsForTileList.addItem({kitNum:uPart.KitNum, label:listInfo}); } and the custom sorter: private function sortNumeric(obj1:Object, obj2:Object):int Any help would be appreciated!! Thanks, Adrian -- 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] mailto:[EMAIL PROTECTED] :: http://flex.joshmcdonald.info/ http://flex.joshmcdonald.info/ :: http://twitter.com/sophistifunk http://twitter.com/sophistifunk
[flexcoders] How to apply a custom sort to ArrayCollection??
All, I have an ArrayCollection that I'd like to perform an advanced, custom sort on before it's loaded into a List...the custom sort is one that i am using for my ADG, using the column's sortCompareFunction and in a grouping collections compareFunction. I can't seem to figure out how to use it as well for my AC...any ideas? Here's some code snippets: ungroupedParticipantsForTileList = new ArrayCollection; for each (var uPart:Object in ungroupedParticipantsArray) { listInfo = uPart.KitNum + - + uPart.ParticipantName; ungroupedParticipantsForTileList.addItem({kitNum:uPart.KitNum, label:listInfo}); } and the custom sorter: private function sortNumeric(obj1:Object, obj2:Object):int Any help would be appreciated!! Thanks, Adrian
Re: [flexcoders] How to access ADG mx_internal _dropData values: Was -- Identifying which node is the drop target on Grouped ADG
Thanks Alex...this is close but not going to work as is...it provides the drop index relative to the currently displayed ADG...so if the first 2 nodes are closed and the 3 is expanded and the row is dropped into the second position of the 3rd node, then the index is 4, which then leaves me still clueless on how to identify the node I am in. In looking through all of the possible datapoints of the ADG, I've found what I am looking for but it is in the internal _dropData area...and I haven't found any good flex 3 examples out there on how to access the internal namespace for the ADGthere's a lot of flex 2 stuff for plenty of other container and lists, but not the ADGand it looks like the import of the core.mx_internal is no longer needed so am wondering about the rest of the manipulations I've found... So long and short... How do I access the _dropData internal values? I've tried the following with error: var ns:Namespace = mx_internal; var dropData:Object = currentSubgroups::ns._dropData; var subgroupName:String = dropData.parent.GroupLabel; the error being that my currentSubgroups is the id for my ADG which conflicts with my associating it to a namespace. Keeping fingers crossed... Adrian Alex Harui wrote: I don't have time to see if ADG overrode this, but for regular DG, you could call calculateDropIndex *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Adrian Williams *Sent:* Monday, November 03, 2008 2:55 PM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] Identifying which node is the drop target on Grouped ADG Hi All, Having a fun one here...I have two ADG's that each have a list of individuals, in a hierarchical grouping collection and have drag drop enabled between the two ADG's. Basically the grouped ADG on the left shows people grouped by which project they are in...the one of the right shows people who haven't been added to any project. The user is allowed to drag a person from the unassigned ADG on the right and drop them into a specific group (node) on the left. The challenge I am having is identifying the drop target on the grouped collection. Have tried everything from looking at event.currentTarget to checking the underlying dataprovider for the ADG to even assigning specific listeners to the grouped ADG all to no avail. I can identify the information about the individual being moved into the groups via the dataprovider.selectedItem just fine. How in the world do I identify which node of the grouped collection the person is being dropped into as well as their drop index? Any help here is appreciated Adrian
Re: [flexcoders] SOLVED - How to access ADG mx_internal _dropData values: Was -- Identifying which node is the drop target on Grouped ADG
I finally figured it out Here's the solution use namespace mx_internal; var dropData:Object = currentSubgroups.mx_internal::_dropData; var subgroupName:String = dropData.parent.GroupLabel; This gives me the label of my parent node which I can then use to write the data back to my db. Wahoo! Adrian Adrian Williams wrote: Thanks Alex...this is close but not going to work as is...it provides the drop index relative to the currently displayed ADG...so if the first 2 nodes are closed and the 3 is expanded and the row is dropped into the second position of the 3rd node, then the index is 4, which then leaves me still clueless on how to identify the node I am in. In looking through all of the possible datapoints of the ADG, I've found what I am looking for but it is in the internal _dropData area...and I haven't found any good flex 3 examples out there on how to access the internal namespace for the ADGthere's a lot of flex 2 stuff for plenty of other container and lists, but not the ADGand it looks like the import of the core.mx_internal is no longer needed so am wondering about the rest of the manipulations I've found... So long and short... How do I access the _dropData internal values? I've tried the following with error: var ns:Namespace = mx_internal; var dropData:Object = currentSubgroups::ns._dropData; var subgroupName:String = dropData.parent.GroupLabel; the error being that my currentSubgroups is the id for my ADG which conflicts with my associating it to a namespace. Keeping fingers crossed... Adrian Alex Harui wrote: I don't have time to see if ADG overrode this, but for regular DG, you could call calculateDropIndex *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Adrian Williams *Sent:* Monday, November 03, 2008 2:55 PM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] Identifying which node is the drop target on Grouped ADG Hi All, Having a fun one here...I have two ADG's that each have a list of individuals, in a hierarchical grouping collection and have drag drop enabled between the two ADG's. Basically the grouped ADG on the left shows people grouped by which project they are in...the one of the right shows people who haven't been added to any project. The user is allowed to drag a person from the unassigned ADG on the right and drop them into a specific group (node) on the left. The challenge I am having is identifying the drop target on the grouped collection. Have tried everything from looking at event.currentTarget to checking the underlying dataprovider for the ADG to even assigning specific listeners to the grouped ADG all to no avail. I can identify the information about the individual being moved into the groups via the dataprovider.selectedItem just fine. How in the world do I identify which node of the grouped collection the person is being dropped into as well as their drop index? Any help here is appreciated Adrian
[flexcoders] Identifying which node is the drop target on Grouped ADG
Hi All, Having a fun one here...I have two ADG's that each have a list of individuals, in a hierarchical grouping collection and have drag drop enabled between the two ADG's. Basically the grouped ADG on the left shows people grouped by which project they are in...the one of the right shows people who haven't been added to any project. The user is allowed to drag a person from the unassigned ADG on the right and drop them into a specific group (node) on the left. The challenge I am having is identifying the drop target on the grouped collection. Have tried everything from looking at event.currentTarget to checking the underlying dataprovider for the ADG to even assigning specific listeners to the grouped ADG all to no avail. I can identify the information about the individual being moved into the groups via the dataprovider.selectedItem just fine. How in the world do I identify which node of the grouped collection the person is being dropped into as well as their drop index? Any help here is appreciated Adrian
Re: [flexcoders] comboBox selectedIndex
If you know what index (n) you want to set it to, comboBox.selectedIndex = n; Adrian Gökhan wrote: How can i change the selectedIndex of a comboBox ? The selectedIndex is get 0 in any case. isn't it writeable ?