[flexcoders] Strange type-coercion error message! Ideas?
*TypeError: Error #1034: Type Coercion failed: cannot convert Tools.dal.dataObjects::datainvestmentallocat...@2d28301 to Tools.dal.dataObjects.dataInvestmentAllocation.* This one has me a little stumped! The client's project is modular, and has a 'global' array of data objects. They access them a bit like this: *var dataIA:dataInvestmentAllocation = Application.application._dataCollection.DataObjectGet(investmentAllocation); * Every other object works in the same way without issues. In fact I'm fetching two data objects without issues directly before this. The object I'm getting is in the array of objects, is of type *dataInvestmentAllocation (excuse the casing!)* and there is only one in the array, yet the error message seems to append an instance id to the type (?!). The only difference I can see is that with this object, it was created and added to the collection in the previous module (but as I said, it's there in the array, and it's put there way before I try to access it in the next module) Can anyone shed any light on this?
Re: [flexcoders] Strange type-coercion error message! Ideas?
Ian, you are an absolute star! Thank you so much. I get the feeling I could have been going round in circles over this one. For anyone searching these threads, just to clarify, the solution was to add the second line of code as shown below: _mainModuleLoader = new NoviaModuleLoader(); _mainModuleLoader.applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain); Cheers, Neil On Wed, Aug 12, 2009 at 9:54 AM, Ian Thomas i...@eirias.net wrote: Looks like your objects belong to different ApplicationDomains. By which I mean - object 1 is created from a class called Tools.dal.dataObjects.dataInvestmentAllocation defined by module 1, and object 2 is created from a class called Tools.dal.dataObjects.dataInvestmentAllocation defined by module 2. As far as Flex knows, they are _different classes_, because they are defined in different ApplicationDomains. To fix this, make sure your module loading code passes ApplicationDomain.currentDomain, so the modules all share the same definition space. Hope that helps, Ian On Wed, Aug 12, 2009 at 9:49 AM, nwebbneilw...@gmail.comneilwebb%40gmail.com wrote: TypeError: Error #1034: Type Coercion failed: cannot convert Tools.dal.dataObjects::datainvestmentallocat...@2d28301 to Tools.dal.dataObjects.dataInvestmentAllocation. This one has me a little stumped! The client's project is modular, and has a 'global' array of data objects. They access them a bit like this: var dataIA:dataInvestmentAllocation = Application.application._dataCollection.DataObjectGet(investmentAllocation); Every other object works in the same way without issues. In fact I'm fetching two data objects without issues directly before this. The object I'm getting is in the array of objects, is of type dataInvestmentAllocation (excuse the casing!) and there is only one in the array, yet the error message seems to append an instance id to the type (?!). The only difference I can see is that with this object, it was created and added to the collection in the previous module (but as I said, it's there in the array, and it's put there way before I try to access it in the next module) Can anyone shed any light on this?
[flexcoders] SDK 3.3 - Design View not working where it used to
Hi, I've just set the SDK for an existing project to 3.3 (the project was created using 3.0). The app is modular and the views/modules extend *XModule*, which itself extends *mx.modules.Module*. When I was using the 3.0 SDK I could use Design View, but now when I try to switch to Design View I get the message *The component is based on XModule, which is not a visual component. Switch to source mode to edit it.* Is this a bug? ... or perhaps I haven't updated the SDK properly (though everything is compiling fine). Has anyone else experienced this?
[flexcoders] StackTraces Log
Hi, just had an issue where an application would run on any machine with the debug player installed, but would completely fail to load on any machine with the non-debug player. The issue us that there is a Logger singleton class which would find out the name of the calling class by throwing a stack-trace, so you can do something like this: *Logger.error(some message); * - then the Logger class would throw an error, get the stack trace, work out the name of the calling class and use it like so: *Log.getLogger( classNameExtractedFromStackTrace ).error(some message); * In non-debug players the stackTrace always appears to be null (guess this makes sense), but that was supposedly okay because if a name couldn't be found it was returning an empty string instead: However, the problem appears to be that getLogger is really picky about what it receives as the category argument. For example : Log.getLogger().info(message); //This causes the Flex app to keel over completely Log.getLogger(-).info(message); //This doesn't, and the Flex app works fine. The Flex docs suggest manually putting the name of each class in as the category String, but a really don't like that idea, and I was wondering how any of you work with Log.getLogger? With the aim of doing as little refactoring as possible at this point in time I'm thinking of changing the logging here so that it works like this: *Logger.info(message, this);* //pass in a ref to the calling class - (bah) ...which calls the Logger method info like so *public static function info(message:String, callee:Object=null):void //*null so that we can swap things over at our own pace *{ Log.getLogger(getNameFromCallee(callee)).info(message); }* Then use describeType to get the name (and replacing any characters which would cause issues): *private static function getNameFromCallee(callee:Object):String { var name:String = (callee == null) ? - : describeType(callee)@base.tostring(); if(name != null) { name = name.split(::).join(.); //I'm sure I may need to replace other chars as well - eg name = name.split(/).join(.); } else { name = -; } return name; }* Suggestions welcomed.
Re: [flexcoders] What are the chances Flex could be causing this?
Thanks Peter, 3 or 4 out of 10 are failing each time. All SWFs are calling back to the same location of a dev server. Unfortunately testing in Firefox is out right now - they are using a dummy payload (sent through using external interface), which isn't coming through in FF - I need to brush up on my JavaScript before I can get it working. On Wed, Mar 18, 2009 at 6:53 PM, Peter Farland pfarl...@adobe.com wrote: I would have thought that if you were hitting the maximum connections per host limitation then your requests would just queue and take longer to respond. Out of curiosity, how many fail and how many return data? Does the number change? Are the 10 SWFs calling back to the same dev server hosting the SWFs, or are they hitting a different URL? If they are hitting a different URL, can you possibly host your swf on the remote URL and try again (ensuring that the URL used to load the SWF has exactly the same host name as the service being contacted)? You could try testing your theory by modifying the registry to allow IE to make more requests simultaneously, see: http://support.microsoft.com/kb/282402 You could also try Firefox for comparison? Pete *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On Behalf Of *nwebb *Sent:* Wednesday, March 18, 2009 2:32 PM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] What are the chances Flex could be causing this? Hi, we've got a webservice with about 10 methods. When the application starts up it calls about 6 of them in quick succession (I'm currently chaining those calls). If I upload the SWF to our dev environment, create a tab-group in IE (10 tabs in total), with each tab loading the swf, I can load 10 instances of the application similtaneously. When I do that I'm seeing that several instances of the app are throwing errors like this: 18:06:08.273 | [ERROR] | mx.messaging.Producer | 'B8ED2C1F-ABBE-DB29-3DB4-1AC289775CF2' producer fault for 'F87115A3-7C5D-2F13-2EA0-1AC2ED13E733'.18:06:08.304 | [ERROR] | Tools.business.AbstractRPCConsumer.fault | faultCode:Server.Error.Request faultString:'HTTP request error' faultDetail:'Error: [IOErrorEvent type=ioError bubbles=false cancelable=false eventPhase=2 text=Error #2032: Stream Error. URL: http://dev- I'm pretty sure this is a server-side issue but want to make absolutely sure. The server logs in place don't show any errors (but I'm just a front-end guy looking at some custom error logs - I could easily be missing something!) - many of the Flex calls are getting rejected. Or could this be a red herring? Perhaps the browser is imposing a limits on the number of connections opened and I can't test things this way. If anyone has thoughts on whether I could be doing anything weird on the front-end to cause this please let me know. Thanks.
Re: [flexcoders] What are the chances Flex could be causing this?
Thanks Jonathon, I'll get the guys to do that - much appreciated. On Wed, Mar 18, 2009 at 7:17 PM, Jonathon Stierman jonat...@wolfmotell.comwrote: You could be hitting your servers’ (IIS, Apache) maximum number of connections – which means your application (and thus your custom logs) wouldn’t even be run. The server would just eat the requests and send back a 500 level HTTP response. Check your servers’ error logs, and see if anything appears in there. Jonathon *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On Behalf Of *nwebb *Sent:* Wednesday, March 18, 2009 1:32 PM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] What are the chances Flex could be causing this? Hi, we've got a webservice with about 10 methods. When the application starts up it calls about 6 of them in quick succession (I'm currently chaining those calls). If I upload the SWF to our dev environment, create a tab-group in IE (10 tabs in total), with each tab loading the swf, I can load 10 instances of the application similtaneously. When I do that I'm seeing that several instances of the app are throwing errors like this: 18:06:08.273 | [ERROR] | mx.messaging.Producer | 'B8ED2C1F-ABBE-DB29-3DB4-1AC289775CF2' producer fault for 'F87115A3-7C5D-2F13-2EA0-1AC2ED13E733'.18:06:08.304 | [ERROR] | Tools.business.AbstractRPCConsumer.fault | faultCode:Server.Error.Request faultString:'HTTP request error' faultDetail:'Error: [IOErrorEvent type=ioError bubbles=false cancelable=false eventPhase=2 text=Error #2032: Stream Error. URL: http://dev- I'm pretty sure this is a server-side issue but want to make absolutely sure. The server logs in place don't show any errors (but I'm just a front-end guy looking at some custom error logs - I could easily be missing something!) - many of the Flex calls are getting rejected. Or could this be a red herring? Perhaps the browser is imposing a limits on the number of connections opened and I can't test things this way. If anyone has thoughts on whether I could be doing anything weird on the front-end to cause this please let me know. Thanks.
Re: [flexcoders] Re: 1044 Compile time error - help?
Hi, I'm using 3.0 I deleted the build directories and did a Project - Clean if I remember correctly. On Wed, Mar 18, 2009 at 5:21 PM, park96 sang.p...@gmail.com wrote: Hi there, I'm having the same problems but even when reverting the corelib to be v 0.90 I'm still encountering the same problems. Which version of the flex sdk are you using and how did you clear any cached swcs from the flex builder build directory? Thanks in advance for any thoughts or helpful hints. s.park --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, nwebb neilw...@... wrote: Thanks Joesph. Yes, the root tag is Application. Turns out it was a problem with the version of ascorelib I was using. Once I reverted to V 0.90 the problem went away. I've not looked in to it further yet as I'm on a 3 week contract with a very strict deadline (hence ++relief at getting it resoved!), but very curious that I should apparently get such an error simply from plonking the wrong version of a library in to the libs folder. Doesn't make sense, so I am keen to look in to it further. On Fri, Nov 14, 2008 at 8:02 AM, Joseph Balderson n...@... wrote: Your root application file needs to be an Application class. If you need a proxy root component, build a custom MXML component based on Canvas and place it inside the Application container. __ Joseph Balderson, Flex Flash Platform Developer | joeflash.ca Author, Professional Flex 3 | http://tinyurl.com/5qbqlk nwebb wrote: Hello, My first day working for a client on an existing project. Checked project out of SVN, but will not compile. I get a series of 1044 errors like this one: *1044: Interface method addChlidBridge in namespace mx.managers:ISystemManager is not implemented by class _ToolsBase_mx_managers_SystemManager.* All errors are to do with ToolsBase (the main application file) not implementing the ISystemManager interface. ToolsBase extends Application. I've tried various things ... I've commented out almost all of the code and checked the project settings and now I'm running out of options. Hoping someone may possibly be able to make a suggestion or two? Cheers
[flexcoders] What are the chances Flex could be causing this?
Hi, we've got a webservice with about 10 methods. When the application starts up it calls about 6 of them in quick succession (I'm currently chaining those calls). If I upload the SWF to our dev environment, create a tab-group in IE (10 tabs in total), with each tab loading the swf, I can load 10 instances of the application similtaneously. When I do that I'm seeing that several instances of the app are throwing errors like this: 18:06:08.273 | [ERROR] | mx.messaging.Producer | 'B8ED2C1F-ABBE-DB29-3DB4-1AC289775CF2' producer fault for 'F87115A3-7C5D-2F13-2EA0-1AC2ED13E733'.18:06:08.304 | [ERROR] | Tools.business.AbstractRPCConsumer.fault | faultCode:Server.Error.Request faultString:'HTTP request error' faultDetail:'Error: [IOErrorEvent type=ioError bubbles=false cancelable=false eventPhase=2 text=Error #2032: Stream Error. URL: http://dev- I'm pretty sure this is a server-side issue but want to make absolutely sure. The server logs in place don't show any errors (but I'm just a front-end guy looking at some custom error logs - I could easily be missing something!) - many of the Flex calls are getting rejected. Or could this be a red herring? Perhaps the browser is imposing a limits on the number of connections opened and I can't test things this way. If anyone has thoughts on whether I could be doing anything weird on the front-end to cause this please let me know. Thanks.
Re: [flexcoders] Flex RAM memory use - (probably a question for the player engineers?)
Thanks - yes turned out to be that. Much appreciated! On Thu, Feb 26, 2009 at 4:35 PM, Alex Harui aha...@adobe.com wrote: Are you using SWFObject? http://groups.google.com/group/swfobject/browse_thread/thread/d94bc23037ddc714 Alex Harui Flex SDK Developer Adobe Systems Inc. http://www.adobe.com/ Blog: http://blogs.adobe.com/aharui *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On Behalf Of *Ashish Verma *Sent:* Thursday, February 26, 2009 5:27 AM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] Flex RAM memory use - (probably a question for the player engineers?) For the first problem I don't have clue but for second problem I can say that it's due to weird behaviour of Flash Garbage Collector. On Thu, Feb 26, 2009 at 2:48 PM, nwebb neilw...@gmail.com wrote: Hi, we're having 2 issues with memory in Flex: 1) Part way through our Flex application we open an external HTML page (3rd party page). The user selects items from this page and then closes the page the control is then returned to the Flex application. This 3rd party page is heavy in terms of memory, and that memory is never getting released once the page is closed. Is it at all possible that Flex is holding on to a handle to that page and if so is there any way to release it, or is this definitely not a Flex problem, and more a browser issues or issue with the external page as I expect? 2) The Flex app is one part of a much larger website. When we proceed past the Flex app (ie the user proceeds to a page where the app isn't embedded), again much of the memory Flex was using doesn't seem to be getting released. A browser issue? Needless to say IE seems to be much more of a memory hog, but we've been looking at this in both IE and FireFox. Any help much appreciated. Cheers, Neil
[flexcoders] Flex RAM memory use - (probably a question for the player engineers?)
Hi, we're having 2 issues with memory in Flex: 1) Part way through our Flex application we open an external HTML page (3rd party page). The user selects items from this page and then closes the page the control is then returned to the Flex application. This 3rd party page is heavy in terms of memory, and that memory is never getting released once the page is closed. Is it at all possible that Flex is holding on to a handle to that page and if so is there any way to release it, or is this definitely not a Flex problem, and more a browser issues or issue with the external page as I expect? 2) The Flex app is one part of a much larger website. When we proceed past the Flex app (ie the user proceeds to a page where the app isn't embedded), again much of the memory Flex was using doesn't seem to be getting released. A browser issue? Needless to say IE seems to be much more of a memory hog, but we've been looking at this in both IE and FireFox. Any help much appreciated. Cheers, Neil
Re: [flexcoders] very odd error
Thanks guys - I had managed to prevent the error by instantiating the object earlier in the cycle, which let me release my build on time, but that's obviously not a solution I am happy with (ah the joys of bug-fixing someone else's code) - I will follow up your suggestions today. On Fri, Jan 23, 2009 at 6:31 PM, Alex Harui aha...@adobe.com wrote: More likely, the shared code problem as described in the modules presentation on my blog. It can be the very same bits, but in a different appdomain and then you'll see problems like this. *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On Behalf Of *Maciek Sakrejda *Sent:* Friday, January 23, 2009 8:55 AM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] very odd error This can also happen when you link against a certain class, but the version of that class supplied at runtime has changed. E.g., 1. you build module foo.swf against application bar.swf with load-externs 2. your module uses class Baz from bar.swf 3. you rebuild bar.swf, changing Baz slightly 4. without rebuilding foo.swf, you run bar.swf (which loads foo.swf) When foo.swf attempts to use Baz, you'll get that error, because Baz does not look like what bar.swf thinks it looks like. (Disclaimer: I'm not sure if this exact sequence replicates this issue-- I'm extrapolating from my Java experience here--but I've run into this in Flex previously under similar circumstances) -- Maciek Sakrejda Truviso, Inc. http://www.truviso.com -Original Message- From: nwebb neilw...@gmail.com neilwebb%40gmail.com Reply-To: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com To: flexcoders flexcoders@yahoogroups.com flexcoders%40yahoogroups.com Subject: [flexcoders] very odd error Date: Fri, 23 Jan 2009 12:55:50 + Erm TypeError: Error #1034: Type Coercion failed: cannot convert Tools.dal.dataObjects::dataoutsourcedmod...@9f82091 to Tools.dal.dataObjects.dataOutsourcedModels Done all the basic checks (classname, package, constructor). There are no two objects of the same name . Anyone else seen Flex do something like this before?
Re: [flexcoders] itemRenderer data question (recycling)
Ah right - wasn't aware that repeaters didn't recycle - thanks. On Fri, Jan 23, 2009 at 6:34 PM, Alex Harui aha...@adobe.com wrote: If there aren't going to me more than a few dozen funds you can use repeater and avoid recycling. Otherwise, you'll have to live with recycling and add other data like when it changed last so you can determine whether to color it or not. *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On Behalf Of *nwebb *Sent:* Friday, January 23, 2009 12:54 AM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] itemRenderer data question (recycling) Yes sorry - I was scant with the details because I know people don't read long posts. I'm just using a standard array for the dp rather than an ArrayCollection and I am overwriting the array each time. Eventually I think that each bundle may have completely different items (they are actually funds - this is a financial app) , but in my test data I just have 4 funds. It was a question out of curiosity more than anything else. I was trying to knock something together quickly as this is just a prototype screen. at the moment (in the test data) I have the same 4 funds for each bundle. From the UIDs I get, it looks like the renderers get recycled and always in the same order - ie the renderer that was last used to display item4 is then used to display item1 the next time around. If you knew your List would never scroll, and you had the same four items, I wondered if there was a way to turn off recycling, or at least get the renderer in position1 to be in position1 again after a refresh. n.b. Currently I send in the old percent new percent, the override set data and determine the state using those values, so the uissue is solved, but curious to know if there is a way to get the same renderers being reused in the same order for a scenario like i described. On Thu, Jan 22, 2009 at 6:43 PM, Alex Harui aha...@adobe.com wrote: That didn't quite make sense. What is the dataprovider for the % list? Why would different bundles have data items with the same UID? Are you resetting the dataProvider when someone selects a different bundle? If the dp for the % list is a set of fields computed from the selected bundle, don't reset the dp and have those items in the dp dispatch change events. That should keep recycling to a minimum. If that doesn't work, try using a DataGrid with 1 column and headers turned off. It is possible that List has a different recycling algorithm than DG *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On Behalf Of *nwebb *Sent:* Thursday, January 22, 2009 4:14 AM *To:* flexcoders *Subject:* [flexcoders] itemRenderer data question (recycling) Hi, I have 2 List components on a page. The one on the left displays the names of some bundles - e.g. *Bundle 1* The one on the right displays the items in the selected bundle, plus a percentage value - e.g. *item1 - 10%* *item2 - 55%* *item3 - 61%* The items are the same for all bundles, but their percentages may change as the user selects different bundles. If that happens I want to highlight that itemRenderer. (eg when the percentage changes, highlight renderer) I looked at a similar example from Alex Harui - he compares a DataGrid's listData.UID to the previous UID (stored as a property on the renderer). If they match, he knows he has the same item and changes that value. I have implemented IDropInListItemRenderer (so I have access to the UID) but the renderer-recycling of the List means that even when the UID's match, the oldPercent value I stored doesn't actually match up to item being displayed - in other words, the renderer which previously displayed *item1 - 10%* may now be displaying *item3 - 61%* , so the percentage HAS changed, but that's because it's displaying a different item! Is my only option to send both the new% and old% in via the dataprovider, or is there another way to get around this issue? Cheers
Re: [flexcoders] Re: Navigational Design Patterns?
Johannes, does slide Slide work well with modules as this project is modular? On Fri, Jan 23, 2009 at 7:46 AM, Johannes Nel johannes@gmail.comwrote: kind of off topic now. i would actually look at slide, even for an existing app (if it uses viewstacks and states) for navigation. it makes life much much easier. Slide uri's map to paths inside a display tree so the url /app/state/stateb/statec tells you that you have set the selected child for 3 viewstacks (thus making complex nav easier). also these uri's are really xpath statements so /app/*/*/state will only filter on the last one. you can even use xpath functions to make decisions on your navigation. this is a gross simplification, but ping me offline, i have a plugin which generates the slide app structure for you. back to navigation. i also have a simple plugin which generates my nav commands for me (slightly slide specific, but easily modifiable), either with mememto or sans, which could help you in this. I use JET to generate code a lot at the moment (i need an abstract factory, i need a set of commands, i need an enum etc etc) which has kind of removed me from the doldrums of implenting paterns to more thinking about the application as a whole. of course generation is not a answer to all (i refuse to generate actual implementation for long and arguable reasons). On Thu, Jan 22, 2009 at 2:18 PM, nwebb neilw...@gmail.com wrote: Thanks v much Johannes - Command was the only pattern I had considered thus far because I know it's often used for history/undo functionality - interested to look at memento in conjunction. Useful info as always :) On Thu, Jan 22, 2009 at 12:08 PM, Johannes Nel johannes@gmail.comwrote: Depending on the application type, the command pattern works quite nicely with navigation. You can then also implement a memento more easily and have the command support an undo function allowing you to go back and forth. we use slide (obviously) and the uri based navigation (based on states) work really well with this approach as well. On Thu, Jan 22, 2009 at 11:02 AM, nwebb neilw...@gmail.com wrote: Thanks guys for all your responses so far. To clarify, it is a multi-step process (with a few possible branches). Tracy/Jim, for the most part I agree. Ideal if I was given the scope to re-design the application, but I've just been handed the task of re-writing the step-process logic. The client is very happy with what they have, so it is a decision that is out of my hands. I am mainly looking for suggestions for (code) design patterns/micro-architectures out there that handle this sort of thing - not a fully-fledged framework. I did like the look of the book Haykel recommended, even though it was not code-based so I may well purchase it too - thanks. Cheers, Neil On Wed, Jan 21, 2009 at 9:02 PM, jim.abbott45 jim.abbot...@yahoo.comwrote: FWIW, I have to concur with the advice that Tracy gave you and I can also recommend--HIGHLY--the content at the link that Haykel gave you. In short, use Wizard-style navigation for infrequent/complex/inherently multi-step tasks. For the rest of (usually, most of) your tasks, use a more fluid navigational mechanism, such as Hub-and-Spoke. --Jim --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, nwebb neilw...@... wrote: Hi, We have a modular Flex project. Each screen has back and next buttons. There are various routes through the application and I'm about to re-write the logic which determines where the buttons take the user when they are pressed (what is already in place is overly complex). I'm guessing that there are fairly established methods for achieving this and would be interested to see what exists, rather than roll out a bespoke solution. Can anyone point me in the direction of a good resource? Cheers, Neil -- j:pn \\no comment -- j:pn \\no comment
Re: [flexcoders] Re: itemRenderer data question (recycling)
Yes, doing that already - thanks :) On Thu, Jan 22, 2009 at 4:45 PM, ross_w_henderson pub...@rwebdev.comwrote: Hi. Are you updating super.data in your set data function? If you aren't, give this a try: public override function set data(value:Object):void { super.data = value; if(value == null) return; . }
Re: [flexcoders] itemRenderer data question (recycling)
At the moment not sure - my test data only has the same 4 items in, but I think it's going to vary. On Thu, Jan 22, 2009 at 6:34 PM, Tracy Spratt tspr...@lariatinc.com wrote: How many items? This might be easier with Repeater. Tracy Spratt Lariat Services Flex development bandwidth available -- *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On Behalf Of *nwebb *Sent:* Thursday, January 22, 2009 7:14 AM *To:* flexcoders *Subject:* [flexcoders] itemRenderer data question (recycling) Hi, I have 2 List components on a page. The one on the left displays the names of some bundles - e.g. *Bundle 1* The one on the right displays the items in the selected bundle, plus a percentage value - e.g. *item1 - 10%* *item2 - 55%* *item3 - 61%* The items are the same for all bundles, but their percentages may change as the user selects different bundles. If that happens I want to highlight that itemRenderer. (eg when the percentage changes, highlight renderer) I looked at a similar example from Alex Harui - he compares a DataGrid's listData.UID to the previous UID (stored as a property on the renderer). If they match, he knows he has the same item and changes that value. I have implemented IDropInListItemRenderer (so I have access to the UID) but the renderer-recycling of the List means that even when the UID's match, the oldPercent value I stored doesn't actually match up to item being displayed - in other words, the renderer which previously displayed *item1 - 10%* may now be displaying *item3 - 61%* , so the percentage HAS changed, but that's because it's displaying a different item! Is my only option to send both the new% and old% in via the dataprovider, or is there another way to get around this issue? Cheers
Re: [flexcoders] itemRenderer data question (recycling)
Yes sorry - I was scant with the details because I know people don't read long posts. I'm just using a standard array for the dp rather than an ArrayCollection and I am overwriting the array each time. Eventually I think that each bundle may have completely different items (they are actually funds - this is a financial app) , but in my test data I just have 4 funds. It was a question out of curiosity more than anything else. I was trying to knock something together quickly as this is just a prototype screen. at the moment (in the test data) I have the same 4 funds for each bundle. From the UIDs I get, it looks like the renderers get recycled and always in the same order - ie the renderer that was last used to display item4 is then used to display item1 the next time around. If you knew your List would never scroll, and you had the same four items, I wondered if there was a way to turn off recycling, or at least get the renderer in position1 to be in position1 again after a refresh. n.b. Currently I send in the old percent new percent, the override set data and determine the state using those values, so the uissue is solved, but curious to know if there is a way to get the same renderers being reused in the same order for a scenario like i described. On Thu, Jan 22, 2009 at 6:43 PM, Alex Harui aha...@adobe.com wrote: That didn't quite make sense. What is the dataprovider for the % list? Why would different bundles have data items with the same UID? Are you resetting the dataProvider when someone selects a different bundle? If the dp for the % list is a set of fields computed from the selected bundle, don't reset the dp and have those items in the dp dispatch change events. That should keep recycling to a minimum. If that doesn't work, try using a DataGrid with 1 column and headers turned off. It is possible that List has a different recycling algorithm than DG *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On Behalf Of *nwebb *Sent:* Thursday, January 22, 2009 4:14 AM *To:* flexcoders *Subject:* [flexcoders] itemRenderer data question (recycling) Hi, I have 2 List components on a page. The one on the left displays the names of some bundles - e.g. *Bundle 1* The one on the right displays the items in the selected bundle, plus a percentage value - e.g. *item1 - 10%* *item2 - 55%* *item3 - 61%* The items are the same for all bundles, but their percentages may change as the user selects different bundles. If that happens I want to highlight that itemRenderer. (eg when the percentage changes, highlight renderer) I looked at a similar example from Alex Harui - he compares a DataGrid's listData.UID to the previous UID (stored as a property on the renderer). If they match, he knows he has the same item and changes that value. I have implemented IDropInListItemRenderer (so I have access to the UID) but the renderer-recycling of the List means that even when the UID's match, the oldPercent value I stored doesn't actually match up to item being displayed - in other words, the renderer which previously displayed *item1 - 10%* may now be displaying *item3 - 61%* , so the percentage HAS changed, but that's because it's displaying a different item! Is my only option to send both the new% and old% in via the dataprovider, or is there another way to get around this issue? Cheers
Re: [flexcoders] Re: itemRenderer data question (recycling)
Nice idea - thanks :) Could you use a static Dictionary on the itemRenderer class, with the key being the UID? That way you can get the old% value regardless of whether you're in the same renderer instance?
[flexcoders] very odd error
Erm TypeError: Error #1034: Type Coercion failed: cannot convert Tools.dal.dataObjects::dataoutsourcedmod...@9f82091 to Tools.dal.dataObjects.dataOutsourcedModels Done all the basic checks (classname, package, constructor). There are no two objects of the same name . Anyone else seen Flex do something like this before?
Re: [flexcoders] Re: Navigational Design Patterns?
Thanks guys for all your responses so far. To clarify, it is a multi-step process (with a few possible branches). Tracy/Jim, for the most part I agree. Ideal if I was given the scope to re-design the application, but I've just been handed the task of re-writing the step-process logic. The client is very happy with what they have, so it is a decision that is out of my hands. I am mainly looking for suggestions for (code) design patterns/micro-architectures out there that handle this sort of thing - not a fully-fledged framework. I did like the look of the book Haykel recommended, even though it was not code-based so I may well purchase it too - thanks. Cheers, Neil On Wed, Jan 21, 2009 at 9:02 PM, jim.abbott45 jim.abbot...@yahoo.comwrote: FWIW, I have to concur with the advice that Tracy gave you and I can also recommend--HIGHLY--the content at the link that Haykel gave you. In short, use Wizard-style navigation for infrequent/complex/inherently multi-step tasks. For the rest of (usually, most of) your tasks, use a more fluid navigational mechanism, such as Hub-and-Spoke. --Jim --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, nwebb neilw...@... wrote: Hi, We have a modular Flex project. Each screen has back and next buttons. There are various routes through the application and I'm about to re-write the logic which determines where the buttons take the user when they are pressed (what is already in place is overly complex). I'm guessing that there are fairly established methods for achieving this and would be interested to see what exists, rather than roll out a bespoke solution. Can anyone point me in the direction of a good resource? Cheers, Neil
[flexcoders] itemRenderer data question (recycling)
Hi, I have 2 List components on a page. The one on the left displays the names of some bundles - e.g. *Bundle 1* The one on the right displays the items in the selected bundle, plus a percentage value - e.g. *item1 - 10%* *item2 - 55%* *item3 - 61%* The items are the same for all bundles, but their percentages may change as the user selects different bundles. If that happens I want to highlight that itemRenderer. (eg when the percentage changes, highlight renderer) I looked at a similar example from Alex Harui - he compares a DataGrid's listData.UID to the previous UID (stored as a property on the renderer). If they match, he knows he has the same item and changes that value. I have implemented IDropInListItemRenderer (so I have access to the UID) but the renderer-recycling of the List means that even when the UID's match, the oldPercent value I stored doesn't actually match up to item being displayed - in other words, the renderer which previously displayed *item1 - 10%* may now be displaying *item3 - 61%* , so the percentage HAS changed, but that's because it's displaying a different item! Is my only option to send both the new% and old% in via the dataprovider, or is there another way to get around this issue? Cheers
Re: [flexcoders] Re: Navigational Design Patterns?
Thanks v much Johannes - Command was the only pattern I had considered thus far because I know it's often used for history/undo functionality - interested to look at memento in conjunction. Useful info as always :) On Thu, Jan 22, 2009 at 12:08 PM, Johannes Nel johannes@gmail.comwrote: Depending on the application type, the command pattern works quite nicely with navigation. You can then also implement a memento more easily and have the command support an undo function allowing you to go back and forth. we use slide (obviously) and the uri based navigation (based on states) work really well with this approach as well. On Thu, Jan 22, 2009 at 11:02 AM, nwebb neilw...@gmail.com wrote: Thanks guys for all your responses so far. To clarify, it is a multi-step process (with a few possible branches). Tracy/Jim, for the most part I agree. Ideal if I was given the scope to re-design the application, but I've just been handed the task of re-writing the step-process logic. The client is very happy with what they have, so it is a decision that is out of my hands. I am mainly looking for suggestions for (code) design patterns/micro-architectures out there that handle this sort of thing - not a fully-fledged framework. I did like the look of the book Haykel recommended, even though it was not code-based so I may well purchase it too - thanks. Cheers, Neil On Wed, Jan 21, 2009 at 9:02 PM, jim.abbott45 jim.abbot...@yahoo.comwrote: FWIW, I have to concur with the advice that Tracy gave you and I can also recommend--HIGHLY--the content at the link that Haykel gave you. In short, use Wizard-style navigation for infrequent/complex/inherently multi-step tasks. For the rest of (usually, most of) your tasks, use a more fluid navigational mechanism, such as Hub-and-Spoke. --Jim --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, nwebb neilw...@... wrote: Hi, We have a modular Flex project. Each screen has back and next buttons. There are various routes through the application and I'm about to re-write the logic which determines where the buttons take the user when they are pressed (what is already in place is overly complex). I'm guessing that there are fairly established methods for achieving this and would be interested to see what exists, rather than roll out a bespoke solution. Can anyone point me in the direction of a good resource? Cheers, Neil -- j:pn \\no comment
[flexcoders] Navigational Design Patterns?
Hi, We have a modular Flex project. Each screen has back and next buttons. There are various routes through the application and I'm about to re-write the logic which determines where the buttons take the user when they are pressed (what is already in place is overly complex). I'm guessing that there are fairly established methods for achieving this and would be interested to see what exists, rather than roll out a bespoke solution. Can anyone point me in the direction of a good resource? Cheers, Neil
Re: [flexcoders] 1044 Compile time error - help?
Thanks Joesph. Yes, the root tag is Application. Turns out it was a problem with the version of ascorelib I was using. Once I reverted to V 0.90 the problem went away. I've not looked in to it further yet as I'm on a 3 week contract with a very strict deadline (hence ++relief at getting it resoved!), but very curious that I should apparently get such an error simply from plonking the wrong version of a library in to the libs folder. Doesn't make sense, so I am keen to look in to it further. On Fri, Nov 14, 2008 at 8:02 AM, Joseph Balderson [EMAIL PROTECTED] wrote: Your root application file needs to be an Application class. If you need a proxy root component, build a custom MXML component based on Canvas and place it inside the Application container. __ Joseph Balderson, Flex Flash Platform Developer | joeflash.ca Author, Professional Flex 3 | http://tinyurl.com/5qbqlk nwebb wrote: Hello, My first day working for a client on an existing project. Checked project out of SVN, but will not compile. I get a series of 1044 errors like this one: *1044: Interface method addChlidBridge in namespace mx.managers:ISystemManager is not implemented by class _ToolsBase_mx_managers_SystemManager.* All errors are to do with ToolsBase (the main application file) not implementing the ISystemManager interface. ToolsBase extends Application. I've tried various things ... I've commented out almost all of the code and checked the project settings and now I'm running out of options. Hoping someone may possibly be able to make a suggestion or two? Cheers
[flexcoders] 1044 Compile time error - help?
Hello, My first day working for a client on an existing project. Checked project out of SVN, but will not compile. I get a series of 1044 errors like this one: *1044: Interface method addChlidBridge in namespace mx.managers:ISystemManager is not implemented by class _ToolsBase_mx_managers_SystemManager.* All errors are to do with ToolsBase (the main application file) not implementing the ISystemManager interface. ToolsBase extends Application. I've tried various things ... I've commented out almost all of the code and checked the project settings and now I'm running out of options. Hoping someone may possibly be able to make a suggestion or two? Cheers
Re: [flexcoders] Eh. How does this still work?!
Thanks. Much appreciated. On Mon, Sep 8, 2008 at 8:33 AM, Haykel BEN JEMIA [EMAIL PROTECTED] wrote: Hi, in my understanding, FB only uses webroot for the deployment of your application so that you don't need to copy the files to the server after each compilation. Is it what you are doing now? For the localhost question, if the uri of the endpoint doen not contain the server address, then flex uses the one from which it is being loaded. Bye. On Sun, Sep 7, 2008 at 10:30 PM, nwebb [EMAIL PROTECTED] wrote: Hi, I skipped a step when setting up a flex-remoting (amfphp) project, but it still works. I didn't set up the Flex project to use PHP when I created it, and so didn't define the webroot or the root url at all. I added in the services-config file (see code at the bottom of this email) and I added the following additional compiler argument: -services services-config.xml and that was all I needed to get things working. Does anyone know if amfphp automatically assume the uri in the config file will start with http://localhost/ when not otherwise defined? The config file I used defines gateway.php as being in the amfphp folder in the webroot, but how does the Flex project know the location of my webroot?! (which by the way is C:\xampp\htdocs) Cheers. // SERVICES-CONFIG CODE ?xml version=1.0 encoding=UTF-8? services-config services service id=amfphp-flashremoting-service class=flex.messaging.services.RemotingService messageTypes=flex.messaging.messages.RemotingMessage destination id=amfphp channels channel ref=my-amfphp/ /channels properties source*/source /properties /destination /service /services channels channel-definition id=my-amfphp class=mx.messaging.channels.AMFChannel endpoint uri=/amfphp/gateway.php class=flex.messaging.endpoints.AMFEndpoint/ /channel-definition /channels /services-config
[flexcoders] DTOs methods?
Hi, I have a Data Transfer Object which I use to encapsulate values from a search-filter in my application - i.e. the user can filter search-results by project, employee, month, year etc. I am using remoting and passing this as a typed object to ColdFusion. *The short version of my question*: I want to add a method to my FilterDto, allowing me to reset (some) properties, is it okay to add such a method (will CF simply ignore it), or should DTOs always be devoid of methods. Can adding a method cause problems when remoting? -- *( ... yes I know I could use binding but...):* When the user presses Search I call a method which updates the filterDto with the current values of the filter-components. I didn't want to use binding here, simply for performance reasons, as this is fairly simple, so rather than bind each visual component to the corresponding Dto property I just call a method which updates the properties. Now I have an either-or situation - if the user searches by OrderId I need to clear/reset the other properties, else if they search by any other property they can't also search by a specific OrderId, so I could do with a method (I can't just instantiate a new instance of the DTO as that will clear/reset ALL properties) This functionality feels like it should be a method that belongs in the DTO class. Is it okay to create such methods in DTOs?
Re: [flexcoders] DTOs methods?
Thanks :) On Tue, Sep 9, 2008 at 2:16 PM, Dimitrios Gianninas [EMAIL PROTECTED] wrote: If you have a simple method called reset() on your DTO, it wont affect how it does back to the server. *Dimitrios Gianninas* *RIA Developer Team Lead* *Optimal Payments Inc.* -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *nwebb *Sent:* Tuesday, September 09, 2008 5:46 AM *To:* flexcoders *Subject:* [flexcoders] DTOs methods? Hi, I have a Data Transfer Object which I use to encapsulate values from a search-filter in my application - i.e. the user can filter search-results by project, employee, month, year etc. I am using remoting and passing this as a typed object to ColdFusion. *The short version of my question*: I want to add a method to my FilterDto, allowing me to reset (some) properties, is it okay to add such a method (will CF simply ignore it), or should DTOs always be devoid of methods. Can adding a method cause problems when remoting? -- *( ... yes I know I could use binding but...):* When the user presses Search I call a method which updates the filterDto with the current values of the filter-components. I didn't want to use binding here, simply for performance reasons, as this is fairly simple, so rather than bind each visual component to the corresponding Dto property I just call a method which updates the properties. Now I have an either-or situation - if the user searches by OrderId I need to clear/reset the other properties, else if they search by any other property they can't also search by a specific OrderId, so I could do with a method (I can't just instantiate a new instance of the DTO as that will clear/reset ALL properties) This functionality feels like it should be a method that belongs in the DTO class. Is it okay to create such methods in DTOs? *AVIS IMPORTANT* *WARNING* Ce message électronique et ses pièces jointes peuvent contenir des renseignements confidentiels, exclusifs ou légalement privilégiés destinés au seul usage du destinataire visé. L'expéditeur original ne renonce à aucun privilège ou à aucun autre droit si le présent message a été transmis involontairement ou s'il est retransmis sans son autorisation. Si vous n'êtes pas le destinataire visé du présent message ou si vous l'avez reçu par erreur, veuillez cesser immédiatement de le lire et le supprimer, ainsi que toutes ses pièces jointes, de votre système. La lecture, la distribution, la copie ou tout autre usage du présent message ou de ses pièces jointes par des personnes autres que le destinataire visé ne sont pas autorisés et pourraient être illégaux. Si vous avez reçu ce courrier électronique par erreur, veuillez en aviser l'expéditeur. This electronic message and its attachments may contain confidential, proprietary or legally privileged information, which is solely for the use of the intended recipient. No privilege or other rights are waived by any unintended transmission or unauthorized retransmission of this message. If you are not the intended recipient of this message, or if you have received it in error, you should immediately stop reading this message and delete it and all attachments from your system. The reading, distribution, copying or other use of this message or its attachments by unintended recipients is unauthorized and may be unlawful. If you have received this e-mail in error, please notify the sender.
[flexcoders] FB PHPEclipse - suggestions?
Hi, I'm setting up a local development environment to play around with a Flash-Remoting project. I'm using Flex PHP, therefore I'm using the FlexBuilder plugin and the PHPEclipse plugin, both within a single Eclipse installation. My Eclipse workspace is set to be: C:\xampp\htdocs My php file needs to be 'published' to C:\xampp\htdocs\amfphp\services, yet it's actual location is C:\xampp\htdocs\phpProjectName. I don't want to have to keep copying it over manually to the correct folder each time I make a change. Is ANT the solution or am I missing a better way to set things up? Thanks.
[flexcoders] Re: FB PHPEclipse - suggestions?
To answer my own question - I solved it by using linked folders which allows me to create an Eclipse project which actually points to amfphp/services. On Sun, Sep 7, 2008 at 4:18 PM, nwebb [EMAIL PROTECTED] wrote: Hi, I'm setting up a local development environment to play around with a Flash-Remoting project. I'm using Flex PHP, therefore I'm using the FlexBuilder plugin and the PHPEclipse plugin, both within a single Eclipse installation. My Eclipse workspace is set to be: C:\xampp\htdocs My php file needs to be 'published' to C:\xampp\htdocs\amfphp\services, yet it's actual location is C:\xampp\htdocs\phpProjectName. I don't want to have to keep copying it over manually to the correct folder each time I make a change. Is ANT the solution or am I missing a better way to set things up? Thanks.
[flexcoders] Eh. How does this still work?!
Hi, I skipped a step when setting up a flex-remoting (amfphp) project, but it still works. I didn't set up the Flex project to use PHP when I created it, and so didn't define the webroot or the root url at all. I added in the services-config file (see code at the bottom of this email) and I added the following additional compiler argument: -services services-config.xml and that was all I needed to get things working. Does anyone know if amfphp automatically assume the uri in the config file will start with http://localhost/ when not otherwise defined? The config file I used defines gateway.php as being in the amfphp folder in the webroot, but how does the Flex project know the location of my webroot?! (which by the way is C:\xampp\htdocs) Cheers. // SERVICES-CONFIG CODE ?xml version=1.0 encoding=UTF-8? services-config services service id=amfphp-flashremoting-service class=flex.messaging.services.RemotingService messageTypes=flex.messaging.messages.RemotingMessage destination id=amfphp channels channel ref=my-amfphp/ /channels properties source*/source /properties /destination /service /services channels channel-definition id=my-amfphp class=mx.messaging.channels.AMFChannel endpoint uri=/amfphp/gateway.php class=flex.messaging.endpoints.AMFEndpoint/ /channel-definition /channels /services-config
[flexcoders] Design Patters For Loading Data?
Hi, hoping for some help on this... * Problem*: I am making multiple asynchronous calls to the server and I want to ensure I have the data back from *all* the calls before calling method x. I don't want to daisy-chain the calls (i.e.having to wait until service#1 reurns data before calling service#2 and so on). I have a solution which will suffice* but I'm sure there must be a tried and tested way of handling this kind of scenario - perhaps a design pattern(?). --- * my current solution is to declare an ArrayCollection and listen to its CollectionEvent.COLLECTION_CHANGE event. In each onResult() method I set* itemsLoaded.addItem(true);* and similarly in each onFault() method I set *itemsLoaded.addItem(false);* Each time I add the boolean value to the collection, the change-event handler is called. Inside the change handler I check to see whether the collection length is equal to the number of results I'm expecting. If it is, I loop through the collection and check if all the values are true or not.
Re: [flexcoders] Design Patters For Loading Data?
Thanks all. I normally use Cairngorm but it's overkill for an application of this size. I will check out the UniversalMind extension though - sounds good. @Josh - looks cool. Not looking for a sequential loader, but still ... :) @Johannes - yes, an improvement, thanks Thanks for all the feedback. On Tue, Aug 12, 2008 at 4:55 PM, Sefi Ninio [EMAIL PROTECTED] wrote: I agree, Cairngorm is perfect for this, especially when using the UniversalMind Cairngorm extension. UM lets you define an array of remote calls (event-command pairs) which can be sequence or parallel execution, and once all the remote calls are finished, you get a notification. Sounds like exactly what you need. Lemme know if you need more details, I've spent some time making sense of how to use it. HTH Sefi On Tue, Aug 12, 2008 at 4:21 PM, DannyT [EMAIL PROTECTED] wrote: Very neat, but does this have a variant whereby these calls can be made at the same time? Looks like this (as the name suggests) daisy chains the calls firing one after the other rather than calling them all and monitoring all of the results and notifying when all are successfully called. Like the impelementation for subsequent result dependent calls though :) 2008/8/12 Josh McDonald [EMAIL PROTECTED] This is pretty ordinary, and I plan on re-vamping it, but we're planning on open sourcing most of this stuff soon, so you might as well have a look and you can use it as a base for something better: http://www.gfunk007.com/flex/ChainLoader.as Usage example: new ChainLoader(Application.application.spinner, begin).then( Application.application, showLoading).then( Singletons.services.returnCentreDao, getReturnCentre).thenOnSuccess( Singletons.services.vehiclesDao, getVehiclesPending).thenOnSuccess( Singletons.services.vehiclesDao, getVehiclesInStock).thenOnSuccess( Singletons.services.vehiclesDao, getVehiclesInRepair).thenOnSuccess( Singletons.services.tenderDao, getAllTenders).thenOnSuccess( this, selectDefaultTender).then( this, getTenderVehicles).thenOnSuccess( _pollTimer, start).then( this, selectReturnCentreCompleted).then( Application.application, hideLoading).then( Application.application.spinner, end).go(); Like I said, it's rough don't bother telling me the myriad ways it can be better, I know :) -Josh On Tue, Aug 12, 2008 at 9:46 PM, Simon Bailey [EMAIL PROTECTED]wrote: How about defining and array with all the method names and every time a method is returned it removes its method name from the array. The method to remove each item from the array would check the array length each times its called and when the array.length == 0 then call your method x? Cheers, Simon ** newtriks.com http://www.newtriks.com/ On 12 Aug 2008, at 12:37, nwebb wrote: Hi, hoping for some help on this... * Problem*: I am making multiple asynchronous calls to the server and I want to ensure I have the data back from *all* the calls before calling method x. I don't want to daisy-chain the calls (i.e.having to wait until service#1 reurns data before calling service#2 and so on). I have a solution which will suffice* but I'm sure there must be a tried and tested way of handling this kind of scenario - perhaps a design pattern(?). --- * my current solution is to declare an ArrayCollection and listen to its CollectionEvent.COLLECTION_CHANGE event. In each onResult() method I set* itemsLoaded.addItem(true);* and similarly in each onFault() method I set *itemsLoaded.addItem(false);* Each time I add the boolean value to the collection, the change-event handler is called. Inside the change handler I check to see whether the collection length is equal to the number of results I'm expecting. If it is, I loop through the collection and check if all the values are true or not. -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] -- http://danny-t.co.uk
[flexcoders] Loading Stuff In Order - Advice?
Hi, I have a small application. A single view is declared in the main *mxml *file. This view loads some [remote] data upon initialisation. I rejigged the application so that it loads in a config file first (this config file contains the url from which I should load the data). Initially the config file didn't finish loading in until after my view's * initialization* event had fired .. so the view attempted to load data but threw an error. To solve this I plumped for declaring my view in MXML, but changing its creationPolicy to none, then calling createComponentsFromDescriptors() once my config had loaded. It works fine. I also realise there are various other ways to solve this (e.g. I could call my view's init() method manually, or I could add the view using ActionScript both being done after the config file had loaded). I wanted to post because I'm curious to find out how other people have been handling situations like this, and what arguments for/against your own methods you have become aware of (mainly because I think it could make a really useful blog post). So if you can spare a moment, I would appreciate the feedback. For example, do you feel that it's unacceptable to make data requests from within a View, even in a small app, and if so what would you change? All that kind of stuff is useful :) Cheers, Neil p.s. I haven't really run in to this before because I usually don't make data calls from inside views (but rather in Commands). As this is a small application I wonder if setting up a FrontController would be overkill though.
Re: [flexcoders] Re: Anyone familiar with CF-Flex remoting?
Thanks to all who replied - good to know that it is actually possible. Sid, thanks for this example, should help us to resolve the issue :) On Fri, Jul 4, 2008 at 3:30 AM, Sid Maskit [EMAIL PROTECTED] wrote: This definitely works. Just did it using CFC's. In MXML: mx:RemoteObject id=dataManager endpoint=[URL to your AMF gateway here: e.g. http://domain.com/flex2gateway/]; destination=ColdFusion source=[path to your CFC here: e.g. folder.folder.file mx:method name=requestAddressChange result=requestAddressChange_result(event) fault=server_fault(event) / /mx:RemoteObject Inside script within same MXML: this.dataManager.requestAddressChange(this.address0.text, this.password.text); Within cfc on server: cfcomponent cffunction name=requestAddressChange output=false access=remote returntype=String cfargument name=email required=true type=String cfargument name=password required=true type=String !--- Access arguments like this: #arguments.password #arguments.email# --- /cffunction /cfcomponent You'd need to declare the arguments differently, I think as parameters within a cfm file, but it should still work. Hope that helps. Sid Maskit CraftySpace.com
Re: [flexcoders] Extending the PromptArrayCollection Class (brain freeze)
Thanks Alex. Yeah, currently I'm taking a similar approach, triggering a method when *model.suppliers* changes dataProvider={ CollectionUtils.convertToPromptArrayCollection(model.suppliers) } and that method is: public static function convertToPromptArrayCollection(value:ArrayCollection):PromptArrayCollection { return new PromptArrayCollection([{label:'[ all ]', data:-1}], value); } probably easiest that sounds like making the class support change notifications is perhaps not the easiest thing then :) Much appreciated. On Thu, Jul 3, 2008 at 6:02 PM, Alex Harui [EMAIL PROTECTED] wrote: It is probably easiest just to reset the CB's dp when the data is available. -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *nwebb *Sent:* Thursday, July 03, 2008 1:45 AM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] Extending the PromptArrayCollection Class (brain freeze) Hi, The Adobe technote provides a class for getting around the problem of having a re-selectable prompt for a combo box: ( http://kb.adobe.com/selfservice/viewContent.do?externalId=1fecccbasliceId=1 ) I've mainly been using it like this: mx:ComboBox id=supplierComp dataProvider={ new PromptArrayCollection ( [ {label:'[ all ]', data:-1} ], model.suppliers) }/ At the time of setting it, *model.suppliers* is still an empty ArrayCollection. When it gets updated I'd like my *supplierComp* ComboBox to update appropriately. I've been going round in circles. Could someone point me in the right direction?
[flexcoders] Extending the PromptArrayCollection Class (brain freeze)
Hi, The Adobe technote provides a class for getting around the problem of having a re-selectable prompt for a combo box: ( http://kb.adobe.com/selfservice/viewContent.do?externalId=1fecccbasliceId=1 ) I've mainly been using it like this: mx:ComboBox id=supplierComp dataProvider={ new PromptArrayCollection ( [ {label:'[ all ]', data:-1} ], model.suppliers) }/ At the time of setting it, *model.suppliers* is still an empty ArrayCollection. When it gets updated I'd like my *supplierComp* ComboBox to update appropriately. I've been going round in circles. Could someone point me in the right direction?
[flexcoders] Anyone familiar with CF-Flex remoting?
Hi, I'd like to pass 2 arguments to a remote method called returnOrders. Something like: //Flex var token:AsyncToken = ro.returnOrders(userId, filterObj); The first argument is a String called id and the second is an Object (see below for full code). The CF guy I'm working with says that if I just send a single object he can pull it apart and get to the individual properties, but when I send him two arguments, he can't break apart the object (excuse the terminology - his not mine) Any hints and tips much appreciated! Oh, and here is the AS3 filter DTO I'm using. package net.quadratek.po.dto { [Bindable] [RemoteClass(alias=qnet2.cfc.remote.purchaseOrder)] public class FilterDto { public var poId:String = ; public var supplierId:String = ; public var monthId:String = ; public var yearId:String = ; public var projectId:String = ; public var employeeId:String = ; public function FilterDto() { } } }
Re: [flexcoders] triggering a function (when an argument is a bindable value)?
Hi Joe, thanks. Yep, I considered that along with bindSetter, although I like to keep setters as free of logic (and other method calls) as possible - but I think that's the only way to do it using mxml. On Wed, Jun 25, 2008 at 10:48 PM, Joseph Balderson [EMAIL PROTECTED] wrote: What I'm looking for is the best way to trigger a method whenever a bindable value changes. Just make the destination property a setter method. __ Joseph Balderson, Flash Platform Developer | http://joeflash.ca nwebb wrote: Hi Joseph, thanks for the reply - no, the provided example was nothing more than a scenario off the top of my head, and probably not a great one, so I'm not looking for a formatter. What I'm looking for is the best way to trigger a method whenever a bindable value changes. Changewatcher achieves what I want to do here, and so does BindSetter to a lesser degree (where the destination is essentially a method ... but that seems to be stretching its intended use). ChangeWatcher seems to be the correct solution here - I just wanted to ensure I wasn't missing anything as I was intending to blog about it. Cheers for the reply though, much appreciated :) On Wed, Jun 25, 2008 at 5:58 AM, Joseph Balderson [EMAIL PROTECTED]news%40joeflash.ca mailto:[EMAIL PROTECTED] news%40joeflash.ca wrote: It seems like you are misunderstanding the use of binding, which is to tie the value of one property to another with loose coupling such that when one changes (i.e. the source), the other (i.e. the destination) reflects that value change precisely. It sounds like what you're looking for is a custom Formatter, able to take an input and interpret it based on an algorithm, and that formatter value can be bound to a destination property, which in your case seems to be the currentState of the application. If an algorithm will not suite your purposes, I would recommend you stick with the switch statement inside a manager class. If the user level and application state are so closely tied, why not just name your application state strings according to the user level strings. If some sort of validation and logic needs to happen beforehand, then what you're probably looking after is a manager class to make those decisions. __ Joseph Balderson, Flash Platform Developer | http://joeflash.ca nwebb wrote: Hi, I was looking at how you can trigger a function when an argument is a bindable value e.g. //userLevel is a bindable value formatMessage is a function will be called when userLevel changes mx:Label text={formatMessage(userLevel)} / This is cool if you're just displaying a value in a text field. However, what if you don't necessarily want to return a value (i.e. you don't have a destination)? Hopefully this will show what I mean: private function stateManager(value:String):void { switch(value) { case basic: currentState = ''; break; case admin: currentState = 'AdminState'; break; default: currentState = ''; } } BindingUtils methods and the binding tag both expect a destination, but in this case there isn't one. Is the solution simply to use ChangeWatcher instead, or can this be done using binding syntax? Cheers
Re: [flexcoders] triggering a function (when an argument is a bindable value)?
Hi Joseph, thanks for the reply - no, the provided example was nothing more than a scenario off the top of my head, and probably not a great one, so I'm not looking for a formatter. What I'm looking for is the best way to trigger a method whenever a bindable value changes. Changewatcher achieves what I want to do here, and so does BindSetter to a lesser degree (where the destination is essentially a method ... but that seems to be stretching its intended use). ChangeWatcher seems to be the correct solution here - I just wanted to ensure I wasn't missing anything as I was intending to blog about it. Cheers for the reply though, much appreciated :) On Wed, Jun 25, 2008 at 5:58 AM, Joseph Balderson [EMAIL PROTECTED] wrote: It seems like you are misunderstanding the use of binding, which is to tie the value of one property to another with loose coupling such that when one changes (i.e. the source), the other (i.e. the destination) reflects that value change precisely. It sounds like what you're looking for is a custom Formatter, able to take an input and interpret it based on an algorithm, and that formatter value can be bound to a destination property, which in your case seems to be the currentState of the application. If an algorithm will not suite your purposes, I would recommend you stick with the switch statement inside a manager class. If the user level and application state are so closely tied, why not just name your application state strings according to the user level strings. If some sort of validation and logic needs to happen beforehand, then what you're probably looking after is a manager class to make those decisions. __ Joseph Balderson, Flash Platform Developer | http://joeflash.ca nwebb wrote: Hi, I was looking at how you can trigger a function when an argument is a bindable value e.g. //userLevel is a bindable value formatMessage is a function will be called when userLevel changes mx:Label text={formatMessage(userLevel)} / This is cool if you're just displaying a value in a text field. However, what if you don't necessarily want to return a value (i.e. you don't have a destination)? Hopefully this will show what I mean: private function stateManager(value:String):void { switch(value) { case basic: currentState = ''; break; case admin: currentState = 'AdminState'; break; default: currentState = ''; } } BindingUtils methods and the binding tag both expect a destination, but in this case there isn't one. Is the solution simply to use ChangeWatcher instead, or can this be done using binding syntax? Cheers
Re: [flexcoders] triggering a function (when an argument is a bindable value)?
Hi Tracy, I was really just checking that I hadn't missed anything obvious (as I'm intending to write a blog post which covers this area). So, is it safe to say that if you want a method to be triggered each time a bindable value changes, ChangeWatcher is the (only) way to go? ChangeWatcher achieves what I want to do here but so does BindSetter to a lesser degree (i.e. the destination is essentially a method) ... but that seems to be stretching the intended use of an implicit setter. I was just checking that there weren't any other alternatives to consider. Cheers, Neil On Tue, Jun 24, 2008 at 6:02 PM, Tracy Spratt [EMAIL PROTECTED] wrote: ChangeWatcher. Is there some reason you do not want to use this? Tracy -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *nwebb *Sent:* Tuesday, June 24, 2008 10:55 AM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] triggering a function (when an argument is a bindable value)? Hi, I was looking at how you can trigger a function when an argument is a bindable value e.g. //userLevel is a bindable value formatMessage is a function will be called when userLevel changes mx:Label text={formatMessage(userLevel)} / This is cool if you're just displaying a value in a text field. However, what if you don't necessarily want to return a value (i.e. you don't have a destination)? Hopefully this will show what I mean: private function stateManager(value:String):void { switch(value) { case basic: currentState = ''; break; case admin: currentState = 'AdminState'; break; default: currentState = ''; } } BindingUtils methods and the binding tag both expect a destination, but in this case there isn't one. Is the solution simply to use ChangeWatcher instead, or can this be done using binding syntax? Cheers
[flexcoders] triggering a function (when an argument is a bindable value)?
Hi, I was looking at how you can trigger a function when an argument is a bindable value e.g. //userLevel is a bindable value formatMessage is a function will be called when userLevel changes mx:Label text={formatMessage(userLevel)} / This is cool if you're just displaying a value in a text field. However, what if you don't necessarily want to return a value (i.e. you don't have a destination)? Hopefully this will show what I mean: private function stateManager(value:String):void { switch(value) { case basic: currentState = ''; break; case admin: currentState = 'AdminState'; break; default: currentState = ''; } } BindingUtils methods and the binding tag both expect a destination, but in this case there isn't one. Is the solution simply to use ChangeWatcher instead, or can this be done using binding syntax? Cheers
Re: [flexcoders] Drag and Drop (modify default dragProxy)
Thanks Alex, I tried to follow the Flex classes to see what was happening (although I couldn't access DragManagerImpl or IDragManager). Looks as if dragImage is an instance of DataGridDragProxy, so I created my own subclass (which does nothing but create and populate a Label for the moment) and I also called preventDefault() as suggested. I don't see the label, and also as soon as doDrag() has been called I get the red circle icon, indicating that I can no longer drag and drop items within the grid (my DataGrid is set up so that dragEnabled and dropEnabled are both true). If it helps here is the code: private function onDragStart(event:DragEvent):void { event.preventDefault(); var dragInitiator:IUIComponent = event.dragInitiator; var dragSource:DragSource = new DragSource(); dragSource.addData(abcdefg, text); //created a subclass which overrides createChildren and creates/populates/adds a Label var dragImage:DataGridDragProxy = new MyDataGridDragProxy(); DragManager.doDrag(dragInitiator,dragSource, event, dragImage); } Cheers, Neil On Mon, May 12, 2008 at 6:30 PM, Alex Harui [EMAIL PROTECTED] wrote: It isn't the DragProxy you want to change, but probably just the dragImage handed into DragManager.doDrag. The place to do that is in a handler for DRAG_START where you call preventDefault() so the default dragImage isn't used. You can also subclass and override dragImage. -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *nwebb *Sent:* Monday, May 12, 2008 7:04 AM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] Drag and Drop (modify default dragProxy) Hi Douglas, thanks for the reply - yeah that's pretty much what I have at the moment (I capture the data on MouseDown and create/display a Label on MouseMove), but I thought it could be a little cleaner and so I was hoping I could access the current dragProxy, use the existing data within it, all within the MouseMove method. This is what I currently have: //Capture the row data when the user clicks on an item... private function dropZoneMouseDown(event:MouseEvent):void { var selectedData:XML = DataGrid(event.currentTarget).selectedItem as XML; _lastSelectedName = [EMAIL PROTECTED]; _lastSelectedAge = [EMAIL PROTECTED]; } private function dropZoneMouseMove(event:MouseEvent):void { var dragInitiator:IUIComponent = event.target as IUIComponent; var dragSource:DragSource = new DragSource(); var dragProxy:Label = _dragLabel; dragProxy.text = _lastSelectedName ++ _lastSelectedAge; DragManager.doDrag(dragInitiator, dragSource, event, dragProxy); } Cheers, Neil On Mon, May 12, 2008 at 2:41 PM, Douglas Knudsen [EMAIL PROTECTED] wrote: perhaps you can create a Label with the text from these twocolumns and then use this method http://livedocs.adobe.com/flex/3/html/dragdrop_7.html#226768 DK On Mon, May 12, 2008 at 8:40 AM, nwebb [EMAIL PROTECTED] wrote: Hi, I'm drag/dropping items within a DataGrid. I would like to modify the default dragProxy label that is shown when you drag an item. (i.e. my DataGrid may have 4 columns, but I only want to show text from the last two columns). Does anyone know how to access it? -- Douglas Knudsen http://www.cubicleman.com this is my signature, like it?
Re: [flexcoders] Drag and Drop (modify default dragProxy)
Thanks Daniel, trying that now I seem to be having some problems getting anything to show up in my DataGridDragProxy subclass but I'm sure I'll work out the issue soon enough. Much appreciated. On Mon, May 12, 2008 at 3:37 PM, Daniel Gold [EMAIL PROTECTED] wrote: I think if you wanted to modify the default drag proxy you could subclass DataGrid and override the get dragImage function, which looks like this (in Flex 2.01) override protected function get dragImage():IUIComponent { var image:DataGridDragProxy = new DataGridDragProxy(); image.owner = this; return image; } You could subclass the DataGridDragProxy and then add your labels or whatever else you wanted, and return a new instance of that class in get dragImage On Mon, May 12, 2008 at 9:04 AM, nwebb [EMAIL PROTECTED] wrote: Hi Douglas, thanks for the reply - yeah that's pretty much what I have at the moment (I capture the data on MouseDown and create/display a Label on MouseMove), but I thought it could be a little cleaner and so I was hoping I could access the current dragProxy, use the existing data within it, all within the MouseMove method. This is what I currently have: //Capture the row data when the user clicks on an item... private function dropZoneMouseDown(event:MouseEvent):void { var selectedData:XML = DataGrid(event.currentTarget).selectedItem as XML; _lastSelectedName = [EMAIL PROTECTED]; _lastSelectedAge = [EMAIL PROTECTED]; } private function dropZoneMouseMove(event:MouseEvent):void { var dragInitiator:IUIComponent = event.target as IUIComponent; var dragSource:DragSource = new DragSource(); var dragProxy:Label = _dragLabel; dragProxy.text = _lastSelectedName ++ _lastSelectedAge; DragManager.doDrag(dragInitiator, dragSource, event, dragProxy); } Cheers, Neil On Mon, May 12, 2008 at 2:41 PM, Douglas Knudsen [EMAIL PROTECTED] wrote: perhaps you can create a Label with the text from these twocolumns and then use this method http://livedocs.adobe.com/flex/3/html/dragdrop_7.html#226768 DK On Mon, May 12, 2008 at 8:40 AM, nwebb [EMAIL PROTECTED] wrote: Hi, I'm drag/dropping items within a DataGrid. I would like to modify the default dragProxy label that is shown when you drag an item. (i.e. my DataGrid may have 4 columns, but I only want to show text from the last two columns). Does anyone know how to access it? -- Douglas Knudsen http://www.cubicleman.com this is my signature, like it?
[flexcoders] Drag and Drop (modify default dragProxy)
Hi, I'm drag/dropping items within a DataGrid. I would like to modify the default dragProxy label that is shown when you drag an item. (i.e. my DataGrid may have 4 columns, but I only want to show text from the last two columns). Does anyone know how to access it?
Re: [flexcoders] Drag and Drop (modify default dragProxy)
Hi Douglas, thanks for the reply - yeah that's pretty much what I have at the moment (I capture the data on MouseDown and create/display a Label on MouseMove), but I thought it could be a little cleaner and so I was hoping I could access the current dragProxy, use the existing data within it, all within the MouseMove method. This is what I currently have: //Capture the row data when the user clicks on an item... private function dropZoneMouseDown(event:MouseEvent):void { var selectedData:XML = DataGrid(event.currentTarget).selectedItem as XML; _lastSelectedName = [EMAIL PROTECTED]; _lastSelectedAge = [EMAIL PROTECTED]; } private function dropZoneMouseMove(event:MouseEvent):void { var dragInitiator:IUIComponent = event.target as IUIComponent; var dragSource:DragSource = new DragSource(); var dragProxy:Label = _dragLabel; dragProxy.text = _lastSelectedName ++ _lastSelectedAge; DragManager.doDrag(dragInitiator, dragSource, event, dragProxy); } Cheers, Neil On Mon, May 12, 2008 at 2:41 PM, Douglas Knudsen [EMAIL PROTECTED] wrote: perhaps you can create a Label with the text from these twocolumns and then use this method http://livedocs.adobe.com/flex/3/html/dragdrop_7.html#226768 DK On Mon, May 12, 2008 at 8:40 AM, nwebb [EMAIL PROTECTED] wrote: Hi, I'm drag/dropping items within a DataGrid. I would like to modify the default dragProxy label that is shown when you drag an item. (i.e. my DataGrid may have 4 columns, but I only want to show text from the last two columns). Does anyone know how to access it? -- Douglas Knudsen http://www.cubicleman.com this is my signature, like it?
Re: [flexcoders] FlashVars CF issue
Thanks Tom, much appreciated. It's useful to know that it should work. I'll take a closer look today. We're using Fusebox (for the first time) - maybe that's caused a complication somewhere along the line. I can't think what else could be wrong. On Tue, May 6, 2008 at 3:55 PM, Tom Chiverton [EMAIL PROTECTED] wrote: On Tuesday 06 May 2008, nwebb wrote: My initial thought was to open up the Debug Dialogue/Run Dialogue and swap the url/path to point to the original html. The problem is that the original html wrapper is actually generated from a ColdFusion file, and pointing to the ColdFusion file directly doesn't work of course. I've got my run/debug URLs set to point at a .cfm file, and it works fine. -- Tom Chiverton Helping to enthusiastically facilitate magnetic customers on: http://thefalken.livejournal.com This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB. A list of members is available for inspection at the registered office. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. Regulated by The Solicitors Regulation Authority. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 2500. For more information about Halliwells LLP visit www.halliwells.com. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
[flexcoders] FlashVars CF issue
Hi, I've set up my project so that when I hit Run or Debug my swf gets published to a location on a development machine (rather than to the local bin folder(s)) While the swf gets published to the correct location, my problem is that, by default, Flex generates an HTML wrapper to go with it. However, the original HTML wrapper (i.e. the one on the remote machine) contains FlashVars which I need to access. My initial thought was to open up the Debug Dialogue/Run Dialogue and swap the url/path to point to the original html. The problem is that the original html wrapper is actually generated from a ColdFusion file, and pointing to the ColdFusion file directly doesn't work of course. Is there a better way of of working like this with FlashVars, or do I simply have to fake an html file with some FlashVars hardcoded? Any feedback much appreciated. Hopefully I've worded this post clearly enough to make some sense! (if not, I've added a little more detail below). Cheers, Neil MORE INFO In the Flex Build Path settings I have set my Output Folder to be Z:\wwwroot\project\folder and my Output URL to be http://devMachineName/folder/ By default, the Debug Dialogue for the Flex project specifies the html wrapper as: http://devMachineName/folder/ProjectName.html The swf is actually wrapped in some HTML which is generated by a ColdFusion file (and this contains FlashVars). The CFM is at Z:\wwwroot\project\folder\ProjectName.cfm *
Re: [flexcoders] expected behaviour? (e4x)
Hi Tom, I don't want a list of countries, I want the entire node if it contains a particular country value (the node may contain multiple county values) Eg of XML (if the user searches for any of the three countries this node should be returned): node labelAAA/label countryPeru/country countryKenya/country countryIstanbul/country /node I was hoping there would be an easier way, but not being too familiar with e4x, I settled for getting the job done by looping through the nodes, pulling out an xmllist of countries for each node, and if a country matches, popping the entire node in another array. However, back to the original post, when I say for each(var theNode:XML in myTestData..node) I wasn't expecting that line of code to alter the value of myTestData too. Do you have a moment to copy/paste and test the code I posted? Cheers On 10/23/07, Tom Chiverton [EMAIL PROTECTED] wrote: On Tuesday 23 Oct 2007, [EMAIL PROTECTED] wrote: var keywords:XMLList = theNode.country; var numMatches:uint = keywords.(text()==countryString).length(); Why do you do this and not nodesMatch=myTestData.node.country.(text()==countryString) (or similar, not tested that) -- Tom Chiverton. Are you a great Flex programmer, who knows Cairngorm, and has done some ColdFusion work ? Would you like to work for a top 30 law firm in Manchester, UK ? Are not an agency ? If yes, send email ! 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 St James's Court Brown Street Manchester M2 2JF. A list of members is available for inspection at the registered office. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. Regulated by The Solicitors Regulation Authority. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 8008. For more information about Halliwells LLP visit www.halliwells.com. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links
Re: [flexcoders] expected behaviour? (e4x)
Hi Tom, I can return it - that's what I was doing (despite benefiting from a quick refactor*) However, this is a little off-topic, as getting the data and having a fix for the problem were already taken care of before I posted. why not refactor so you can work with the document Really all I was looking for was someone to quickly test the code and say Yes it is what's expected because... or You're right, that's odd ... better report it. I can refactor as it's my own test, but if it is buggy behaviour I want to report it so it gets fixed before the release of Flex3, and hopefully benefit others * looking at it this morning I see the very obvious with regards to the fetching of the data ... myTestData.node.country.(text()==countryCode).parent(); - I was thinking of e4x as being distinct from the XML object ... and er obviously its not On 10/24/07, Tom Chiverton [EMAIL PROTECTED] wrote: On Wednesday 24 Oct 2007, [EMAIL PROTECTED] wrote: Eg of XML (if the user searches for any of the three countries this node should be returned): You can't return that, as it's not in the original document. I guess that explains your loop. As it's all your app, why not refactor so you can work with the document as-is ? -- Tom Chiverton. Are you a great Flex programmer, who knows Cairngorm, and has done some ColdFusion work ? Would you like to work for a top 30 law firm in Manchester, UK ? Are you not an agency ? If yes, send email ! 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 St James's Court Brown Street Manchester M2 2JF. A list of members is available for inspection at the registered office. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. Regulated by The Solicitors Regulation Authority. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 8008. For more information about Halliwells LLP visit www.halliwells.com. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links
[flexcoders] expected behaviour? (e4x)
Hi, Could someone run this code and let me know whether it is expected behaviour? The snippet of code (below) is looking for xml nodes which match a certain criteria - it then pops them in an XMLListCollection. I have no problem finding the nodes and populating the collection. However, on the second time around I noticed that my original XML data gets modified as well. I figured that this must be a reference problem, and it does appear to be (see comments in code for solution), but I wouldn't expect to need to do this here, as I'm only reading the data, not writing to it or anything that references it. Below is a the code for the mxml file: 1) Run it in debug mode 2) Choose Brazil from the ComboBox 3) Step through it and watch the original xml data (myTestData) change when the second match is added to the XMLListCollection. Any understanding of this would be appreciated *** Here is the code: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute verticalScrollPolicy=off horizontalScrollPolicy=off paddingBottom=5 paddingLeft=5 paddingRight=5 paddingTop=5 height=399 width=514 mx:Script ![CDATA[ import mx.collections.XMLListCollection; import mx.controls.ComboBox; import mx.collections.ArrayCollection; import mx.events.ListEvent; import mx.events.TreeEvent; [Bindable] private var countries:Array = [all,Brazil,Colombia, Peru]; [Bindable] private var description:String = ; private var myTestData:XML = tree node labelAAA/label countryKenya/country /node node labelBBB/label countryBrazil/country /node node labelCCC/label countryBrazil/country /node node labelDDD/label countryPeru/country /node /tree; private function onCountryComboChange(event:ListEvent):void { var countryString : String = ComboBox(event.currentTarget ).selectedItem.toString(); var nodesMatchingQuery : XMLListCollection = new XMLListCollection(); var CHECKMYORIGDATA = myTestData; if(countryString != all) { //SOLUTION IS TO LOOP THROUGH myTestData..node.copy() - BUT //WHY SHOULD I NEED TO LOOP THROUGH A COPY WHEN I'M ONLY READING THE DATA? for each(var theNode:XML in myTestData..node) { var keywords:XMLList = theNode.country; var numMatches:uint = keywords.(text()==countryString).length(); if(numMatches = 1){ //STEP THROUGH THIS CODE, LOOKING AT THE ORIGINAL XML nodesMatchingQuery.addItem(theNode); //THIS ALTERS myTestData ON SECOND ATTEMPT } } } } ]] /mx:Script mx:VBox height=100% mx:ComboBox width=141 dataProvider={countries} change=onCountryComboChange(event)/ /mx:VBox /mx:Application
[flexcoders] Debugging bindings
Hi, I'm modifying a Flex2 project and would like to find everything that binds to a particular property in the Model. A simple search through the project isn't that helpful, as the property is called 'entity' - a word used in just about every class in the Project. I wondered if people have established any useful ways for doing something like this ... and also for debugging bindings in general (other than those mentioned in the docs). Thanks
[flexcoders] Tree / dataDescriptor / debugger
Hi, has anyone had trouble viewing properties of the Tree components data descriptor, when debugging? I just noticed this issue when looking at a script. The descriptor is listed in the Variables view, but does not expand to show any properties. I was able to recreate the issue easily enough and wondered whether it needs reporting or not. To test it yourself: 1. Copy and paste the following code in to a new project. 2. Put a breakpoint on line 23 (the closing bracket of the onComplete method) 3. Run You can see that the descriptors hasChildren is true. I also created a variable showing the children, but still the descriptor won't expand in the Variables view. Seems odd. I have tried rebooting, cleaning the project etc etc. Just about to check I have the latest debug player. Seems to consistently fail //--- CODE - ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; initialize=onInit(); creationComplete=onComplete(); mx:Script ![CDATA[ import mx.collections.ICollectionView; import mx.controls.treeClasses.ITreeDataDescriptor; [Bindable] public var myXML:XML; public function onInit():void{ myXML = top label=branchmid label='leaf' /mid label='leaf' //top; } public function onComplete():void{ var treeDD:ITreeDataDescriptor = myTree.dataDescriptor; var hasChildren:Boolean = treeDD.hasChildren(myXML[0]); var children:ICollectionView = treeDD.getChildren(myXML[0]); } ]] /mx:Script mx:Tree id=myTree dataProvider={myXML} labelField=@label showRoot=true / /mx:Application
Re: [flexcoders] Re: Problem with List Item Renderer (and states)
Thanks to everyone who has put forward a suggestion so far :). My List is populated with an ArrayCollection of Typed objects (of type Band). Obviously my Band class should not have the responsibility of storing the current state (expanded/collapsed) - or even knowing anything about it, so I am wondering if the data property and the Band instance are indeed the same thing here? If they are, it doesn't sound ideal to add stuff to the data object - or is this not the case? Cheers, Neil On 2/25/07, Harald Dehn [EMAIL PROTECTED] wrote: There is a better solution solution: You could save the state to the underlying data. In your item renderer you could override the commitProperties method: private function buttonExpandedHandler(event:Event):void { // pressing the button data[ExpandedState] = (data[ExpandedState] != true ); // Change state with effects } // protected override function commitProperties():void { super.commitProperties(); var expandedState:Boolean = ( data data[ExpandedState] ) ; // Change state if necessary without effect } Harald *Von:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *Im Auftrag von *shuell2000 *Gesendet:* Sonntag, 25. Februar 2007 16:16 *An:* flexcoders@yahoogroups.com *Betreff:* [flexcoders] Re: Problem with List Item Renderer (and states) Your problems stem from the fact that Lists reposition and resize children each time updateDisplayList is called. Which is whenever you scroll or resize any of their children. List components extend TileBase which has a method called makeRowsAndColumns which is the method that is causing you frustration at the moment. Lists were not meant to hold itemRenderers that can resize themselves. Instead Lists have built in mouseOver and mouseDown handlers that recolor the background behind the object causing the mouseEvent and they must have thought that would be good enough. I recently had to rewrite the list classes to allow a resize to work on mouseOver of its children. It was an ugly hack but the project timeline did not allow me to do much more at the moment. Basically I created my own Tilebase and ListBase classes then changed the updateDisplayList method and the makeRowsAndColumns method to leave alone any itemRenderer that was not in its default state. Aside from a few issues caused by this, it seems to have solved my issue but is hardly clean enough to post here. Take a look at those methods I mentioned and see if you can't do something in them to ignore anything that is transitioning to a new state or in a new state. Good Luck, John Shuell --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, nwebb [EMAIL PROTECTED] wrote: Hi, I have a custom item renderer with two states (expanded and collapsed) My items are displayed in a List component, and the data is currently coming from an ArrayCollection. You can see the page here (click on Gig Calender): http://www.bathbands.co.uk/test2007/ Here is an example of the problem I'm facing: 1) Click the Read More button of the first item in the List - it will expand. 2) Scroll down and you can see that the third and last item have also expanded. 3) Scroll back up and you will see that the first item is now in the collapsed state again, but other items are now in the expanded state. I'm not sure what's causing the other items to open/close. I guess it has something to do with Flex redrawing stuff as it goes off screen, and would appreciate suggestions on how best to prevent this kind of thing from happening. Cheers, Neil
Re: [flexcoders] Re: Problem with List Item Renderer (and states)
John, that's great info and should allow me to address the problem. I really appreciate the answer. Thanks :] On 2/25/07, shuell2000 [EMAIL PROTECTED] wrote: Your problems stem from the fact that Lists reposition and resize children each time updateDisplayList is called. Which is whenever you scroll or resize any of their children. List components extend TileBase which has a method called makeRowsAndColumns which is the method that is causing you frustration at the moment. Lists were not meant to hold itemRenderers that can resize themselves. Instead Lists have built in mouseOver and mouseDown handlers that recolor the background behind the object causing the mouseEvent and they must have thought that would be good enough. I recently had to rewrite the list classes to allow a resize to work on mouseOver of its children. It was an ugly hack but the project timeline did not allow me to do much more at the moment. Basically I created my own Tilebase and ListBase classes then changed the updateDisplayList method and the makeRowsAndColumns method to leave alone any itemRenderer that was not in its default state. Aside from a few issues caused by this, it seems to have solved my issue but is hardly clean enough to post here. Take a look at those methods I mentioned and see if you can't do something in them to ignore anything that is transitioning to a new state or in a new state. Good Luck, John Shuell --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, nwebb [EMAIL PROTECTED] wrote: Hi, I have a custom item renderer with two states (expanded and collapsed) My items are displayed in a List component, and the data is currently coming from an ArrayCollection. You can see the page here (click on Gig Calender): http://www.bathbands.co.uk/test2007/ Here is an example of the problem I'm facing: 1) Click the Read More button of the first item in the List - it will expand. 2) Scroll down and you can see that the third and last item have also expanded. 3) Scroll back up and you will see that the first item is now in the collapsed state again, but other items are now in the expanded state. I'm not sure what's causing the other items to open/close. I guess it has something to do with Flex redrawing stuff as it goes off screen, and would appreciate suggestions on how best to prevent this kind of thing from happening. Cheers, Neil
[flexcoders] Problem with List Item Renderer (and states)
Hi, I have a custom item renderer with two states (expanded and collapsed) My items are displayed in a List component, and the data is currently coming from an ArrayCollection. You can see the page here (click on Gig Calender): http://www.bathbands.co.uk/test2007/ Here is an example of the problem I'm facing: 1) Click the Read More button of the first item in the List - it will expand. 2) Scroll down and you can see that the third and last item have also expanded. 3) Scroll back up and you will see that the first item is now in the collapsed state again, but other items are now in the expanded state. I'm not sure what's causing the other items to open/close. I guess it has something to do with Flex redrawing stuff as it goes off screen, and would appreciate suggestions on how best to prevent this kind of thing from happening. Cheers, Neil
[flexcoders] Panel and Scrollbars (basic question)
Hi, I'm sure this is excruciatingly simple but i couldn't find an answer (I must be searching with the wrong keywords). I have a Panel. Inside it is a Text component, and a Repeater underneath that (...repeating a CheckBox) . All works fine. I want to set the maxHeight of the Panel to 200px, so that if I get too many Checkboxes appearing, my content will scroll vertically. When I set maxHeight, I get *both* horizontal and vertical scrollbars appearing - the horizontal scrollbar only appears because the width of the vertical scrollbar eats in to the Panel width - therefore I get horizontal scrolling of about 16 pixels. If I set horizontalScrollbarPolicy to false then my content is still clipped. I'm sure I can muster a workaround easily enough (e.g. manually resize Panel based on ScrollEvent etc), but I thought there surely must be something in-built and neater, already in place to deal with this kind of scenario? Any help much appreciated.
Re: [flexcoders] Panel and Scrollbars (basic question)
not be the desired effect. If you can post code I'd be happy to take a look, I've done a lot of tweaking layouts with lots of scrollbars lately! HTH Rachel On 2/1/07, nwebb [EMAIL PROTECTED] wrote: Hi, I'm sure this is excruciatingly simple but i couldn't find an answer (I must be searching with the wrong keywords). I have a Panel. Inside it is a Text component, and a Repeater underneath that (...repeating a CheckBox) . All works fine. I want to set the maxHeight of the Panel to 200px, so that if I get too many Checkboxes appearing, my content will scroll vertically. When I set maxHeight, I get *both* horizontal and vertical scrollbars appearing - the horizontal scrollbar only appears because the width of the vertical scrollbar eats in to the Panel width - therefore I get horizontal scrolling of about 16 pixels. If I set horizontalScrollbarPolicy to false then my content is still clipped. I'm sure I can muster a workaround easily enough (e.g. manually resize Panel based on ScrollEvent etc), but I thought there surely must be something in-built and neater, already in place to deal with this kind of scenario? Any help much appreciated.
Re: [flexcoders] Data Binding Question - will both work?
Thanks Matt :]Much appreciated.On 9/20/06, Matt Chotin [EMAIL PROTECTED] wrote: I think we made that change between beta3 and release so if things are working for you now I believe you're set. But your preferred choice is preferred by us too I think J Matt From: [EMAIL PROTECTED] ups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of nwebb Sent: Tuesday, September 19, 2006 8:59 AM To: [EMAIL PROTECTED]ups.com Subject: [flexcoders] Data Binding Question - will both work? Hi, I've just seen part of a Flex training video that I think is incorrect or outdated (beta 3 was being used at the time) I just want to double-check that this really is the case. The video says that the code below would *not* take full advantage of data binding (ie the data will initially appear in the DataGrid, but it will not stay updated): mx:HTTPService id=heroesDataRequest url="" / mx:DataGrid dataProvider={heroesDataRequest.lastResult.superheroes.hero} / However, I read in the Flex 2 docs that an HTTPService request will, by deault return an ArrayCollection (makeObjectsBindable is true by default), and I am using the data binding syntax in the form of the curly braces. Furthermore, in order to try and test, I used buttons to change the data in the HTTPService's lastResult object, and the changes do always seem to be reflected in my DataGrid: mx:HTTPService id=heroesDataRequest url="" makeObjectsBindable=true / mx:DataGrid dataProvider={heroesDataRequest.lastResult.superheroes.hero } / mx:Button label=button 1 click=heroesDataRequest.lastResult.superheroes.hero[0].name = 'AAA'; / mx:Button label=button 2 click=heroesDataRequest.lastResult.superheroes.hero [0].name = 'BBB'; / The tutorial goes on to say that to make binding work properly I should use the HTTPServices 'result' event handler, and assign the data to a bindable ArrayCollection variable that I create - this is probably my preferred choice anyway, but I am curious to know whether both ways are equally appropriate. Can I safely say that data binding is working fully in the first example, or could there be scenarios in which it will not work but where the alternative method would? If so, could someone enlighten me? I'm not yet confident of the best way to check/debug this kind of thing myself. Cheers, Neil __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Software development tool Software development Software development services Home design software Software development company Your email settings: Individual Email|Traditional Change settings via the Web (Yahoo! ID required) Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe __,_._,___
[flexcoders] Data Binding Question - will both work?
Hi, I've just seen part of a Flex training video that I think is incorrect or outdated (beta 3 was being used at the time)I just want to double-check that this really is the case.The video says that the code below would *not* take full advantage of data binding (ie the data will initially appear in the DataGrid, but it will not stay updated): mx:HTTPService id=heroesDataRequest url="" / mx:DataGrid dataProvider={heroesDataRequest.lastResult.superheroes.hero} /However, I read in the Flex 2 docs that an HTTPService request will, by deault return an ArrayCollection (makeObjectsBindable is true by default), and I am using the data binding syntax in the form of the curly braces. Furthermore, in order to try and test, I used buttons to change the data in the HTTPService's lastResult object, and the changes do always seem to be reflected in my DataGrid: mx:HTTPService id=heroesDataRequest url="" makeObjectsBindable=true / mx:DataGrid dataProvider={heroesDataRequest.lastResult.superheroes.hero } /mx:Button label=button 1 click=heroesDataRequest.lastResult.superheroes.hero[0].name = 'AAA'; /mx:Button label=button 2 click=heroesDataRequest.lastResult.superheroes.hero [0].name = 'BBB'; /The tutorial goes on to say that to make binding work properly I should use the HTTPServices 'result' event handler, and assign the data to a bindable ArrayCollection variable that I create - this is probably my preferred choice anyway, but I am curious to know whether both ways are equally appropriate. Can I safely say that data binding is working fully in the first example, or could there be scenarios in which it will not work but where the alternative method would? If so, could someone enlighten me? I'm not yet confident of the best way to check/debug this kind of thing myself. Cheers,Neil __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Software development tool Software development Software development services Home design software Software development company Your email settings: Individual Email|Traditional Change settings via the Web (Yahoo! ID required) Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe __,_._,___
[flexcoders] Flex2 (XML vs Model) ?
Hi, I'm loading XML in to Flex2 at compile-time and would like to bind label properties of certain modes to a Tree list display.The docs say that you cannot (currently) bind to properties of an XML instance (the XML class is not of type IEventDispatcher) so I thought I would try loading the XML in to Model instance instead, using: mx:Model id=menuItems source=xml/menuOptions.xml /My test XML looks like this:?xml version='1.0' ?menu folder label=Flex 2 item label=Tutorial 1 Hello/item item label=Tutorial 2 / item label=Tutorial 3 / /folder/menu I don't think model instances support attributes though, so while trace(menuItems.item[0]) works, I can't seem to access the label attribute. Could someone confirm that this is right, and if so, are there any better suggested methods to use, or do i just need to load the xml in to an XML instance, and then use E4X to pull out the label attributes and assign them to bindable vars of my own creation? Cheers,Neil __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __,_._,___