Re: [flexcoders] Re: how to fix poor performance in this example (AdvancedDataGrid and Binding)
When you set the highlighted property on your items, they are dispatching PropertyChangeEvents. The collection they are in will receive these PropertyChangeEvents and dispatch CollectionChangeEvents. The AdvancedDataGrid will receive these and perform a visual update, which appears to clear the rollover highlight. To prevent the rollover highlight clearing you need to avoid dispatching PropertyChangeEvents when you update the hightlighted property. Which means you need to use a custom event in your binding (see below). This should fix the choppiness without breaking the binding, although you might want to rethink this whole approach: When you select an item in a datagrid it sets the selectedItem property; it doesn't update the underlying data items. Why not follow this pattern for tracking which item is rolled over? package { import flash.events.EventDispatcher; public class TestObject extends EventDispatcher { [Bindable] public var label:String; private var _highlighted:Boolean; public function get highlighted() : Boolean { return _highlighted; } [Bindable( event = highlightedChange )] public function set highlighted( highlighted : Boolean ) : void { _highlighted = highlighted; dispatchEvent( new Event( highlightedChange ) ); } } } Pan Troglodytes wrote: 1) Yes, this works fine, for the display portion only. It doesn't address the actual problem of needing to set a flag in the data that indicates it is the currently highlighted one, that flag being also used by other things that bind to the data that don't want to know about UI details like the grid. In this case, I had a number of chart listeners that would toggle series on/off depending on which one was highlighted in the grid. 2) There is no commitProperties on AdvancedDataGridItemRenderer. Perhaps you meant validateProperties. In this example, it gets called only when the grid is first displayed and not when any item is highlighted/de-highlighted or selected/de-selected. 3) Yes, the styleFunction does get called when the highlighted object changes. But if you move the code to set data.highlighted there, you get the same result! It just seems like anything that changes this bound variable on every repaint of the cell is doomed to break the rollover highlight. On Tue, Jun 9, 2009 at 11:49 AM, Amy amyblankens...@bellsouth.net wrote: --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Pan Troglodytes chimpathe...@... wrote: That was a good idea and it does get rid of the arraycollection walking. But I get the SAME problem with the grid losing highlighting when I did it using AdvancedGridItemRenderer, thought the symptoms are slightly different: Personally, I'd do one of two things: 1) Just look to see if the current item is the highlighted item in the styleFunction -or- 2) Override commitProperties instead of validateNow(). I'd also be tempted to investigate whether the styleFunction gets called when the highlighted object changes. HTH; Amy
RE: [flexcoders] Project wont build
Hi Greg, Confusing though it may be, java 5 and java 1.5 are the same thing. See the link below for more on this: http://java.sun.com/j2se/1.5.0/docs/relnotes/version-5.0.html The IManaged error is a compile-time error in generated ActionScript code which is why it shows up in a strange place in your source code. If you use the [Managed] metadata tag before a class declaration, the compiler will update the class to implement the IManaged interface 'behind the scenes'. There's a bit of information on the relationship between IManaged and [Managed] at the link below. http://www.adobe.us/livedocs/flex/2/langref/mx/data/IManaged.html The compiler can't find the definition of the IManaged interface. I believe this interface is included as part of fds.swc, so you should check that you have this library on your build path. I'm not sure what's causing the third problem you mention, the 'getRemoteObject' function has been in the Cairngorm ServiceLocator since version 2.1. Perhaps double-check your version of cairngorm.swc? Also not sure about the fourth problem, but you may need to clean-up or reset your designated Flex applications. The link below may be useful: http://livedocs.adobe.com/flex/201/html/projects_035_14.html#159004 Hope this helps, Paul From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Greg Morphis Sent: Tuesday, September 25, 2007 2:23 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Project wont build I havent touched Flex in months but the need has risen and I'm trying to build a project that I worked with 2 others on. I wasnt the main developer. Anyways, I tried to build the project and got a bunch of errors. Cairngorm errors, just errors all over the place, and something about the Java Facet.. I pointed the Library path to Cairngorm.swc and that resolved a lot of the Cairngorm errors. Anyways I'm concerned on the Java Facet error.. I had jre1.5.0_10 installed.. I checked the dev and prod servers and they both had 1.5.0_11 installed so I upgraded to that version. The Java Facet was set to 1.4, however I'm using jre se 1.5.0_11. So shouldn't 1.5 be an option? My only options are: 1.3 1.4 5.0 6.0 Under properties - Java Build Path - Libraries, it shows the JRE that I added jre1.5.0_11. I change it to Java 5.0 and no Facet errors however I don't think it should be set to 5. Shouldnt it be 1.5? If I change back to 1.4 I get over 100 errors. Can someone direct me on how to change that? BTW if I open up a command line and type java -version I get java version 1.5.0_11 Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03) Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing) which is correct. Also the only errors I'm getting now are strange errors.. 1045: Interface IManaged was not found. When I click on it Eclipse opens up a VO and the line it marks is a commented out line.. What kind of crack is eclipse on? There isnt an IManaged anywhere in the app.. I'm thinking it's bombing on [Managed] [RemoteClass(alias=com.alltel.rapid.aopscheduler.vo.CityVO)] The [Managed] there.. I only get 2 other errors but they say the same thing.. 1061: Call to a possibly undefined method getRemoteObject through a reference with static type com.adobe.cairngorm.business:ServiceLocator. They just point to 2 different places. Anyways, I would really appreciate some help with this guys. Thanks
RE: [flexcoders] filterFunction issue with shared array collection in model / shared list
Take a look at the ListCollectionView class - you can pass your 'master' ArrayCollection into its constructor (because ArrayCollection implements IList). You can then set filter options on your ListCollectionView without affecting the 'master'. So you'd probably want to create a ListCollectionView for each of your individual views: http://livedocs.adobe.com/flex/2/langref/mx/collections/ListCollectionVi ew.html You can use a ListCollectionView as a dataProvider for your datagrid controls because it implements the required interfaces (just like ArrayCollection). The ListCollectionView will also listen for changes to the underlying 'master' list and update accordingly. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of scott_flex Sent: Monday, March 26, 2007 4:11 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] filterFunction issue with shared array collection in model / shared list I have a shared arraycollection of value objects. Singeton, only one instance of this array collection. Dfferent views (in a tab navigator) are generated using this shared array collection but each view filters the data in a datagrid list with different criteria. So.. in each view i utilized the filterFunction to correctly filter the array collection and only display what i needed into my datagrid. That works great. However, when i set the filter function and refresh the arrayCollection all my other views (tab windows) change as well because they are all databound to the shared array collection... This does make sense... but not what i want. Maybe i need to put the filter on the datagrid for each view, not the array collection. Am i going about this wrong? I'm a newbie cairngorm and i believe this is an issue that others would run into.
RE: [flexcoders] Re: Mystery space
I'm struggling to get the following line to compile: for (y=0; ydepartments.length) Can you double-check? From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of TJ Downes Sent: Wednesday, February 14, 2007 2:15 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Mystery space Sure, I just finished writing a blog entry on it: http://www.phusor.com/index.cfm/2007/2/13/How-you-loop-in-AS3Flex-2-can- affect-layout http://www.phusor.com/index.cfm/2007/2/13/How-you-loop-in-AS3Flex-2-can -affect-layout --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Paul Williams [EMAIL PROTECTED] wrote: Can you post the code for the loop that doesn't work and the one that does? From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of TJ Downes Sent: Wednesday, February 14, 2007 1:01 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: Mystery space So after some more testing I figured out this was due to a for loop to set the selectedIndex on the datagrid. I changed this to a for...in loop and the issue is no more. Maybe someone could explain to me why a for loop would affect display/layout? I am still confused why this would be the issue. Thanks TJ --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com , TJ Downes koldfuzun@ wrote: Anyone experience any issues where Flex just throws extra space into the layout, causing elements to jump or get bumped out of their parent containers? I have this issue with an application and have spent the majority of the day trying to resolve it. There are three custom components loaded into a TabNavigator (ive tried other layout containers too). The first element has about a 50px space below it when it loads, and on certain events the screen also jumps. The space does not exist below the other two components and they utilize almost the exact same layout and code. I have also tried changing the order of these and the same component will always behave the same way regardless of the position. Any help would be greatly appreciated.
RE: [flexcoders] Re: Mystery space
Can you post the code for the loop that doesn't work and the one that does? From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of TJ Downes Sent: Wednesday, February 14, 2007 1:01 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Mystery space So after some more testing I figured out this was due to a for loop to set the selectedIndex on the datagrid. I changed this to a for...in loop and the issue is no more. Maybe someone could explain to me why a for loop would affect display/layout? I am still confused why this would be the issue. Thanks TJ --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , TJ Downes [EMAIL PROTECTED] wrote: Anyone experience any issues where Flex just throws extra space into the layout, causing elements to jump or get bumped out of their parent containers? I have this issue with an application and have spent the majority of the day trying to resolve it. There are three custom components loaded into a TabNavigator (ive tried other layout containers too). The first element has about a 50px space below it when it loads, and on certain events the screen also jumps. The space does not exist below the other two components and they utilize almost the exact same layout and code. I have also tried changing the order of these and the same component will always behave the same way regardless of the position. Any help would be greatly appreciated.
RE: [flexcoders] RESKINNING AN Alert
Hi James, You can specify custom styles for the buttons, message and title of your Alert control in CSS or in AS3. The Alert control also inherits styles from 'Panel' allowing you to set backgroundAlpha, backgroundColor, borderStyle, etc. This is covered in the Alert control documentation: http://livedocs.macromedia.com/flex/2/langref/mx/controls/Alert.html#sty leSummary If this doesn't answer your question, could you post more detail regarding the problems you are experiencing or what you are trying to achieve? Paul From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of James T. Riffe Sent: Sunday, February 11, 2007 4:00 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] RESKINNING AN Alert I'm looking for a way to re-skin the Alert popup. If anybody has a way to-do it an example would be nice. I've tried taking the Alert into a private function, however backgroundAlpha, background colors and text colors don't seem to be available. I'll have to assume if this can't be done either through AS3 or through CSS that I will have to write a popup to substitute for the alert.show. Thanks in advance James
RE: [flexcoders] Re: Command line to compile system (extracted from FlexBuilder?)
Hi Mike, You shouldn't need to configure all these options on the command line, many of them are just defaults. The error suggests that your build is not including the locale-specific resource bundles located in frameworks/locale. To get to grips with mxmlc I would suggest starting with a blank application (eg. Main.mxml) and verify you can build it with the command: mxmlc Main.mxml When you run this command you should see that mxmlc is loading a configuration file prior to performing the compilation. The configuration file defines the default compilation options for mxmlc. By default mxmlc uses the flex-config.xml file in the frameworks directory, but you can create your own version of this file for a specific build (see the load-config option). If you are using FDS and server-side compilation, you will already have a version of this file in WEB-INF/flex because the file is used by the server-side mxml compiler. Once you have a simple build working, try bringing in your other dependencies step-by-step. Paul From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mike Crowe Sent: Sunday, February 11, 2007 10:56 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Command line to compile system (extracted from FlexBuilder?) Hi Paul, here's the errors: Unable to resolve a class for ResourceBundle: collections ... And the command line: @C:\Program Files\Adobe\Flex Builder 2\Flex SDK 2\bin\mxmlc.exe TaskBase2.mxml -accessible=false -allow-source-path-overlap=false -as3=true -benchmark=true -debug=false -default-background-color 13421823 -default-frame-rate 24 -es=false -external-library-path C:\Program Files\Adobe\Flex Builder 2\Flex SDK 2\frameworks\libs -external-library-path library -generate-frame-loader=true -headless-server=true -include-libraries library\Cairngorm.swc -include-libraries library\corelib.swc -include-libraries library\flexunit.swc -include-libraries library\XPanel_Library.swc -incremental=true -keep-generated-actionscript=false -lazy-init=false -library-path C:\Program Files\Adobe\Flex Builder 2\Flex SDK 2\frameworks\libs -optimize=false -show-actionscript-warnings=true -show-binding-warnings=true -show-deprecation-warnings=true -source-path C:\Program Files\Adobe\Flex Builder 2\Flex SDK 2\frameworks -strict=true -use-network=true -verbose-stacktraces=false -warnings=true See anything? Mike --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Paul Williams [EMAIL PROTECTED] wrote: Hi Mike, Perhaps this will help you get started: http://livedocs.macromedia.com/flex/201/html/wwhelp/wwhimpl/common/html/ http://livedocs.macromedia.com/flex/201/html/wwhelp/wwhimpl/common/html / wwhelp.htm?context=LiveDocs_Book_Partsfile=apparch_116_14.html To automate with ant see below: http://labs.adobe.com/wiki/index.php/Flex_Ant_Tasks http://labs.adobe.com/wiki/index.php/Flex_Ant_Tasks If you are running mxmlc and encountering problems please provide a more detailed description. Paul From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of Mike Crowe Sent: Sunday, February 11, 2007 12:39 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Command line to compile system (extracted from FlexBuilder?) Hi folks, Is there a way to get the mxmlc command that FlexBuilder is executing somehow? I'm running low on resources, and want to compile from the command line. However, I can't seem to get a command line to work that produces a working .swf. Any way I can get it somehow? TIA Mike
RE: [flexcoders] Command line to compile system (extracted from FlexBuilder?)
Hi Mike, Perhaps this will help you get started: http://livedocs.macromedia.com/flex/201/html/wwhelp/wwhimpl/common/html/ wwhelp.htm?context=LiveDocs_Book_Partsfile=apparch_116_14.html To automate with ant see below: http://labs.adobe.com/wiki/index.php/Flex_Ant_Tasks If you are running mxmlc and encountering problems please provide a more detailed description. Paul From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mike Crowe Sent: Sunday, February 11, 2007 12:39 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Command line to compile system (extracted from FlexBuilder?) Hi folks, Is there a way to get the mxmlc command that FlexBuilder is executing somehow? I'm running low on resources, and want to compile from the command line. However, I can't seem to get a command line to work that produces a working .swf. Any way I can get it somehow? TIA Mike
RE: [flexcoders] Re: Transferring Data through Cairngorm methodology
I think you will need to perform a cast to access the properties of your AuthenticateEvent instance (this is why you got a compiler error). The cast is achieved as follows: var authenticateEvent : AuthenticateEvent = AuthenticateEvent( event ); So your command's execute function will look like this: public function execute (event : CairngormEvent):void { if( !CruiseModelLocator.getInstance().authenticated ) { var delegate : LoginDelegate = new LoginDelegate( this ); // Do a cast var authenticateEvent : AuthenticateEvent = AuthenticateEvent( event ); // Now extract your login details var loginName = authenticateEvent.loginName; var password = authenticateEvent.password; // Pass details to your delegate delegate.doLogin(loginName, password); } else { Alert.show( Logged In already! ); return; } } I hope this solves your problem, but feel free to post again if you are unfamiliar with casting and need more explanation. Paul -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of laidezmon Sent: Thursday, September 28, 2006 2:41 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Transferring Data through Cairngorm methodology O and one other thing, when I created the authenticate event class, I created two params public var loginName : String; public var password : String; I dont know if thats important or not. --- In flexcoders@yahoogroups.com, laidezmon [EMAIL PROTECTED] wrote: I am trying to implement a simple login application in cairngorm. I am having all kinds of problems. Heres the deal. Basically I have a button which calls a doLogin() function. private function doLogin():void { var event : AuthenticateEvent = new AuthenticateEvent(AuthenticateEvent.EVENT_LOGIN); event.loginName = loginName.text; event.password = password.text; CairngormEventDispatcher.getInstance().dispatchEvent( event ); } this is called from my mxml display page. loginName and password are text fields on my screen. The controller is loaded from the main.mxml file, and is already instantiated, but here is the add command reference for this login function. public function initialiseCommands() : void { addCommand( AuthenticateEvent.EVENT_LOGIN, LoginCommand ); } From there the loginCommand.as is called and runs its execute method: public function execute (event : CairngormEvent):void { if( !CruiseModelLocator.getInstance().authenticated ) { var delegate : LoginDelegate = new LoginDelegate( this ); delegate.doLogin(event.data.loginName, event.data.password); } else { Alert.show( Logged In already! ); return; } } The delegate is below: public function LoginDelegate( responder : Responder ) { this.service = ServiceLocator.getInstance().getService( UserManager ); this.responder = responder; } public function doLogin(loginName:String, password:String) : void { var call : Object = service.login(loginName,password); call.resultHandler = responder.onResult; call.faultHandler = responder.onFault; } I must be doing something wrong here. But basically I am getting lost trying to pass the values of those two text boxes, and getting them all the way through this methodology to the remote object service i am going to call. It looks for two parameters, loginName and password, and in this test case loginName actually equals the string loginName thats the value. I have traced the debugger and even gone through the cairngorm ASDoc stuff, and cannot figure out what I am doing wrong. It mentions the data attribute, and when I pass into the execute function on the command, event.data or event.data.loginName I dont get a compile time error. However nothing is being passed to the service. When I look at the debugger trace I see that event does have a event.data attribute, but its undefined, and also that event has a event.loginName, and a event.password. Note this is correct, its not event.data.loginName, but rather event.loginName, and the value is there from those text boxes. So it is there, but it dont work. If I pass into the command, event.loginName I get a compile time error. However it shows in the debugger as being there. I dont get it. I am a newbie to OOP and flex and java, so this could be a really stupid question. Any help would be greatly appreciated. -- 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 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] Re: Cairngorm / Hibernate Best Practices
See below for a good discussion on this: http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=60; catid=583threadid=1169760enterthread=y#4195442 Jeff Vroom's responses (especially the second one) should help you get started. The SpringFactory is available to download at the Adobe Exchange: http://www.adobe.com/cfusion/exchange/index.cfm#loc=en_usview=sn611vie wName=Flex%20Extensionauthorid=70170511page=0scrollPos=0subcatid=0s nid=sn611itemnumber=0extid=1035406catid=0 -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of dreuimar Sent: Thursday, August 31, 2006 5:35 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Cairngorm / Hibernate Best Practices Thanks for the info, I've actually been using Spring predominantly for my standard J2EE web apps, but haven't used it with Flex. I know it's possible, and have been thinking of doing a Flex/Spring/Hibernate setup, but haven't yet. Is it difficult to use Spring with Flex, and where would I go to begin? Also, 4 years of a going to a Liberal Arts school forces archaic words like 'hitherto' into your vocabulary, haha. --- In flexcoders@yahoogroups.com, e baggg [EMAIL PROTECTED] wrote: Brennan, I haven't seen the word Hithero used since I was forced to read Shakespeare back in high school. Way to bring it back! Anyway, Adobe has provided Hibernate support via the Hibernate Assembler: http://livedocs.macromedia.com/flex/2/fds2javadoc/flex/data/assemblers/H ibernateAssembler.html I actually created an app that is front-to-end using the RemoteObject. I have my Java pojos which are mapped to my hibernate mapping files and I also have the AS classes that correlate to them too, using the: [Managed] [RemoteClass(alias=com.project.MyClass)] I pass all my objects to a pojo facade class which in turns invokes my Sprign beans. Within the facade, all the hibernate and trasactions are taken care. My objects are pretty light, so to avoid lazy-loading issues on the client side, i set lazy=false at the class level for all my hibernate mappings. This works well for me and I have not faced any performance issues. - Stay in the know. Pulse on the new Yahoo.com. Check it out. -- 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 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 * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
RE: [flexcoders] Isnt there *any* hello world/getting started doc for cairngorm???
Hi Hank, Alex Uhlmann has posted some simple demos to his blog: http://weblogs.macromedia.com/auhlmann Paul -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of hank williams Sent: Sunday, August 06, 2006 10:02 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Isnt there *any* hello world/getting started doc for cairngorm??? Ok so I downloaded caringorm and installed. Now what? There is API doc, but that is really not useful until you know what you are doing and you just need to remember the API. There is this 6 part article on the adobe website. But it is far from a hello world. It discusses theory, which is useful. But a simple, complete example (like in the flex getting started docs) would be much more helpful. It seems to refer to a store application, but as far as I can tell, this store application is not included with caringorm. So I am just looking for a simple example hello world application and an explanation of how it works. Does this really not exist, or have I just missed it? Hank -- 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 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 * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
RE: [flexcoders] Binding from Actionscript
Hi Alberto, From what I can tell, it seems you use bindSetter to bind to an ordinary function. If you want to bind to a 'set' function you actually need to use bindProperty (because 'set' functions are treated as properties). See the demo app I have pasted below that shows both approaches. Paul ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=vertical creationComplete=handleCreationComplete() mx:Label text=Input: / mx:TextInput id=textInput/ mx:Label text=Bound To Property: / mx:Label id=propertyOutput/ mx:Label text=Bound To Function: / mx:Label id=setterOutput/ mx:Script ![CDATA[ import mx.binding.utils.*; public function set myTextSetter( text : String ) : void { propertyOutput.text = text; } public function myText( text : String ) : void { setterOutput.text = text; } public function handleCreationComplete() : void { BindingUtils.bindProperty( this, myTextSetter, textInput, text, false ); BindingUtils.bindSetter( myText, textInput, text, false ); } ]] /mx:Script /mx:Application -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Alberto Albericio Sent: Tuesday, July 18, 2006 10:20 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Binding from Actionscript Hello all, I have an MXML component that has an mxml binding to a setter function like this: mx:Binding source=model.podManager.getPod( mypodId ).destroy destination=handleDestroy / and a setter function defined : private function set handleDestroy( destroy:Boolean ): void { // some code } This works 100% but I need to create this binding in an actionscript component; I have tried the following: BindingUtils.bindSetter( handleDestroy, model.podManager.getPod( this.mypodId ), destroy, false ); and having the same setter function. It complains about the setter function. If I remove the set keyword (on the setter function) it compiles but does nothing ( the binding doesnt seem to enter the function ) How can I create this binding from actionscript? Can someone give a working example on how to create a binding to a setter function in actionscript? It should be easy but I have found no documentation at all on this. I need the help of an expert. Thank you very much. Alberto -- 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 Yahoo! Groups Sponsor ~-- Something is new at Yahoo! Groups. Check out the enhanced email design. http://us.click.yahoo.com/SISQkA/gOaOAA/yQLSAA/nhFolB/TM ~- -- 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 * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
RE: [flexcoders] RE: Adding columns dynamically in a datagrid
Title: RE: Adding columns dynamically in a datagrid Hi Sathish, You need to build your new columns array locally in the function and then assign this array to dataGrid.columns. This is because the columns property returns a copy of the DataGrids columns array. Eg: var newColumns : Array = new Array(); // Add all your new columns to the newColumns array myGrid.columns = newColumns; Paul From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Pottavathini, Sathish Sent: Wednesday, July 19, 2006 7:51 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] RE: Adding columns dynamically in a datagrid Sample Code: var len:int = xml_itemCount.children()[0].children().length(); var ttle:String = ''; grid_Reports.columns = []; for (var i:int=0; ilen; i++) { var itm:Object = xml_itemCount.children()[0].children()[i]; ttle = [EMAIL PROTECTED]; if (ttle.length == 0) ttle = itm.name(); trace(itm.name() + = + itm.text()); var tmp:DataGridColumn = new DataGridColumn(itm.name()); tmp.dataField = itm.name(); tmp.headerText = ttle + - + i; grid_Reports.columns[i] = tmp; trace(grid_Reports.columns.length); } _ From: Pottavathini, Sathish Sent: Wednesday, July 19, 2006 11:48 AM To: flexcoders@yahoogroups.com Subject: Adding columns dynamically in a datagrid I have a datagrid and the data loaded into it is dynamic. The number of columns are also different each time. So I am trying to read the xml data that is used for the datagrid and create columns at run time using 'columns' property of the datagrid. But for some reason it's not creating those columns in datagrid. Am I missing anything? Any sample code for this kinda thing? Thanks Sathish __._,_.___ -- 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. __,_._,___
RE: [flexcoders] how do you dispatch event from a custom class?
includeInLayout=false visible=false/ mx:Label text=Object3 was created on DisplayList in MXML/ mx:Button label=Generate Event click=customObject3.generateEvent()/ mx:TextArea height=500 width=300 id=text3/ /mx:VBox /mx:Application == CustomClass.as == package { import mx.core.UIComponent; import flash.events.Event; public class CustomClass extends UIComponent { public static const MY_CUSTOM_EVENT : String = MyCustomEvent; public function generateEvent() : void { dispatchEvent( new Event( MY_CUSTOM_EVENT, true, false ) ); } } } -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jon Hirschi Sent: Saturday, June 24, 2006 12:54 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] how do you dispatch event from a custom class? is there anyway to enter an event into the event stream without a class being a display object? ie, not having it in the display list? --- Ralf Bokelberg [EMAIL PROTECTED] wrote: Either by instantiating it in mxml or explicitely by adding it using container.addChild. Cheers, Ralf. On 6/24/06, Jon Hirschi [EMAIL PROTECTED] wrote: I tried what you said and attempted to have the WebServiceCheck itself dispatch the event, however, it doesn't dispatch anything into the event stream, even attaching an event listener to the variable return variable doesn't do anything. How do I make it part of a displaylist?? --- Ralf Bokelberg [EMAIL PROTECTED] wrote: Hello Paul In your code you are creating a separate EventDispatcher, which is not part of any displaylist. If you let your WebServiceCheck dispatch the event instead, it should work. At least as long as it is part of a displaylist. Cheers, Ralf. On 6/23/06, Jon Hirschi [EMAIL PROTECTED] wrote: Hi Paul, So I'm putting my event listener in the application core. What I would like is for this event to enter the event stream and bubble up to the application core. Currently, it doesn't look like it even makes it out of the document that I'm in. I'm not even sure that it gets populated outside of the class itself. What i'd really like is to have this event entered automatically into the event stream with out having to have an event repeater. --- Paul Williams [EMAIL PROTECTED] wrote: Hi Jon, Sprite extends EventDispatcher, so you don't need to instantiate another EventDispatcher in your class. Instead, try the following: this.dispatchEvent(new Event(AuthenticationFailed,true,false)); If you still have problems can you let us know what object you are creating your event listener on? Paul -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jon Hirschi Sent: Thursday, June 22, 2006 9:45 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] how do you dispatch event from a custom class? I have a custom class that I want to be able to dispatch an event. However, it's not entering the event into the event stream, I don't even think the event is getting out of the class. I have bubbles set to true. does anyone know how to get the event entered into the event stream... the docs aren't very explicit on this subject ie code to call my class... private function handleLBResponse(eventObj:ResultEvent):void { var tempArray:Array; var checkResult:WebServiceCheck = new WebServiceCheck(); if (checkResult.checkServiceReturnStatus(eventObj,true)) { tempArray = mx.utils.ArrayUtil.toArray(eventObj.result.lbvServerTos); if (tempArray.length 1) { dpLBVServerData.source = tempArray; } else { dpLBVServerData.removeAll(); } } else { dpLBVServerData.removeAll(); } } -- code in the class --- package comp.webconfig.services { import flash.display.Sprite; import mx.rpc.events.ResultEvent; import mx.controls.Alert; import flash.events.Event; import flash.events.EventDispatcher; public class WebServiceCheck
RE: [flexcoders] how do you dispatch event from a custom class?
Hi Jon, Sprite extends EventDispatcher, so you don't need to instantiate another EventDispatcher in your class. Instead, try the following: this.dispatchEvent(new Event(AuthenticationFailed,true,false)); If you still have problems can you let us know what object you are creating your event listener on? Paul -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jon Hirschi Sent: Thursday, June 22, 2006 9:45 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] how do you dispatch event from a custom class? I have a custom class that I want to be able to dispatch an event. However, it's not entering the event into the event stream, I don't even think the event is getting out of the class. I have bubbles set to true. does anyone know how to get the event entered into the event stream... the docs aren't very explicit on this subject ie code to call my class... private function handleLBResponse(eventObj:ResultEvent):void { var tempArray:Array; var checkResult:WebServiceCheck = new WebServiceCheck(); if (checkResult.checkServiceReturnStatus(eventObj,true)) { tempArray = mx.utils.ArrayUtil.toArray(eventObj.result.lbvServerTos); if (tempArray.length 1) { dpLBVServerData.source = tempArray; } else { dpLBVServerData.removeAll(); } } else { dpLBVServerData.removeAll(); } } -- code in the class --- package comp.webconfig.services { import flash.display.Sprite; import mx.rpc.events.ResultEvent; import mx.controls.Alert; import flash.events.Event; import flash.events.EventDispatcher; public class WebServiceCheck extends Sprite { public var isSuccess:Boolean; public var statusType:String; public var message:String; public var rawMessage:String; public function WebServiceCheck() { } public function checkServiceReturnStatus(resultToCheck:ResultEvent,alertOnError:Boolean= false):Boolean { var myMessage:String; var isSuccess:Boolean = true; var myRawMessage:String; var myRawStatus:String; var dispatcher:EventDispatcher = new EventDispatcher(); if (resultToCheck.result != null) { if (resultToCheck.result.requestMessage != null) { myRawMessage = resultToCheck.result.requestMessage; } if (resultToCheck.result.requestStatus) { myRawStatus = resultToCheck.result.requestStatus; } } if (myRawStatus != null) { switch (myRawStatus) { case Failed : // do something here like popup a message myMessage = Sorry, there was an error trying to access the information you requested. \n\n myMessage += myRawMessage; isSuccess = false; break; case Unauthorized : // do something here... like popup a message myMessage = Sorry, you were not authorized to access the information you requested. \n\n myMessage += myRawMessage; isSuccess = false; break; case AuthenticationFailed : dispatcher.dispatchEvent(new Event(AuthenticationFailed,true,false)); myMessage = Sorry, you are either not Logged in, or you have been logged out. \n\n myMessage += myRawMessage; isSuccess = false;
RE: [flexcoders] Re: need strategy for filtering ArrayCollections in a Cairngorm app
Hi Tom, A nice way to do this is to create a master that is an ArrayCollection, and then for each of your filtered lists you use a ListCollectionView. When you create your ListCollectionView you pass your master list in as a constructor parameter (because ArrayCollection implements Ilist). You can then add a filter function to each of your filtered lists without affecting the master. Each ListCollectionView will listen to the underlying IList for changes, so these should come through immediately (if they get past the filter!). There's a very simple demo for beta 3 below. Does this solve your problem? Paul ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=horizontal creationComplete=initialise() mx:Script ![CDATA[ import mx.collections.ArrayCollection; import flash.utils.Timer; [Bindable] public var master : ArrayCollection = new ArrayCollection(); [Bindable] public var slave1 : ListCollectionView = new ListCollectionView(master); [Bindable] public var slave2 : ListCollectionView = new ListCollectionView(master); [Bindable] public var slave3 : ListCollectionView = new ListCollectionView(master); public var value : int = 0; public function initialise() : void { slave1.filterFunction = filterOdd; slave1.refresh(); slave2.filterFunction = filterEven; slave2.refresh(); slave3.filterFunction = filterDivBy5; slave3.refresh(); var timer : Timer = new Timer( 200, 50); timer.addEventListener( timer, addValue); timer.start(); } public function addValue( event : Event ) : void { master.addItem( ++value ); } public function filterOdd( item : Object ) : Boolean { var value : int = int(item); return value % 2 == 1 } public function filterEven( item : Object ) : Boolean { var value : int = int(item); return value % 2 == 0 } public function filterDivBy5( item : Object ) : Boolean { var value : int = int(item); return value % 5 == 0 } ]] /mx:Script mx:VBox mx:Label text=Master List/ mx:List dataProvider={ master } height=400/ /mx:VBox mx:VBox mx:Label id=slave1Label text=Odd/ mx:List dataProvider={ slave1 } height=400/ /mx:VBox mx:VBox mx:Label id=slave2Label text=Even/ mx:List dataProvider={ slave2 } height=400/ /mx:VBox mx:VBox mx:Label id=slave3Label text=Divisible by 5/ mx:List dataProvider={ slave3 } height=400/ /mx:VBox /mx:Application From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jeremy Lu Sent: Saturday, June 10, 2006 4:13 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Re: need strategy for filtering ArrayCollections in a Cairngorm app very interesting... why not trigger a global ArrayChangedEvent so each fitlered ArrayCollection can update itself according to it ? (with some binding settings this should be feasible) the trigger point is: when new data are pushed into MasterArray, dispatch it. Tom: if you have some sample code, I can give it a try. On 6/10/06, Tim Hoff [EMAIL PROTECTED] wrote: I'll have to take your word on that, but I'm still skeptical. If what you say is true, then you could still use the same approach, but instead have the view listen for updates to the masterArray in the ModelLocator. You could do this either by using the changWatcher utility or Paul Williams' Observe tag: http://weblogs.macromedia.com/paulw/ When your view hears a change to the masterArray, you would then refresh the ArrayCollection. It's a little cumbersome, but since direct binding doesn't want to work for you, it might be a necessary step. -TH --- In flexcoders@yahoogroups.com, Tom Bray [EMAIL PROTECTED] wrote: Thanks for trying. An ArrayCollection will not reflect changes made directly to its source array, so new items pushed onto masterArray do not show up in my views. -Tom On 6/9/06, Tim Hoff [EMAIL PROTECTED] wrote: Changes to the masterArray
RE: [flexcoders] Cairngorm best practice with Tree data [f2b3]
Hi Rick, Graham, >From an MVC point of view, you should really be updating your model, and the tree should detect those updates and display them (via binding). However, there are two known bugs in beta 3 that may cause you problems: 1) The tree does not respond correctly to update events from the collection classes. 2) The collection classes are not detecting changes to objects they contain even if the objects are Bindable. I think you will need some representation of your server-side data model on the client (accessible via ModelLocator), but it is your choice whether you use XML or a hierarchical collection of bindable ActionScript objects. Whichever you choose, you should be able to manipulate your model or refresh it from the server and the tree should update itself automatically (once the above issues are resolved). My colleague, Peter Martin has recently blogged about automatically generating ActionScript VOs from Java classes using XDoclet2. You may find this useful: http://weblogs.macromedia.com/pmartin/archives/2006/04/xdoclet_woes.cfm I hope this helps, Paul -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Rick Schmitty Sent: Wednesday, May 24, 2006 4:25 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Cairngorm best practice with Tree data [f2b3] I would also be interested and appreciate advice on this topic On 5/23/06, Graham Weldon [EMAIL PROTECTED] wrote: Hi all, I'm messing with Cairngorm 2.0 beta, and Flex 2.0 beta 3. I've got a mx:Tree / that contains a structured set of data. This data can be subjected to an insert at any point. I have correctly setup the events, commands and delegate to deal with the insertion, and I process the logical insertion on the server side of this application without issues. The trouble I am having now is the graphical insertion of the new item into the existing model. Currently the data is XML based. The Tree is directly data bound to an XMLListCollection object. One thought I had was to model the entire tree as ValueObjects, so that I could traverse the tree and 'addChild()' where necessary, but this would be a complete replication of my Server-Side java code on the client side, just for insertion. Additionally, I am not sure how i would use a complex set of chained Value Objects as a data source for a Tree GUI component. Any information about this would be really helpful. I appreciate any advice. I can display the tree correctly, I can use information from the selected item to perform operations etc. I am interested in inserting a new item at a specified location. For example, a request to insert an item will result in XML data describing the insert: Regards, Graham Weldon. XML Tree INSERTION data Sample command action="" success=true addTreeItem parent=123 element label=NEWitem id=/ /addTreeItem addTreeItem parent=380 element label=deepItem id=12/ /addTreeItem /command XML Tree Data Sample tree element label=one id=123/ element label=two id=122/ element label=eight id=897 element label=hello id=113/ element label=world id=198 element label=thing id=380/ /element /element /tree ModelLocator ... snip ... public var myTreeData : XMLListCollection = new XMLListCollection(); ... snip ... Application.mxml ... snip ... myComponents:TreeComponent dataProvider={ModelLocator.myTreeData}/ ... snip ... -- 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 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.
RE: [flexcoders] Wanted - A simple WSDL example
Hi Judah, Try the following tutorial in the Flex Builder help: Adobe Flex 2.0 Help Getting Started with Flex 2.0 Tutorials Data: Use Web Services Paul From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of judah Sent: Tuesday, May 16, 2006 6:00 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Wanted - A simple WSDL example That is an awesome link. I will use that. My problem is getting them to work in Flex. This is really a newbie question but I don't know how to take that information on that site and put it into Flex. I've looked at the help, I've tried to apply it and I cannot see what I'm doing wrong. I'm pulling out my hair (insert hair pulling emoticon here). Here is my code: ?xml version=1.0? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml mx:WebService id=WeatherService wsdl=http://www.jasongaylord.com/webservices/zipcodes.asmx?wsdl result=successfulCall(); fault=errorCall(); useProxy=false mx:operation name=ZipCodeToDetails mx:request ZipCode{zipCode.text}/ZipCode /mx:request /mx:operation /mx:WebService mx:Script ![CDATA[ private function processValues():void { //mx.controls.Alert.show(Sending data!, Alert Box, mx.controls.Alert.OK); // Check to see if ZIP code is valid. WeatherService.GetWeather.send(); } private function successfulCall():void { mx.controls.Alert.show(Web service sucessful!, Alert Box, mx.controls.Alert.OK); vs1.selectedIndex=1; } private function errorCall():void { mx.controls.Alert.show(Web service failed!, Alert Box, mx.controls.Alert.OK); } ]] /mx:Script mx:ViewStack id=vs1 mx:Form mx:FormItem label=Zip Code mx:TextInput id=zipCode width=200 text=50613/ mx:Button width=60 label=Submit click=processValues();/ /mx:FormItem /mx:Form mx:VBox mx:TextArea text={WeatherService.GetWeather.result.CityShortName}/ mx:TextArea text={WeatherService.GetWeather.result.CurrentTemp}/ /mx:VBox /mx:ViewStack /mx:Application John C. Bland II wrote: Anytime I need to look at or test a wsdl I always go to xmethods.net. On 5/15/06, judah [EMAIL PROTECTED] wrote: I am looking for an super simple working example of an WSDL. I tried to get the one in the help files working and I get no response success or fail. I've spent a day working on this and found out the wsdl url is fake and found plenty of other WSDLs online, looked at the xml but get fail response on all of them. heres the article in the help file i'm looking at: http://livedocs.macromedia.com/labs/1/flex20beta3/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Partsfile=0700.html Judah -- Always bear in mind that your own resolution to succeed is more important than any one thing. You can have anything you want - if you want it badly enough. You can be anything you want to be, do anything you set out to accomplish if you hold to that desire with singleness of purpose. - Abraham Lincoln -- 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 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 . -- John C. Bland II I do what I can do when I can do it. - Chris Tucker, Money Talks http://www.gotoandstop.org - Home of FMUG.az -- Always bear in mind that your own resolution to succeed is more important than any one thing.You can have anything you want - if you want it badly enough. You can be anything you want to be, do anything you set out to accomplish if you hold to that desire with singleness of purpose. - Abraham Lincoln -- 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.
RE: [flexcoders] A new Kid
The tutorials in Getting started with Flex are suitable for absolute beginners. You can find these in the Flex Builder help or online at: http://labs.adobe.com/wiki/index.php/Flex:Release_Notes#Beta_3_documentation Paul From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of jeremy lu Sent: Saturday, May 13, 2006 6:14 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] A new Kid there are several sample projects in flex sdk, take a look in the install folder. On 5/13/06, readversetwo [EMAIL PROTECTED] wrote: Can anybody provide some hints on what to do to get acquanted with Flex? A small project that I can start with will begreat idea! Does anybody have the source of a small project that runs successfully? Thank you. Peace Yahoo! Groups Sponsor ~-- Get to your groups with one click. Know instantly when new email arrives http://us.click.yahoo.com/.7bhrC/MGxNAA/yQLSAA/nhFolB/TM ~- -- 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 * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/ -- 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.
RE: [flexcoders] Flex2B3 - Drag And Drop - Drop Into Tree (different from B2)
Hi Jason, I've raised a bug regarding the location of the default drop feedback bar in the Tree control. Thanks, Paul -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jason Hawryluk Sent: Thursday, May 11, 2006 12:22 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Flex2B3 - Drag And Drop - Drop Into Tree (different from B2) I've been having allot of problems as well with the tree and drag drop operations. Specifically if the fact that the tree does not update properly now, as it did before with relation to it's data source. Also I'm finding that the drop indicator is all over the place. Are you experiencing the same problems ? Anyway to answer your question: the below line should give you the node your over. var currNodeOver:Object = currTree.indexToItemRenderer(currTree.calculateDropIndex(event)).data; then to get the drop parent would be something like var myparent:object = getParentItem(currNodeOve); Hope that helps. Jason -Message d'origine- De : flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] la part de Andrea Varga Envoyé : jeudi 11 mai 2006 10:42 À : flexcoders@yahoogroups.com Objet : [flexcoders] Flex2B3 - Drag And Drop - Drop Into Tree (different from B2) Hi All I'm having difficulty with the drop part of the drag and drop in a Tree in B3. I have my tree defined this way: mx:Tree id=myTree dataProvider={myTreeData} dragEnter=doDragEnterTree(event); dragDrop=doDragDropTree(event);/ And I have this method for dragDrop: private function doDragDropTree(event:DragEvent):void { trace(DROP IN TREE index: + myTree.calculateDropIndex(event)); } This works well. My problem is: I want to know WHERE exacty the drop was fired (where did the user released the mouse button) to know where the insert my new item. The calculateDropIndex works well for List type components, but for a Tree it is useless. It returns a level number. In B2 the Tree had a method Tree.getDropParent(event), I suppose this returned what I was looking for, but in B3 the Tree has no such a method. In Flex Beta 2 to Beta 3 Changes it says: Tree.getDropParent(event) - Use Tree.getParentItem(item:Object):*. But I don't understand the logic here. getParentItem() has as parameter item:Object, and I don't kno that, I know just an event, I want to find out the item:Object. What is the solution here? Thanks for your help! Andi PS. My messages appear on the list with more than 8 hours delay Why? -- 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. -- 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 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.
RE: [flexcoders] Current Node in tree when drop
Yes - you can download it from labs.adobe.com. If you are using beta 2 and you don't want to migrate right away, use the getDropLocation() method of the tree object. As far as I can tell this method was renamed to calculateDropIndex() for beta 3. Paul -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Franca Daniel Sent: Tuesday, May 09, 2006 10:14 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Current Node in tree when drop --- Paul Williams [EMAIL PROTECTED] escreveu: Hey Paul, Thank you once more ! is Beta 3 Avaliable ? CYA! - Hi Franca, I was hoping to try this out myself before replying, but I haven't as yet. Anyway for beta 3, there is a method on the tree object called calculateDropIndex() which (according to the docs) you should be able to call from your dragOver and dragDrop handlers to work out the drop location within the tree. Paul -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Franca Daniel Sent: Tuesday, May 09, 2006 3:19 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Current Node in tree when drop How can i get current node of the Tree when i drop a element from grid to that Tree ? Help please, Thank you! ___ Navegue com o Yahoo! Acesso Grátis, assista aos jogos do Brasil na Copa e ganhe prêmios de hora em hora! http://br.yahoo.com/artilheirodacopa/ -- 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 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. - ___ Novo Yahoo! Messenger com voz: Instale agora e faça ligações de graça. http://br.messenger.yahoo.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 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.
RE: [flexcoders] Current Node in tree when drop
Hi Franca, I was hoping to try this out myself before replying, but I haven't as yet. Anyway for beta 3, there is a method on the tree object called calculateDropIndex() which (according to the docs) you should be able to call from your dragOver and dragDrop handlers to work out the drop location within the tree. Paul -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Franca Daniel Sent: Tuesday, May 09, 2006 3:19 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Current Node in tree when drop How can i get current node of the Tree when i drop a element from grid to that Tree ? Help please, Thank you! ___ Navegue com o Yahoo! Acesso Grátis, assista aos jogos do Brasil na Copa e ganhe prêmios de hora em hora! http://br.yahoo.com/artilheirodacopa/ -- 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 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.
RE: [flexcoders] Re: Drag Drop conundrum... BUG?
Hi Martin, Did you see my previous reply? I've pasted it below. Thanks, Paul Previous reply: === Hi Martin, Can you post your code? Another guess: Are you using an Array or an ArrayCollection as your dataprovider? My understanding is that you must use an ArrayCollection if you want updates to propagate to the control, see below for more: http://livedocs.macromedia.com/flex/20beta1/docs/wwhelp/wwhimpl/common/h tml/wwhelp.htm?context=LiveDocs_Partsfile=2088.html Paul -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of flexabledev Sent: Sunday, April 23, 2006 10:23 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Drag Drop conundrum... BUG? I am still having a problem. This looks like it might be a bug? Once I set dropEnabled to false, I can see (while debugging) that the contents of the Array after the Drop were Correct, i.e. no [object Object] items in the List. So far so good... BUT!!! Once it is set to false the List does not reflect the contents of the Array (it's dataProvider) after the Drop. I tested this in two ways: 1. I Initialized the [Bindable] Array to contain values before the Drop. They show up in the List as expected but when I Drop an item nothing changes! In debug mode, though, the Array contains both the initialized values and the drop items. 2. When I set dropEnabled back to true, the drop items show up in the list, but so does the default [object Object] for each drop item. This now looks like a bug to me, that somehow the list control does not get notified of change to the dataProvider. To test this, I added a button that manually adds a value to the Array and the List still does not reflect the change to it's dataProvider. Any Ideas? Thanks... Martin --- In flexcoders@yahoogroups.com, Paul Williams paulw@ wrote: Just a guess, but one possibility is that your list's default drop behaviour is switched on, i.e. on the list control, dropEnabled=true. This could cause the item to be added twice, once by your event handler and once by the default drop behaviour. Paul -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of flexabledev Sent: Saturday, April 22, 2006 9:38 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Drag Drop conundrum... I've started to experiment with Drag Drop and have run into a problem I can't figure out. I have successfully written code that allows me to Drag rows from a DataGrid (with a custom Drag Proxy) and Drop the value of one of the columns into a List. The only thing I don't understand is why when I do a Drag Drop, I always get two entries in the List for each of the rows that were dragged. If I drag two rows with String values that get dropped (i.e. ONE, TWO), the result in the List after the Drop looks like: [object Object] [object Object] ONE TWO When I debug it, the value of items.length equals 2 which drives a For loop with IList(dropTarget.dataProvider).addItem(items[i].field); As I step through the doDragDrop function in debug mode, it only executes the loop twice, yet I end up with four entries in the List? Any ideas? I can't figure it out, but it feels like there is some default behaviour (dropping the items Object separate from my addItem) occuring that I don't see when I step through it in debug mode? -- 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 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 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.
RE: [flexcoders] Re: Drag Drop conundrum... BUG?
Hi Martin, Can you post your code? Another guess: Are you using an Array or an ArrayCollection as your dataprovider? My understanding is that you must use an ArrayCollection if you want updates to propagate to the control, see below for more: http://livedocs.macromedia.com/flex/20beta1/docs/wwhelp/wwhimpl/common/h tml/wwhelp.htm?context=LiveDocs_Partsfile=2088.html Paul -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of flexabledev Sent: Saturday, April 22, 2006 11:27 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Drag Drop conundrum... BUG? Paul, Thanks! I didn't know that you did not need to set dropEnabled=true if you also set dragEnter and dragDrop handlers. I just assumed that you always needed to set dropEnabled, even if you write your own drag behaviour... Once I set dropEnabled to false, I can see (while debugging) that the contents of the Array after the Drop were Correct, i.e. no [object Object] items in the List. So far so good... BUT!!! Once it is set to false the List does not reflect the contents of the Array (it's dataProvider) after the Drop. I tested this in two ways: 1. I Initialized the [Bindable] Array to contain values before the Drop. They show up in the List as expected but when I Drop an item nothing changes! In debug mode, though, the Array contains both the initialized values and the drop items. 2. When I set dropEnabled back to true, the drop items show up in the list, but so does the default [object Object] for each drop item. This now looks like a bug to me, that somehow the list control does not get notified of change to the dataProvider. To test this, I added a button that manually adds a value to the Array and the List still does not reflect the change to it's dataProvider. Any Ideas? Thanks... Martin --- In flexcoders@yahoogroups.com, Paul Williams [EMAIL PROTECTED] wrote: Just a guess, but one possibility is that your list's default drop behaviour is switched on, i.e. on the list control, dropEnabled=true. This could cause the item to be added twice, once by your event handler and once by the default drop behaviour. Paul -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of flexabledev Sent: Saturday, April 22, 2006 9:38 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Drag Drop conundrum... I've started to experiment with Drag Drop and have run into a problem I can't figure out. I have successfully written code that allows me to Drag rows from a DataGrid (with a custom Drag Proxy) and Drop the value of one of the columns into a List. The only thing I don't understand is why when I do a Drag Drop, I always get two entries in the List for each of the rows that were dragged. If I drag two rows with String values that get dropped (i.e. ONE, TWO), the result in the List after the Drop looks like: [object Object] [object Object] ONE TWO When I debug it, the value of items.length equals 2 which drives a For loop with IList(dropTarget.dataProvider).addItem(items[i].field); As I step through the doDragDrop function in debug mode, it only executes the loop twice, yet I end up with four entries in the List? Any ideas? I can't figure it out, but it feels like there is some default behaviour (dropping the items Object separate from my addItem) occuring that I don't see when I step through it in debug mode? -- 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 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 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.
RE: [flexcoders] Drag Drop conundrum...
Just a guess, but one possibility is that your list's default drop behaviour is switched on, i.e. on the list control, dropEnabled=true. This could cause the item to be added twice, once by your event handler and once by the default drop behaviour. Paul -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of flexabledev Sent: Saturday, April 22, 2006 9:38 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Drag Drop conundrum... I've started to experiment with Drag Drop and have run into a problem I can't figure out. I have successfully written code that allows me to Drag rows from a DataGrid (with a custom Drag Proxy) and Drop the value of one of the columns into a List. The only thing I don't understand is why when I do a Drag Drop, I always get two entries in the List for each of the rows that were dragged. If I drag two rows with String values that get dropped (i.e. ONE, TWO), the result in the List after the Drop looks like: [object Object] [object Object] ONE TWO When I debug it, the value of items.length equals 2 which drives a For loop with IList(dropTarget.dataProvider).addItem(items[i].field); As I step through the doDragDrop function in debug mode, it only executes the loop twice, yet I end up with four entries in the List? Any ideas? I can't figure it out, but it feels like there is some default behaviour (dropping the items Object separate from my addItem) occuring that I don't see when I step through it in debug mode? -- 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 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.