[flexcoders] Distortion Effects?
Hi, I am trying to use the following example from Tour De Flex but it's missing some of the files needed to run the example. Here is a link to the demo that shows the functionality I'm trying to use: http://www.adobe.com/devnet/flex/tourdeflex/web/#sampleId=19260;illustIn\ dex=0;docIndex=0 http://www.adobe.com/devnet/flex/tourdeflex/web/#sampleId=19260;illustI\ ndex=0;docIndex=0 The problem is when you download the files, the mxeffects package is missing. So when I do: import com.adobe.ac.mxeffects.Distortion; import com.adobe.ac.mxeffects.DistortionConstants; it doesn't work. Does anyone have a link to these files? The original link from Alex Uhlmann doesn't work: http://weblogs.macromedia.com/auhlmann/archives/DistortionEffects.zip http://weblogs.macromedia.com/auhlmann/archives/DistortionEffects.zip Any help highly appreciated. Thanks, :)
[flexcoders] Re: Distortion Effects?
Hi, Thanks for the reply, that would be great. You can send it to malik_robin...@yahoo Thanks, m --- In flexcoders@yahoogroups.com, Pedro Sena sena.pe...@... wrote: I don't have the link here but I'm using in my actual project. I'm sending it to your personal mail. I will not attach it here to avoid problems with zipped files. Regards On Tue, Aug 4, 2009 at 4:56 PM, malik_robinson malik_robin...@...wrote: Hi, I am trying to use the following example from Tour De Flex but it's missing some of the files needed to run the example. Here is a link to the demo that shows the functionality I'm trying to use: http://www.adobe.com/devnet/flex/tourdeflex/web/#sampleId=19260;illustIndex=0;docIndex=0 The problem is when you download the files, the mxeffects package is missing. So when I do: import com.adobe.ac.mxeffects.Distortion; import com.adobe.ac.mxeffects.DistortionConstants; it doesn't work. Does anyone have a link to these files? The original link from Alex Uhlmann doesn't work: http://weblogs.macromedia.com/auhlmann/archives/DistortionEffects.zip Any help highly appreciated. Thanks, :) -- /** * Pedro Sena * Systems Architect * Sun Certified Java Programmer * Sun Certified Web Component Developer */
[flexcoders] TreeItemRenderer giving me problems
Hi, I am getting an error trying to create my own TreeItemRenderer. I get an error saying Error: 1023 Incompatible override. This is a compile time error. It points to my override function at least in FlexBuilder. My renderer is just a skeleton as of now but this error is preventing me from going on. Anyone seen this? I am using Flex 3 package { import mx.controls.treeClasses.TreeItemRenderer; import mx.controls.Image; import mx.controls.Tree; public class CustomTreeItemRenderer extends TreeItemRenderer { protected var _tree:Tree; protected var iconImage:Image; public function CustomTreeItemRenderer(){ super(); mouseEnabled = false; } override protected function createChildren():void{ super.createChildren(); } } } // close package
[flexcoders] **View States Problem**
Hi, I am using Flex 3 I am trying to use view states in my Flex application. My code seems to work fine when I just have two view states, but when I have 3 states (including the base state), the screen never displays all 3 at the same time. I am displaying these states based on the result of a remote call, that part works fine so the remoting part of it is not the problem. In Flexbuilder 3 if I go into design view, I can traverse through the states (base, state2, state3), and the visual displays look correct. Anyone have any idea or thoughts? Here is my code below: mx:states mx:State name=state2 mx:AddChild relativeTo={frm} position=lastChild mx:FormItem label=Select Sub Area: mx:ComboBox id=cb2 dataProvider={subAreaAC} labelField=state2 width=216 left=10 top=40 minWidth=150 / /mx:FormItem /mx:AddChild /mx:State mx:State name=state3 basedOn=state2 mx:AddChild relativeTo={frm} position=lastChild mx:FormItem label=Select Sub-Sub Area: mx:ComboBox id=cb3 dataProvider={subSubAreaAC} labelField=state3 minWidth=150 / /mx:FormItem /mx:AddChild /mx:State /mx:states !-- this is basically my base state, this gets showed by default -- mx:Form id=frm x=10 y=10 mx:FormItem label=Select a Parent Category: mx:ComboBox id=cb1 labelField=ParentCategory width=150 left=10 top=40 dataProvider={catAC} rowCount={catAC.length / 2} / /mx:FormItem /mx:Form
[flexcoders] Return query from flex after file upload??
Hi, I am using Flex 3 and I would be quite grateful if someone can assist me here. I am trying to find out if I can return a query back to flex so I can populate this datagrid, but what makes this situation unique is I am uploading a csv file from flex and in ColdFusion converting it into query object (all this works), and lastly I want to return the query back to flex so I can populate the datagrid. Here is the code snippet: import mx.collections.ArrayCollection; import mx.rpc.events.ResultEvent; import flash.net.FileReference; private var _request:URLRequest = new URLRequest([L=http://localhost/demoApp/upload.cfc?method=doImport;);]ht\ tp://localhost/demoApp/upload.cfc?method=doImport);[/L] [Bindable] private var acContacts:ArrayCollection; /* gets called via a button click by the user*/ public function importContacts(): void{ _request.method = URLRequestMethod.POST; _request.data = params; _fileRef.upload(_request); /* here is where I am stuck, I want to populate the grid with the query*/ acContacts = ?? } mx:Button label=Import Contacts icon=@Embed(source='../assets/importIcon.png') click=importContacts()/ mx:DataGrid id=dgImportList dataProvider={acContacts} width=897 height=308 / I am not getting an error I just don't know how to have this function return my query object. Is this possible? Any help highly appreciated.
[flexcoders] Question on Accordion and Controlling Programmitacally
Hi, I am using an Accordion in my application. When the screen loads, it shows the first child in the accordion, this is fine. However, I have a form on this screen and I would like to user to submit that form first before going to any of the other children in the accordion. Once they submit the form, then they can click the other children, but I am trying to build this wizard and I would like them to fill out form 1 first, before seeing form child, 2, 3, 4, etc, etc. How can this be done? There must be a way to prevent the headers in the accordion from being clickable? Ideally, I could show an alert if the user clicked any of the other headings. -Malik
[flexcoders] Question on Accordion and Controlling Programmitacally
Hi, I am using an Accordion in my application. When the screen loads, it shows the first child in the accordion, this is fine. However, I have a form on this screen and I would like to user to submit that form first before going to any of the other children in the accordion. Once they submit the form, then they can click the other children, but I am trying to build this wizard and I would like them to fill out form 1 first, before seeing form child, 2, 3, 4, etc, etc. How can this be done? There must be a way to prevent the headers in the accordion from being clickable? Ideally, I could show an alert if the user clicked any of the other headings. -Malik
[flexcoders] How can I make the mx;Panel draggable?
Hi, I want to be able to drag this panel around sort of like a floating window. It should be able to be dragged and I guess dropped, not really like dragging a value from datagridA to datagridB but Just like in windows how you can drag a dialog box around I want to do the same in my app. How can I do this?? -Malik
[flexcoders] How can I make the mx;Panel draggable?
Hi, I want to be able to drag this panel around sort of like a floating window. It should be able to be dragged and I guess dropped, not really like dragging a value from datagridA to datagridB but Just like in windows how you can drag a dialog box around I want to do the same in my app. How can I do this?? -Malik
[flexcoders] Re: How can I make the mx;Panel draggable?
Hi, Somehow I have double posted, sorry about that, I am trying to make panel draggable via the title bar only. I meant to add that to my initial post. -westside --- In flexcoders@yahoogroups.com, malik_robinson [EMAIL PROTECTED] wrote: Hi, I want to be able to drag this panel around sort of like a floating window. It should be able to be dragged and I guess dropped, not really like dragging a value from datagridA to datagridB but Just like in windows how you can drag a dialog box around I want to do the same in my app. How can I do this?? -Malik
[flexcoders] Re: How can I make the mx;Panel draggable?
Hi, Somehow I have double posted, sorry about that, I am trying to make panel draggable via the title bar only. I meant to add that to my initial post. -westside --- In flexcoders@yahoogroups.com, malik_robinson [EMAIL PROTECTED] wrote: Hi, I want to be able to drag this panel around sort of like a floating window. It should be able to be dragged and I guess dropped, not really like dragging a value from datagridA to datagridB but Just like in windows how you can drag a dialog box around I want to do the same in my app. How can I do this?? -Malik
[flexcoders] Re: Populate Tree with data from a query?
Hi, I will try this tonight and see how it goes. It seems with RemoteObjects you can't have the resultFormat = e4x like you can with an HTTPService call. With e4x its much easier to get at the xml from what I understand. -Malik --- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] wrote: You will need a labelFunction() to define the label for complex xml. Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of jensen.axel Sent: Wednesday, February 07, 2007 3:33 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Populate Tree with data from a query? Malik, I'm not sure if your xml has to be formatted that way, depending on what your working with(if your getting your xml from a service that is already in place, and other code is already using that formatted xml) then you would be forced to use the xml as is... but if at all possible, try to format your xml this way companies company name=Macrosoft contact name=Bill Bates/ contact name=Mark Smith/ /company company name=Oracle Corporation contact name=Larry Jobs/ /company /companies now you can use the label=@name in your mx:Tree there are also some things you will definitely want to look at in the example on my blog... This issue was pondering me, so i made and example to see what was going on, and your right it is acting weird in the tree... so anyway check out the example... it's at the bottom of the page on my blog... it says CLICK HERE TO VIEW THE EXAMPLE http://axel.cfwebtools.com/index.cfm/2007/2/6/Returning-a-query-to-flex- as-xml http://axel.cfwebtools.com/index.cfm/2007/2/6/Returning-a-query-to-flex -as-xml I'm always looking for more subscribers and comments, so please subscribe... I usually put up and example on almost every post, unless i'm just throwing up a link i want to remember. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , malik_robinson Malik_Robinson@ wrote: Hi Tracy, When I do a trace as you indicated. I see this: companies company name=Macrosoft contact displayNameBill Bates/displayName /contact contact displayNameMark Smith/displayName /contact /company company name=Oracle Corporation contact displayNameLarry Jobs/displayName /contact /company /companies And this is what I see when my tree is rendered also. -Malik --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Tracy Spratt tspratt@ wrote: Have you determined that model.treeData contains valid xml? (trace(treeData.toXMLString())) If it does, then the tree should work like you have it. You will need to set the labelField property for the label, or use a labelFunction if the data you want for the label is not a top-level porperty/attribute of the item node. Also, I am not familiar with RemoteObject, so this may not apply, but you may need to set resultFormat=e4x. Also, if the data service was HTTPService, I would do the result handler like this: public function result( event:ResultEvent ):void { var xmlResult:XML = XML(event.result); trace(xmlResult.toXMLString()); model.treeData = xmlResult; } if you see good xml but are still having difficulty, take the model class out of the picture and assign the dataProvider directly: acTree.dataProvider = xmlResult; Tracy From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of malik_robinson Sent: Tuesday, February 06, 2007 3:09 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: Populate Tree with data from a query? Hi, That helps a bit, in my tree I am seeing the actual xml when I run my application in flex. I have CFC function returning a string, I tried having return xml and same thing. *** After I make my remote object call in my result handler I have this: public function result( data:Object ):void { var event:ResultEvent = data as ResultEvent model.treeData = event.result as XML; } It seems I have to cast it as XML otherwise in my model I get a 'type' error ** In my model which is a [Bindable] class I have: public var treeData:XML; ** And in the view I have mx:Tree id=acTree width=50% height=100% showRoot=false dataProvider={model.treeData} change=treeChanged(event) / Any help appreciated as I am getting the actual xml in the tree. How do you get the label to work also? --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com , jensen.axel axel
[flexcoders] Re: Populate Tree with data from a query?
Hi, Just wanted to post back and say I got it all working with the help you guys provided. The problem was my initial xml was incorrect. I did not need a label function at least from what I can tell. I used labelField=@name and that worked fine. Thanks, Malik --- In flexcoders@yahoogroups.com, malik_robinson [EMAIL PROTECTED] wrote: Hi, I will try this tonight and see how it goes. It seems with RemoteObjects you can't have the resultFormat = e4x like you can with an HTTPService call. With e4x its much easier to get at the xml from what I understand. -Malik --- In flexcoders@yahoogroups.com, Tracy Spratt tspratt@ wrote: You will need a labelFunction() to define the label for complex xml. Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of jensen.axel Sent: Wednesday, February 07, 2007 3:33 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Populate Tree with data from a query? Malik, I'm not sure if your xml has to be formatted that way, depending on what your working with(if your getting your xml from a service that is already in place, and other code is already using that formatted xml) then you would be forced to use the xml as is... but if at all possible, try to format your xml this way companies company name=Macrosoft contact name=Bill Bates/ contact name=Mark Smith/ /company company name=Oracle Corporation contact name=Larry Jobs/ /company /companies now you can use the label=@name in your mx:Tree there are also some things you will definitely want to look at in the example on my blog... This issue was pondering me, so i made and example to see what was going on, and your right it is acting weird in the tree... so anyway check out the example... it's at the bottom of the page on my blog... it says CLICK HERE TO VIEW THE EXAMPLE http://axel.cfwebtools.com/index.cfm/2007/2/6/Returning-a-query-to-flex- as-xml http://axel.cfwebtools.com/index.cfm/2007/2/6/Returning-a-query-to-flex -as-xml I'm always looking for more subscribers and comments, so please subscribe... I usually put up and example on almost every post, unless i'm just throwing up a link i want to remember. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , malik_robinson Malik_Robinson@ wrote: Hi Tracy, When I do a trace as you indicated. I see this: companies company name=Macrosoft contact displayNameBill Bates/displayName /contact contact displayNameMark Smith/displayName /contact /company company name=Oracle Corporation contact displayNameLarry Jobs/displayName /contact /company /companies And this is what I see when my tree is rendered also. -Malik --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Tracy Spratt tspratt@ wrote: Have you determined that model.treeData contains valid xml? (trace(treeData.toXMLString())) If it does, then the tree should work like you have it. You will need to set the labelField property for the label, or use a labelFunction if the data you want for the label is not a top-level porperty/attribute of the item node. Also, I am not familiar with RemoteObject, so this may not apply, but you may need to set resultFormat=e4x. Also, if the data service was HTTPService, I would do the result handler like this: public function result( event:ResultEvent ):void { var xmlResult:XML = XML(event.result); trace(xmlResult.toXMLString()); model.treeData = xmlResult; } if you see good xml but are still having difficulty, take the model class out of the picture and assign the dataProvider directly: acTree.dataProvider = xmlResult; Tracy From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of malik_robinson Sent: Tuesday, February 06, 2007 3:09 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: Populate Tree with data from a query? Hi, That helps a bit, in my tree I am seeing the actual xml when I run my application in flex. I have CFC function returning a string, I tried having return xml and same thing. *** After I make my remote object call in my result handler I have this: public function result( data:Object ):void { var event:ResultEvent = data as ResultEvent model.treeData = event.result as XML; } It seems I have to cast it as XML otherwise in my model I get a 'type' error ** In my model which is a [Bindable] class I have
[flexcoders] Re: Populate Tree with data from a query?
Hi, Just wanted to post back and say I got it all working with the help you guys provided. The problem was my initial xml was incorrect. I did not need a label function at least from what I can tell. I used labelField=@name and that worked fine. Thanks, Malik --- In flexcoders@yahoogroups.com, malik_robinson [EMAIL PROTECTED] wrote: Hi, I will try this tonight and see how it goes. It seems with RemoteObjects you can't have the resultFormat = e4x like you can with an HTTPService call. With e4x its much easier to get at the xml from what I understand. -Malik --- In flexcoders@yahoogroups.com, Tracy Spratt tspratt@ wrote: You will need a labelFunction() to define the label for complex xml. Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of jensen.axel Sent: Wednesday, February 07, 2007 3:33 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Populate Tree with data from a query? Malik, I'm not sure if your xml has to be formatted that way, depending on what your working with(if your getting your xml from a service that is already in place, and other code is already using that formatted xml) then you would be forced to use the xml as is... but if at all possible, try to format your xml this way companies company name=Macrosoft contact name=Bill Bates/ contact name=Mark Smith/ /company company name=Oracle Corporation contact name=Larry Jobs/ /company /companies now you can use the label=@name in your mx:Tree there are also some things you will definitely want to look at in the example on my blog... This issue was pondering me, so i made and example to see what was going on, and your right it is acting weird in the tree... so anyway check out the example... it's at the bottom of the page on my blog... it says CLICK HERE TO VIEW THE EXAMPLE http://axel.cfwebtools.com/index.cfm/2007/2/6/Returning-a-query-to-flex- as-xml http://axel.cfwebtools.com/index.cfm/2007/2/6/Returning-a-query-to-flex -as-xml I'm always looking for more subscribers and comments, so please subscribe... I usually put up and example on almost every post, unless i'm just throwing up a link i want to remember. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , malik_robinson Malik_Robinson@ wrote: Hi Tracy, When I do a trace as you indicated. I see this: companies company name=Macrosoft contact displayNameBill Bates/displayName /contact contact displayNameMark Smith/displayName /contact /company company name=Oracle Corporation contact displayNameLarry Jobs/displayName /contact /company /companies And this is what I see when my tree is rendered also. -Malik --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Tracy Spratt tspratt@ wrote: Have you determined that model.treeData contains valid xml? (trace(treeData.toXMLString())) If it does, then the tree should work like you have it. You will need to set the labelField property for the label, or use a labelFunction if the data you want for the label is not a top-level porperty/attribute of the item node. Also, I am not familiar with RemoteObject, so this may not apply, but you may need to set resultFormat=e4x. Also, if the data service was HTTPService, I would do the result handler like this: public function result( event:ResultEvent ):void { var xmlResult:XML = XML(event.result); trace(xmlResult.toXMLString()); model.treeData = xmlResult; } if you see good xml but are still having difficulty, take the model class out of the picture and assign the dataProvider directly: acTree.dataProvider = xmlResult; Tracy From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of malik_robinson Sent: Tuesday, February 06, 2007 3:09 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: Populate Tree with data from a query? Hi, That helps a bit, in my tree I am seeing the actual xml when I run my application in flex. I have CFC function returning a string, I tried having return xml and same thing. *** After I make my remote object call in my result handler I have this: public function result( data:Object ):void { var event:ResultEvent = data as ResultEvent model.treeData = event.result as XML; } It seems I have to cast it as XML otherwise in my model I get a 'type' error ** In my model which is a [Bindable] class I have
[flexcoders] Populate Tree with data from a query?
Hi, I want to display a list of companies and contacts associated with each company in my app. I think a tree can do this, but I wanted to ask how can I populate a tree from a query? I would like the folders to be the companies and when you expand the folder you see a list of contacts associated. I am using CF so in CF I have a query that does a group by so I'd like to use that and populate the tree but I am unsure on how to do this. I understand the tree needs a data provider, but how do I handle the grouping? Thanks -M
[flexcoders] Re: Populate Tree with data from a query?
Hi, That helps a bit, in my tree I am seeing the actual xml when I run my application in flex. I have CFC function returning a string, I tried having return xml and same thing. *** After I make my remote object call in my result handler I have this: public function result( data:Object ):void { var event:ResultEvent = data as ResultEvent model.treeData = event.result as XML; } It seems I have to cast it as XML otherwise in my model I get a 'type' error ** In my model which is a [Bindable] class I have: public var treeData:XML; ** And in the view I have mx:Tree id=acTree width=50% height=100% showRoot=false dataProvider={model.treeData} change=treeChanged(event) / Any help appreciated as I am getting the actual xml in the tree. How do you get the label to work also? --- In flexcoders@yahoogroups.com, jensen.axel [EMAIL PROTECTED] wrote: Hi Malik, I have never exactly populated a tree with straight query data, i usually convert it to xml first within the cfc that i'm calling, and i return a string from that cfc... it took some playing with but i eventually got it... google the following: using cfxml returning it to flex? or something along those lines... that will teach you how to convert your query to xml... but the thing is, flex doesn't want the actual xml doc from coldfusion, it wants the valid string format... here is my example http://axel.cfwebtools.com/index.cfm/2007/2/6/Returning-a-query-to-flex-\ as-xml#more once you get it into flex, it will be declared as xml, and then in your mx:Tree your going to declare a showRoot=false the blog might be a little hard to follow, but I hope it helps. --- In flexcoders@yahoogroups.com, malik_robinson Malik_Robinson@ wrote: Hi, I want to display a list of companies and contacts associated with each company in my app. I think a tree can do this, but I wanted to ask how can I populate a tree from a query? I would like the folders to be the companies and when you expand the folder you see a list of contacts associated. I am using CF so in CF I have a query that does a group by so I'd like to use that and populate the tree but I am unsure on how to do this. I understand the tree needs a data provider, but how do I handle the grouping? Thanks -M
[flexcoders] Re: Populate Tree with data from a query?
Hi Tracy, When I do a trace as you indicated. I see this: companies company name=Macrosoft contact displayNameBill Bates/displayName /contact contact displayNameMark Smith/displayName /contact /company company name=Oracle Corporation contact displayNameLarry Jobs/displayName /contact /company /companies And this is what I see when my tree is rendered also. -Malik --- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] wrote: Have you determined that model.treeData contains valid xml? (trace(treeData.toXMLString())) If it does, then the tree should work like you have it. You will need to set the labelField property for the label, or use a labelFunction if the data you want for the label is not a top-level porperty/attribute of the item node. Also, I am not familiar with RemoteObject, so this may not apply, but you may need to set resultFormat=e4x. Also, if the data service was HTTPService, I would do the result handler like this: public function result( event:ResultEvent ):void { var xmlResult:XML = XML(event.result); trace(xmlResult.toXMLString()); model.treeData = xmlResult; } if you see good xml but are still having difficulty, take the model class out of the picture and assign the dataProvider directly: acTree.dataProvider = xmlResult; Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of malik_robinson Sent: Tuesday, February 06, 2007 3:09 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Populate Tree with data from a query? Hi, That helps a bit, in my tree I am seeing the actual xml when I run my application in flex. I have CFC function returning a string, I tried having return xml and same thing. *** After I make my remote object call in my result handler I have this: public function result( data:Object ):void { var event:ResultEvent = data as ResultEvent model.treeData = event.result as XML; } It seems I have to cast it as XML otherwise in my model I get a 'type' error ** In my model which is a [Bindable] class I have: public var treeData:XML; ** And in the view I have mx:Tree id=acTree width=50% height=100% showRoot=false dataProvider={model.treeData} change=treeChanged(event) / Any help appreciated as I am getting the actual xml in the tree. How do you get the label to work also? --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , jensen.axel axel@ wrote: Hi Malik, I have never exactly populated a tree with straight query data, i usually convert it to xml first within the cfc that i'm calling, and i return a string from that cfc... it took some playing with but i eventually got it... google the following: using cfxml returning it to flex? or something along those lines... that will teach you how to convert your query to xml... but the thing is, flex doesn't want the actual xml doc from coldfusion, it wants the valid string format... here is my example http://axel.cfwebtools.com/index.cfm/2007/2/6/Returning-a-query-to-flex- \ as-xml#more http://axel.cfwebtools.com/index.cfm/2007/2/6/Returning-a-query-to-flex -as-xml#more once you get it into flex, it will be declared as xml, and then in your mx:Tree your going to declare a showRoot=false the blog might be a little hard to follow, but I hope it helps. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , malik_robinson Malik_Robinson@ wrote: Hi, I want to display a list of companies and contacts associated with each company in my app. I think a tree can do this, but I wanted to ask how can I populate a tree from a query? I would like the folders to be the companies and when you expand the folder you see a list of contacts associated. I am using CF so in CF I have a query that does a group by so I'd like to use that and populate the tree but I am unsure on how to do this. I understand the tree needs a data provider, but how do I handle the grouping? Thanks -M
[flexcoders] Re: Can't find bug in this piece of ActionScript
Hi, I dont think it does, I could be wrong, but I want to set the selectedIndex equal to the employeeStateId so if the employee has a stateId of say 3 for Arizona or whatever, I want the selectedIndex to be 3. Unless I am missing something. -M --- In flexcoders@yahoogroups.com, Ralf Bokelberg [EMAIL PROTECTED] wrote: Doesn't it have to be stateCB.selectedIndex = i; Cheers, Ralf. On 2/2/07, malik_robinson [EMAIL PROTECTED] wrote: Hi, I am trying to set the selectedIndex of my U.S. States custom combo box equal to what the user has stored in their record in our database. Someone posted a link to a similar tutorial, but I could not get it to work and I think it seems to be slightly different than what I am doing. When the screen loads, the state the user is associated with should be selected, otherwise set the selectedIndex equal to 0. As of now it does not select anything it seems the condition where I test for equality fails and I always get the selectedIndex set to 0. *The code:* *public function** initStateCB(employeeStateId:Number):void** {* for ( var i:int=0; i stateCB.dataProvider.length; i++ ) { if( employeeStateId == stateCB.dataProvider[i].stateId ) { stateCB.selectedIndex = employeeStateId ; } else { stateCB.selectedIndex = 0; } } *} **// close function* ** mx:FormItem label=State: comp:StateCombo id=stateCB dataProvider={model.stateList} labelField=stateName creationComplete=initStateCB( model.employeeProfileArray[0].stateId)/ /mx:FormItem -- Ralf Bokelberg [EMAIL PROTECTED] Flex Flash Consultant based in Cologne/Germany Phone +49 (0) 221 530 15 35
[flexcoders] Re: Can't find bug in this piece of ActionScript
Hi, The code works the first time around. First time around meaning click an employee from the datagrid and the screen changes to a detail view of that employee. For some reason every user I bring up after the first user has the same State (Arizona) for example selected thereafter. The first time around it works, but then when I go back to the employee list screen, and click a different employee, the detail form populates with all the right info like (firstName, lastName, email, city, zip), but the state drop down has the value of the state the other user is associated with (Arizona). Its as if the code runs correctly once but when you click a different user the approriate state does not load, it just has the value from the prior user. Almost as if once the code runs once, and its being cached or something. All the other fields load correctly as I view each users detail view. I hope I am making sense. -M --- In flexcoders@yahoogroups.com, Ralf Bokelberg [EMAIL PROTECTED] wrote: Ah sorry, i haven't read the text ;) What if you try it like that: var selectedIndex : int = 0; for ( var i:int=0; i stateCB.dataProvider.length; i++ ) { if( employeeStateId == stateCB.dataProvider[i].stateId ) { selectedIndex = employeeStateId ; } } stateCB.selectedIndex = selectedIndex; Cheers, Ralf. -- Ralf Bokelberg [EMAIL PROTECTED] Flex Flash Consultant based in Cologne/Germany Phone +49 (0) 221 530 15 35
[flexcoders] Re: Can't find bug in this piece of ActionScript
Hi, I am new to actionscript and not quite sure how to implement that solution you suggested. It looks like the way to go because I do want to always have the right state selected when the detail screen first loads so I presume that is where the binding kicks in. Here is what I did in the code which I think is wrong how I am referencing the array in the parameter public function getStateIndex(employeeStateId:Number, model.employeeProfileArray[0]:Array):void { var selectedIndex : int = 0; for ( var i:int=0; i stateCB.dataProvider.length; i++ ) { if( getStateIndex(employeeStateId:== stateCB.dataProvider[i].stateId ) { selectedIndex = getStateIndex(employeeStateId:; } } stateCB.selectedIndex = selectedIndex; comp:StateCombo id=stateCB selectedIndex={ getStateIndex( employeeStateId:Number, model.employeeProfileArray[0]:Array ) } dataProvider={model.stateList} labelField=stateName/ I am using Cairngorm 2.1 and it is actually working pretty well for me, so is there a way to elegantly bind this to the ModelLocator? The array is bound to the ModelLocator --- In flexcoders@yahoogroups.com, Ralf Bokelberg [EMAIL PROTECTED] wrote: That's probably because the creationComplete event is called just once. What if you use binding instead? selectedIndex={ getStateIndex( *employeeStateId:Number, dataProvider:Array*) } Cheers, Ralf. On 2/2/07, malik_robinson [EMAIL PROTECTED] wrote: Hi, The code works the first time around. First time around meaning click an employee from the datagrid and the screen changes to a detail view of that employee. For some reason every user I bring up after the first user has the same State (Arizona) for example selected thereafter. The first time around it works, but then when I go back to the employee list screen, and click a different employee, the detail form populates with all the right info like (firstName, lastName, email, city, zip), but the state drop down has the value of the state the other user is associated with (Arizona). Its as if the code runs correctly once but when you click a different user the approriate state does not load, it just has the value from the prior user. Almost as if once the code runs once, and its being cached or something. All the other fields load correctly as I view each users detail view. I hope I am making sense. -M --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Ralf Bokelberg ralf.bokelberg@ wrote: Ah sorry, i haven't read the text ;) What if you try it like that: var selectedIndex : int = 0; for ( var i:int=0; i stateCB.dataProvider.length; i++ ) { if( employeeStateId == stateCB.dataProvider[i].stateId ) { selectedIndex = employeeStateId ; } } stateCB.selectedIndex = selectedIndex; Cheers, Ralf. -- Ralf Bokelberg ralf.bokelberg@ Flex Flash Consultant based in Cologne/Germany Phone +49 (0) 221 530 15 35 -- Ralf Bokelberg [EMAIL PROTECTED] Flex Flash Consultant based in Cologne/Germany Phone +49 (0) 221 530 15 35
[flexcoders] Re: Can't find bug in this piece of ActionScript
Hi, Thanks for all the help. It works now. The latest snippet you provided did the trick. Its nice when it works... Thanks Ralf! Thanks for your post too Doug. -Malik --- In flexcoders@yahoogroups.com, Ralf Bokelberg [EMAIL PROTECTED] wrote: Ok, i understand. Ty it like that: public function getStateIndex( employeeStateId : Number, dataProvider : Array) : int { var selectedIndex : int = 0; for ( var i:int=0; i dataProvider.length; i++ ) { if( employeeStateId == dataProvider[i].stateId ) { selectedIndex = employeeStateId; } } return selectedIndex; } comp:StateCombo id=stateCB selectedIndex={ getStateIndex( model.employeeProfileArray[0].stateId, model.stateList ) } dataProvider={ model.stateList} labelField=stateName/ Cheers, Ralf. On 2/2/07, malik_robinson [EMAIL PROTECTED] wrote: Hi, I am new to actionscript and not quite sure how to implement that solution you suggested. It looks like the way to go because I do want to always have the right state selected when the detail screen first loads so I presume that is where the binding kicks in. Here is what I did in the code which I think is wrong how I am referencing the array in the parameter public function getStateIndex(employeeStateId:Number, model.employeeProfileArray[0]:Array):void { var selectedIndex : int = 0; for ( var i:int=0; i stateCB.dataProvider.length; i++ ) { if( getStateIndex(employeeStateId:== stateCB.dataProvider[i].stateId ) { selectedIndex = getStateIndex(employeeStateId:; } } stateCB.selectedIndex = selectedIndex; comp:StateCombo id=stateCB selectedIndex={ getStateIndex( employeeStateId:Number, model.employeeProfileArray[0]:Array ) } dataProvider={model.stateList} labelField=stateName/ I am using Cairngorm 2.1 and it is actually working pretty well for me, so is there a way to elegantly bind this to the ModelLocator? The array is bound to the ModelLocator --- In flexcoders@yahoogroups.com, Ralf Bokelberg ralf.bokelberg@ wrote: That's probably because the creationComplete event is called just once. What if you use binding instead? selectedIndex={ getStateIndex( *employeeStateId:Number, dataProvider:Array*) } Cheers, Ralf. On 2/2/07, malik_robinson Malik_Robinson@ wrote: Hi, The code works the first time around. First time around meaning click an employee from the datagrid and the screen changes to a detail view of that employee. For some reason every user I bring up after the first user has the same State (Arizona) for example selected thereafter. The first time around it works, but then when I go back to the employee list screen, and click a different employee, the detail form populates with all the right info like (firstName, lastName, email, city, zip), but the state drop down has the value of the state the other user is associated with (Arizona). Its as if the code runs correctly once but when you click a different user the approriate state does not load, it just has the value from the prior user. Almost as if once the code runs once, and its being cached or something. All the other fields load correctly as I view each users detail view. I hope I am making sense. -M --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Ralf Bokelberg ralf.bokelberg@ wrote: Ah sorry, i haven't read the text ;) What if you try it like that: var selectedIndex : int = 0; for ( var i:int=0; i stateCB.dataProvider.length; i++ ) { if( employeeStateId == stateCB.dataProvider[i].stateId ) { selectedIndex = employeeStateId ; } } stateCB.selectedIndex = selectedIndex; Cheers, Ralf. -- Ralf Bokelberg ralf.bokelberg@ Flex Flash Consultant based in Cologne/Germany Phone +49 (0) 221 530 15 35 -- Ralf Bokelberg ralf.bokelberg@ Flex Flash Consultant based in Cologne/Germany Phone +49 (0) 221 530 15 35 -- Ralf Bokelberg [EMAIL PROTECTED] Flex Flash Consultant based in Cologne/Germany Phone +49 (0) 221 530 15 35
[flexcoders] Can't find bug in this piece of ActionScript
Hi, I am trying to set the selectedIndex of my U.S. States custom combo box equal to what the user has stored in their record in our database. Someone posted a link to a similar tutorial, but I could not get it to work and I think it seems to be slightly different than what I am doing. When the screen loads, the state the user is associated with should be selected, otherwise set the selectedIndex equal to 0. As of now it does not select anything it seems the condition where I test for equality fails and I always get the selectedIndex set to 0. The code: public function initStateCB(employeeStateId:Number):void { for ( var i:int=0; i stateCB.dataProvider.length; i++ ) { if( employeeStateId == stateCB.dataProvider[i].stateId ) { stateCB.selectedIndex = employeeStateId ; } else { stateCB.selectedIndex = 0; } } } // close function mx:FormItem label=State: comp:StateCombo id=stateCB dataProvider={model.stateList} labelField=stateName creationComplete=initStateCB(model.employeeProfileArray[0].stateId)/ /mx:FormItem
[flexcoders] Passing Value Object to CFC as an argument?
Hi, I am confused on how pass in arguments to the CFC when I am sending a ValueObject in from Flex. I have this code. public function saveEmployee( employeeVO : EmployeeVO ): void { var call:AsyncToken = service.saveEmployee( employeeVO ); call.addResponder( responder ); } The parameter employeeVO in the above function contains all the data the user typed in on my form. I want to pass this data to my CFC as an argument. From there I *think* I can do the rest. How do I do this? -Malik
[flexcoders] Re: Passing Value Object to CFC as an argument?
Hi, That helps quite a bit. Two questions arise. 1. Can you explain the dynamic class usuage and why one might use that? 2. I always see VO's with an empty function declared after the properties (see below) , why is this? public function securityVO() { } Thanks for your help -M --- In flexcoders@yahoogroups.com, Douglas Knudsen [EMAIL PROTECTED] wrote: you need a EmployeeVO CFC with matching properties and the full array of mutators and accessors. Further you need to add the metadata to your AS VO so Flex knows how to tie it in to your CFC. THen service.saveEmployee( employeeVO ) can work on the EmployeeVO CFC bamm! Below is a example package com.mycom.myapp.vo { [RemoteClass(alias=myapp.model.security.security)] [Bindable] public dynamic class securityVO implements ValueObject { public var emplid:String = ; public var name:String = ; public var secgroupid:Number = 0; public var secgroup:String = ; public var isactive:Boolean = false; public function securityVO() { } } } cfcomponent output=false alias=myapp.model.security.security !--- These are properties that are exposed by this CFC object. These property definitions are used when calling this CFC as a web services, passed back to a flash movie, or when generating documentation NOTE: these cfproperty tags do not set any default property values. --- cfproperty name=emplid type=string default= cfproperty name=name type=string default= cfproperty name=secgroupid type=numeric default=0 cfproperty name=secgroup type=string default= cfproperty name=isactive type=boolean default=0 cfscript //Initialize the CFC with the default properties values. variables.emplid = ; variables.name = ''; variables.secgroupid = 0; variables.secgroup = ''; variables.isactive = false; /cfscript cffunction name=init output=false returntype= myapp.model.security.security cfreturn this /cffunction cffunction name=getEMPLID output=false access=public returntype=any cfreturn variables.EMPLID /cffunction cffunction name=setEMPLID output=false access=public returntype=void cfargument name=val required=true cfset variables.EMPLID = arguments.val /cffunction cffunction name=getName output=false access=public returntype=any cfreturn variables.name /cffunction cffunction name=setName output=false access=public returntype=void cfargument name=val required=true cfset variables.name = arguments.val /cffunction cffunction name=getSECGROUPID output=false access=public returntype=any cfreturn variables.SECGROUPID /cffunction cffunction name=setSECGROUPID output=false access=public returntype=void cfargument name=val required=true cfif (IsNumeric(arguments.val)) OR (arguments.val EQ ) cfset variables.SECGROUPID = arguments.val cfelse cfthrow message='#arguments.val#' is not a valid numeric/ /cfif /cffunction cffunction name=getISACTIVE output=false access=public returntype=boolean cfreturn variables.ISACTIVE /cffunction cffunction name=setISACTIVE output=false access=public returntype=void cfargument name=val required=true cfif (IsBoolean(arguments.val)) cfset variables.ISACTIVE = arguments.val cfelse cfthrow message='#arguments.val#' is not a valid boolean/ /cfif /cffunction cffunction name=getSECGROUP output=false access=public returntype=any cfreturn variables.DESCR /cffunction cffunction name=setSECGROUP output=false access=public returntype=void cfargument name=val required=true cfset variables.DESCR = arguments.val /cffunction /cfcomponent The above is how the CF-Extension wizards create things. DK On 1/31/07, malik_robinson [EMAIL PROTECTED] wrote: Hi, I am confused on how pass in arguments to the CFC when I am sending a ValueObject in from Flex. I have this code. *public* *function* saveEmployee( employeeVO : EmployeeVO ): *void* { *var* call:AsyncToken = service.saveEmployee( employeeVO ); call.addResponder( responder ); } The parameter employeeVO in the above function contains all the data the user typed in on my form. I want to pass this data to my CFC as an argument. From there I *think* I can do the rest. How do I do this? -Malik -- Douglas Knudsen http://www.cubicleman.com this is my signature, like it?
[flexcoders] Re: Cairngorm - Question on using ResultHandler
Thanks! -Malik --- In flexcoders@yahoogroups.com, Dimitrios Gianninas [EMAIL PROTECTED] wrote: Well if your remote call is returning an object, then u do event.result ... if its returning a list of objects and u need to access the first, second, etc.. element then do event.result[0]. If its a map, then do event.result[keyname] Dimitrios Gianninas RIA Developer Optimal Payments Inc. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of malik_robinson Sent: Sunday, January 28, 2007 9:11 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Cairngorm - Question on using ResultHandler Hi, Thanks for the help. That worked and it called the next command which is what I wanted. In my result handler in the command that gets called next this works: public function result( data:Object ):void { var event:ResultEvent = data as ResultEvent model.employeeList = event.result[0]; } This does NOT work: I am just trying to find out why, and if the above is how most do this. public function result( data:Object ):void { var event:ResultEvent = data as ResultEvent model.employeeList = event.result } Thanks, -M --- In flexcoders@yahoogroups.com, Dimitrios Gianninas dimitrios.gianninas@ wrote: You are doing things the right way. If after you login you want to do some more, look at the SequenceCommand. You would basically add a executeNextCommand() statement after your model.workflowState statement. Dimitrios Gianninas RIA Developer Optimal Payments Inc. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of malik_robinson Sent: Sunday, January 28, 2007 1:49 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Cairngorm - Question on using ResultHandler Hi, I have a question using Cairngorm and Commands. I am new to it but its making more sense to me each day at least it seems that way. I have the following in my LoginCommand.as public function result( data:Object ):void { var event:ResultEvent = data as ResultEvent; if (event.result.length 0) { model.workflowState = ModelLocator.VIEWING_HOMEPAGE; } else { model.login.statusMsg = Your login credentials are invalid, please try again.; } } 1. Is there anything wrong with the way I am doing the above? 2. I would like to call some other remote objects s! o I can populate some datagrids after the user has been authenticated and then load the home page of the app as I am doing above. -- WARNING --- 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. AVIS IMPORTANT -- 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.
[flexcoders] How to set selectedIndex on comboBox equal result from rpc call??
Hi, How do I set the selectedIndex of a mx:ComboBox equal to that of what comes back in the result from a remote object call when the component is loaded?? In my array I have the user's state_code and if they have a value for that I want to set the selectedIndex to that value. Seems as if it should be simple enough. I am *thinking* I would need a function to do this that would get called upon creationComplete, but maybe someone can provide a code snippet on how I would go about this. I have this in my form: mx:FormItem label=City / State direction=vertical mx:TextInput id=city text={model.UserArray[0].city}/ mx:ComboBox id=state_code dataProvider={model.stateList} labelField=stateName/ /mx:FormItem Thanks, -Malik
[flexcoders] Re: Cairngorm - Question on using ResultHandler
Hi, Thanks for the help. That worked and it called the next command which is what I wanted. In my result handler in the command that gets called next this works: public function result( data:Object ):void { var event:ResultEvent = data as ResultEvent model.employeeList = event.result[0]; } This does NOT work: I am just trying to find out why, and if the above is how most do this. public function result( data:Object ):void { var event:ResultEvent = data as ResultEvent model.employeeList = event.result } Thanks, -M --- In flexcoders@yahoogroups.com, Dimitrios Gianninas [EMAIL PROTECTED] wrote: You are doing things the right way. If after you login you want to do some more, look at the SequenceCommand. You would basically add a executeNextCommand() statement after your model.workflowState statement. Dimitrios Gianninas RIA Developer Optimal Payments Inc. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of malik_robinson Sent: Sunday, January 28, 2007 1:49 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Cairngorm - Question on using ResultHandler Hi, I have a question using Cairngorm and Commands. I am new to it but its making more sense to me each day at least it seems that way. I have the following in my LoginCommand.as public function result( data:Object ):void { var event:ResultEvent = data as ResultEvent; if (event.result.length 0) { model.workflowState = ModelLocator.VIEWING_HOMEPAGE; } else { model.login.statusMsg = Your login credentials are invalid, please try again.; } } 1. Is there anything wrong with the way I am doing the above? 2. I would like to call some other remote objects s! o I can populate some datagrids after the user has been authenticated and then load the home page of the app as I am doing above. -- WARNING --- 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. AVIS IMPORTANT -- 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.
[flexcoders] Cairngorm - Question on using ResultHandler
Hi, I have a question using Cairngorm and Commands. I am new to it but its making more sense to me each day at least it seems that way. I have the following in my LoginCommand.as public function result( data:Object ):void { var event:ResultEvent = data as ResultEvent; if (event.result.length 0) { model.workflowState = ModelLocator.VIEWING_HOMEPAGE; } else { model.login.statusMsg = Your login credentials are invalid, please try again.; } } 1. Is there anything wrong with the way I am doing the above? 2. I would like to call some other remote objects so I can populate some datagrids after the user has been authenticated and then load the home page of the app as I am doing above.
[flexcoders] Re: Binding result from CFC to a Detail Form
HI, Yes, I am using 7.02. I am using a Viewstack in my main.mxml file and the the form is actually called like this: forms:EmployeeProfile id=frmEmployeeProfile x=485 y=341 width=420/ I have a private function on the same main.mxml file where the array is available so I thought I had to reference the form through the component frmEmployeeProfile. myForm.firstName.text = ApplicationState.instance.employeeArray[0].firstName; But your saying I need to have the form already setup with the bindings? Sorry I am new to Flex/Actionscript. -Malik --- In flexcoders@yahoogroups.com, Battershall, Jeff [EMAIL PROTECTED] wrote: Are you using CF 7.02? The version of CF you're using will influence what solution you use. But regardless, you need to create a bindable As class that the form fields can be bound to like [Bindable] public class User { public function User() { } public var FirstName:String = ; public var LastName:String = ; public var Email:String = ; } This object would be instantiated on your app start up. It needs to be in a scope accessible by your form. When you pull over your result from CF, you populate it with your data. user.FirstName = event.result.FirstName, etc. Your form elements would be already bound to the members of the user object. mx:TextInput text={user.FirstName}/, etc. HTH, Jeff -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of malik_robinson Sent: Friday, January 19, 2007 1:56 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Binding result from CFC to a Detail Form Hi, I am using a CFC here that has a method that accepts a userId, it then runs an sql query and retrieves all the data associated with the user like: FirstName LastName Email, etc I am trying to find out how I can set the form fields text property equal to that of the Array that is returned from my RemoteObject Call. I have this code in my main application file. I did a trace on the employeeDataArray and it has all the details for that user so the remote call is working fine, I just cant figure out how to bind the values in the array to the various form fields on myForm which is the id I have given the form. private function populateEmployeeProfileForm( event:flash.events.Event ):void { appViewStack.selectedChild=vs_EmployeeProfile; employeeDataArray = ApplicationState.instance.employeeArray; // do I do this?? frmEmployeeProfile.myForm ??? didnt work for me } mx:ViewStack id=appViewStack height=100% width=100% mx:Canvas id=vs_EmployeeProfile comps:globalToolBar id=globalToolBar width=100% / forms:EmployeeProfile id=frmEmployeeProfile x=485 y=341 width=420/ /mx:Canvas /mx:ViewStack -Malik
[flexcoders] Binding result from CFC to a Detail Form
Hi, I am using a CFC here that has a method that accepts a userId, it then runs an sql query and retrieves all the data associated with the user like: FirstName LastName Email, etc I am trying to find out how I can set the form fields text property equal to that of the Array that is returned from my RemoteObject Call. I have this code in my main application file. I did a trace on the employeeDataArray and it has all the details for that user so the remote call is working fine, I just cant figure out how to bind the values in the array to the various form fields on myForm which is the id I have given the form. private function populateEmployeeProfileForm( event:flash.events.Event ):void { appViewStack.selectedChild=vs_EmployeeProfile; employeeDataArray = ApplicationState.instance.employeeArray; // do I do this?? frmEmployeeProfile.myForm ??? didnt work for me } mx:ViewStack id=appViewStack height=100% width=100% mx:Canvas id=vs_EmployeeProfile comps:globalToolBar id=globalToolBar width=100% / forms:EmployeeProfile id=frmEmployeeProfile x=485 y=341 width=420/ /mx:Canvas /mx:ViewStack -Malik
[flexcoders] Access data in an Array Collection??
Hi, I have a cfc that returns this query object to flex. It seems to convert it to an ArrayCollection? Is that correct? Questions 1. How can I get at the email field in this array? 2. How can I check if the array has a len greater than 0? I tried: trace(event.result.email), but that does not work and I assume because I am not referencing a position in the Array. I have this private function in my code: private function loginUser_result( event:ResultEvent ) : void { trace(ObjectUtil.toString(event.result)); dispatchEvent( new Event(loadHomePage) ); } The above trace() displays this. (mx.collections::ArrayCollection)#0 filterFunction = (null) length = 1 list = (mx.collections::ArrayList)#1 length = 1 source = (Array)#2 [0] (Object)#3 email = [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] password = test userId = 1 uid = BE12A633-8FC1-2B1B-BFB5-292A1416478A sort = (null) source = (Array)#2
[flexcoders] Re: Access data in an Array Collection??
Hi, Thanks Simeon, that worked. -Malik --- In flexcoders@yahoogroups.com, Simeon Bateman [EMAIL PROTECTED] wrote: Hey Malik, To access the email field it looks like you are close. the problem is likely a case-sensitivity issue. If you are using flex builder I would put a break on the line with the trace, and then inspect the event.resultproperty. Then you can see what the field names are in the arraycollection. Length is a property of ArrayCollection so you can see the length of the results by tracing length of the arraycollection. The only trick is that event.result is typed as object, so you may need to explain to the compiler that you know its actually an arraycollection. var ac:ArrayCollection = event.result as ArrayCollection; trace(ac.length) Good Luck. simeon On 1/15/07, malik_robinson [EMAIL PROTECTED] wrote: Hi, I have a cfc that returns this query object to flex. It seems to convert it to an ArrayCollection? Is that correct? *Questions* *1. How can I get at the email field in this array?* *2. How can I check if the array has a len greater than 0?* I tried: trace(event.result.email), but that does not work and I assume because I am not referencing a position in the Array. I have this private function in my code: private function loginUser_result( event:ResultEvent ) : void { trace(ObjectUtil.toString(event.result)); dispatchEvent( new Event(loadHomePage) ); } The above trace() displays this. (mx.collections::ArrayCollection)#0 filterFunction = (null) length = 1 list = (mx.collections::ArrayList)#1 length = 1 source = (Array)#2 [0] (Object)#3 email = [EMAIL PROTECTED] password = test userId = 1 uid = BE12A633-8FC1-2B1B-BFB5-292A1416478A sort = (null) source = (Array)#2
[flexcoders] Re: Dispatch and Listen for events?
Thanks --- In flexcoders@yahoogroups.com, Ralf Bokelberg [EMAIL PROTECTED] wrote: Every event has a type property. You need to set it using super( myType ); Cheers, Ralf. On 1/13/07, malik_robinson [EMAIL PROTECTED] wrote: Hi, I am not using Cairngorm or anything yet, but trying to learn to build some of this on my own through tutorials, books, etc. I am trying to build a basic login and I created a custom component called LoginPanel.mxml, and created a LoginEvent.as. I call LoginPanel.mxml in my Main application file by doing: comps:LoginPanel / My goal is to let the user click the login button, create a loginEvent then dispatch the event, finally have some event listener on the other end receive notification then make a call to my Remote Object in my Services.mxmlfile. I think once I get to the remote Object call I can fiddle my way from there. I am confused on how and where to tie my event listener in and once the listener receives notification, the code that follows. *I have a private function in LoginPanel.mxml (my login form) called doLogin(). Code is shown below:* private function doLogin():void { var loginEvent:LoginEvent = new LoginEvent( username.text, password.text); this.dispatchEvent(loginEvent); } } *My LoginEvent.as code is here:* package com.adobe.events { import flash.events.Event; import flash.events.EventDispatcher; public class LoginEvent extends Event{ public var username : String; public var password : String; // constructor function public function LoginEvent( username:String, password:String ) { this.username = username; this.password = password; } } } Is this correct? Thanks in advance for any assistance... -- Ralf Bokelberg [EMAIL PROTECTED] Flex Flash Consultant based in Cologne/Germany Phone +49 (0) 221 530 15 35
[flexcoders] Getting Error: Event Type 'flash.event:event' is unavailable ?????
Hi, I am getting this error: Event Type 'flash.event:event' is unavailable I have this function in my Services.mxml file: private function loginUser_result( event:ResultEvent ) : void { dispatchEvent( new Event(userAuthenticated) ); } Then in my main MXML file I have: ds:SupportService id=svc userAuthenticated=mx.controls.Alert.show('Your are now Logged In'); / Any idea on why I may get this error? Thanks Malik
[flexcoders] Re: Getting Error: Event Type 'flash.event:event' is unavailable ?????
Hi, I guess a better question is when do I use : [Event(name=eventName)] as opposed to: [Event(name=eventName,type=flash.event.event)] (this gives me that error in my original post ) Thanks --- In flexcoders@yahoogroups.com, malik_robinson [EMAIL PROTECTED] wrote: Hi, I am getting this error: Event Type 'flash.event:event' is unavailable I have this function in my Services.mxml file: private function loginUser_result( event:ResultEvent ) : void { dispatchEvent( new Event(userAuthenticated) ); } Then in my main MXML file I have: ds:SupportService id=svc userAuthenticated=mx.controls.Alert.show('Your are now Logged In'); / Any idea on why I may get this error? Thanks Malik
[flexcoders] Dispatch and Listen for events?
Hi, I am not using Cairngorm or anything yet, but trying to learn to build some of this on my own through tutorials, books, etc. I am trying to build a basic login and I created a custom component called LoginPanel.mxml, and created a LoginEvent.as. I call LoginPanel.mxml in my Main application file by doing: comps:LoginPanel / My goal is to let the user click the login button, create a loginEvent then dispatch the event, finally have some event listener on the other end receive notification then make a call to my Remote Object in my Services.mxml file. I think once I get to the remote Object call I can fiddle my way from there. I am confused on how and where to tie my event listener in and once the listener receives notification, the code that follows. I have a private function in LoginPanel.mxml (my login form) called doLogin(). Code is shown below: private function doLogin():void { var loginEvent:LoginEvent = new LoginEvent(username.text, password.text); this.dispatchEvent(loginEvent); } } My LoginEvent.as code is here: package com.adobe.events { import flash.events.Event; import flash.events.EventDispatcher; public class LoginEvent extends Event{ public var username : String; public var password : String; // constructor function public function LoginEvent( username:String, password:String ) { this.username = username; this.password = password; } } } Is this correct? Thanks in advance for any assistance...
[flexcoders] Re: Getting duplicate value in my combo box control
Thanks, Malik --- In flexcoders@yahoogroups.com, Shannon Hicks [EMAIL PROTECTED] wrote: You could have tracked down your problem more easily with some sort of HTTP sniffer. I use ServiceCapture. There are others out there that support Flash's AMF. Shan malik_robinson wrote: Hi, for what its worth, I fixed my own problem. In eclipse in a cfc I believe by default the functions are collapsed visually. I had a function in the cfc calling another function and in that 2nd function I had something hardcoded. Once I removed the hardcoded reference everything worked. -ws --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com, malik_robinson Malik_Robinson@ wrote: Hi, I did a trace using trace(ObjectUtil.toString(event.result)); I was able to see what my result handler had and it clearly shows duplicate data. I see an array and at position zero[0] and position[1], i see the exact same thing in the flex console when I debug the app. At first glance I thought it might be the sql, but the sql is correct, I wrote the results of the query to a file using cffile and all is good, somewhere between the function call and the result handler somethin is going wrong. Any help highly appreciated. -Malik --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com, malik_robinson Malik_Robinson@ wrote: Hi, I seem to be getting duplicate values being displayed in my combo box component. I am using Flex and CF. The query returns two records and ultimately the combo box gets populated, but it has two values So I am getting Project Name: XO Project XO Project There are two records that part is right, but the text in the actual drop down is duplicated. The query is correct so its not an issue with the sql and/or my cfc. It seems like there is a problem in the loop or something, I am not sure. Here is the combo box code: ?xml version=1.0 encoding=utf-8? mx:ComboBox xmlns:mx=http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml xmlns=* toolTip=List of Projects labelField=projectName mx:Script ![CDATA[ import com.adobe.actors.ApplicationState; import com.adobe.actors.Project; import mx.collections.ArrayCollection; [Bindable] public var firstEntry:String = All; public function selectProject( e:Project ) : void { var dp:ArrayCollection = dataProvider as ArrayCollection; for(var i:int=0; i dp.length; i++) { var test:Object = dp.getItemAt(i) as Project; if( test.id == e.projectId ) { selectedIndex = i; break; } } } ]] /mx:Script mx:dataProvider {ApplicationState.instance.listOfProjects} /mx:dataProvider /mx:ComboBox ** This is a snippet from my ApplicationState.as file private var _listOfProjects:ArrayCollection; [Bindable(event=projectsChanged)] public function set listOfProjects( ac:ArrayCollection ) : void { _listOfProjects = ac; var dummyProject:Project = new Project(); dummyProject.projectId = ; dummyProject.projectName = Select; _listOfProjects.addItemAt(dummyProject, 0 ); dispatchEvent( new FlexEvent(projectsChanged) ); } public function get listOfProjects() : ArrayCollection { return _listOfProjects; }
[flexcoders] Flex Console says: unable to bind to property 'instance' on class 'com.adobe.
Hi, I am getting this error in the flex console when I debug my app, well not an error, but a warning. unable to bind to property 'instance' on class 'com.adobe.actors::ApplicationState' (class is not an IEventDispatcher) How can I fix this? Any help appreciated, I am a bit new to Flex 2.0 -Malik
[flexcoders] Getting duplicate value in my combo box control
Hi, I seem to be getting duplicate values being displayed in my combo box component. I am using Flex and CF. The query returns two records and ultimately the combo box gets populated, but it has two values So I am getting Project Name: XO Project XO Project There are two records that part is right, but the text in the actual drop down is duplicated. The query is correct so its not an issue with the sql and/or my cfc. It seems like there is a problem in the loop or something, I am not sure. Here is the combo box code: ?xml version=1.0 encoding=utf-8? mx:ComboBox xmlns:mx=http://www.adobe.com/2006/mxml; xmlns=* toolTip=List of Projects labelField=projectName mx:Script ![CDATA[ import com.adobe.actors.ApplicationState; import com.adobe.actors.Project; import mx.collections.ArrayCollection; [Bindable] public var firstEntry:String = All; public function selectProject( e:Project ) : void { var dp:ArrayCollection = dataProvider as ArrayCollection; for(var i:int=0; i dp.length; i++) { var test:Object = dp.getItemAt(i) as Project; if( test.id == e.projectId ) { selectedIndex = i; break; } } } ]] /mx:Script mx:dataProvider {ApplicationState.instance.listOfProjects} /mx:dataProvider /mx:ComboBox ** This is a snippet from my ApplicationState.as file private var _listOfProjects:ArrayCollection; [Bindable(event=projectsChanged)] public function set listOfProjects( ac:ArrayCollection ) : void{ _listOfProjects = ac; var dummyProject:Project = new Project(); dummyProject.projectId = ; dummyProject.projectName = Select; _listOfProjects.addItemAt(dummyProject, 0 ); dispatchEvent( new FlexEvent(projectsChanged) ); } public function get listOfProjects() : ArrayCollection{ return _listOfProjects; }
[flexcoders] Re: Getting duplicate value in my combo box control
Hi, I did a trace using trace(ObjectUtil.toString(event.result)); I was able to see what my result handler had and it clearly shows duplicate data. I see an array and at position zero[0] and position[1], i see the exact same thing in the flex console when I debug the app. At first glance I thought it might be the sql, but the sql is correct, I wrote the results of the query to a file using cffile and all is good, somewhere between the function call and the result handler somethin is going wrong. Any help highly appreciated. -Malik --- In flexcoders@yahoogroups.com, malik_robinson [EMAIL PROTECTED] wrote: Hi, I seem to be getting duplicate values being displayed in my combo box component. I am using Flex and CF. The query returns two records and ultimately the combo box gets populated, but it has two values So I am getting Project Name: XO Project XO Project There are two records that part is right, but the text in the actual drop down is duplicated. The query is correct so its not an issue with the sql and/or my cfc. It seems like there is a problem in the loop or something, I am not sure. Here is the combo box code: ?xml version=1.0 encoding=utf-8? mx:ComboBox xmlns:mx=http://www.adobe.com/2006/mxml; xmlns=* toolTip=List of Projects labelField=projectName mx:Script ![CDATA[ import com.adobe.actors.ApplicationState; import com.adobe.actors.Project; import mx.collections.ArrayCollection; [Bindable] public var firstEntry:String = All; public function selectProject( e:Project ) : void { var dp:ArrayCollection = dataProvider as ArrayCollection; for(var i:int=0; i dp.length; i++) { var test:Object = dp.getItemAt(i) as Project; if( test.id == e.projectId ) { selectedIndex = i; break; } } } ]] /mx:Script mx:dataProvider {ApplicationState.instance.listOfProjects} /mx:dataProvider /mx:ComboBox ** This is a snippet from my ApplicationState.as file private var _listOfProjects:ArrayCollection; [Bindable(event=projectsChanged)] public function set listOfProjects( ac:ArrayCollection ) : void { _listOfProjects = ac; var dummyProject:Project = new Project(); dummyProject.projectId = ; dummyProject.projectName = Select; _listOfProjects.addItemAt(dummyProject, 0 ); dispatchEvent( new FlexEvent(projectsChanged) ); } public function get listOfProjects() : ArrayCollection { return _listOfProjects; }
[flexcoders] Re: Getting duplicate value in my combo box control
Hi, for what its worth, I fixed my own problem. In eclipse in a cfc I believe by default the functions are collapsed visually. I had a function in the cfc calling another function and in that 2nd function I had something hardcoded. Once I removed the hardcoded reference everything worked. -ws --- In flexcoders@yahoogroups.com, malik_robinson [EMAIL PROTECTED] wrote: Hi, I did a trace using trace(ObjectUtil.toString(event.result)); I was able to see what my result handler had and it clearly shows duplicate data. I see an array and at position zero[0] and position[1], i see the exact same thing in the flex console when I debug the app. At first glance I thought it might be the sql, but the sql is correct, I wrote the results of the query to a file using cffile and all is good, somewhere between the function call and the result handler somethin is going wrong. Any help highly appreciated. -Malik --- In flexcoders@yahoogroups.com, malik_robinson Malik_Robinson@ wrote: Hi, I seem to be getting duplicate values being displayed in my combo box component. I am using Flex and CF. The query returns two records and ultimately the combo box gets populated, but it has two values So I am getting Project Name: XO Project XO Project There are two records that part is right, but the text in the actual drop down is duplicated. The query is correct so its not an issue with the sql and/or my cfc. It seems like there is a problem in the loop or something, I am not sure. Here is the combo box code: ?xml version=1.0 encoding=utf-8? mx:ComboBox xmlns:mx=http://www.adobe.com/2006/mxml; xmlns=* toolTip=List of Projects labelField=projectName mx:Script ![CDATA[ import com.adobe.actors.ApplicationState; import com.adobe.actors.Project; import mx.collections.ArrayCollection; [Bindable] public var firstEntry:String = All; public function selectProject( e:Project ) : void { var dp:ArrayCollection = dataProvider as ArrayCollection; for(var i:int=0; i dp.length; i++) { var test:Object = dp.getItemAt(i) as Project; if( test.id == e.projectId ) { selectedIndex = i; break; } } } ]] /mx:Script mx:dataProvider {ApplicationState.instance.listOfProjects} /mx:dataProvider /mx:ComboBox ** This is a snippet from my ApplicationState.as file private var _listOfProjects:ArrayCollection; [Bindable(event=projectsChanged)] public function set listOfProjects( ac:ArrayCollection ) : void { _listOfProjects = ac; var dummyProject:Project = new Project(); dummyProject.projectId = ; dummyProject.projectName = Select; _listOfProjects.addItemAt(dummyProject, 0 ); dispatchEvent( new FlexEvent(projectsChanged) ); } public function get listOfProjects() : ArrayCollection { return _listOfProjects; }
[flexcoders] CSS and background image?
Hi, I have an image I want to use for a header in this application, I have that working fine however, I am unsure how I can apply the following style. The image is 600px wide or so, and then I want this background image to repeat and fill the rest of my container. .masthead { padding: 0px; background-image: url(/images/masthead_bg.gif); background-repeat: repeat-x; border-bottom: 1px solid #B6BEC5; position: relative; color: #004884; } I am trying to get the same effect in my flex application. I put the image in an hbox, and I want the background to be applied to the hbox if thats even possible. mx:HBox id=headerBox styleName=masthead width=100% x=0 y=0 mx:Image source=@Embed('assets/logo.gif') scaleContent=true / /mx:HBox Any help appreciated.I also think some of the styles I have declared above won't work in the same manner in flex so if someone can provide me an example of how to do this that would be great. Thanks, -Malik
[flexcoders] Question on TabNavigator
Hi Few questions that I think should be easy to answer? 1. How can I space the tabs up in a tab navigator? I'd like to have space between each tab. They look too scrunched to me at least by default. 2. I am trying to build an application that has tabbed interface and I am wondering is this the way to go about it. 3. Is there a way to center the tabs in the middle? Currently they are left aligned by default My code is below: mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute frameRate=60 mx:TabNavigator borderColor=#00 borderStyle=solid height=100% width=100% backgroundColor=#ee mx:VBox label=Tab1 /mx:VBox mx:VBox label=Tab2 /mx:VBox mx:VBox label=Tab3 /mx:TabNavigator /mx:Application
[flexcoders] Re: Question on TabNavigator
Hi, Thanks for the help. I knew about the style explorer, but I just forgot about it. Your right it is really helpful. Thanks for reminding me about this. Its pretty slick. -Malik --- In flexcoders@yahoogroups.com, Nick Sophinos [EMAIL PROTECTED] wrote: Finally something that I feel qualified to help someone with: I found the Flex 2 Style Explorer indespensible for this sort of thing: http://examples.adobe.com/flex2/consulting/styleexplorer/Flex2StyleExplo\ rer.html For example, click on the Tabs menu items and build away! - Nick On 12/22/06, kasey.mccurdy [EMAIL PROTECTED] wrote: Hey there -- to space between the tabs -- there's a property called horizontalGap just try like 10 for exampleplay around with it. ill look into your other questions --- In flexcoders@yahoogroups.com, malik_robinson Malik_Robinson@ wrote: Hi Few questions that I think should be easy to answer? 1. How can I space the tabs up in a tab navigator? I'd like to have space between each tab. They look too scrunched to me at least by default. 2. I am trying to build an application that has tabbed interface and I am wondering is this the way to go about it. 3. Is there a way to center the tabs in the middle? Currently they are left aligned by default My code is below: mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute frameRate=60 mx:TabNavigator borderColor=#00 borderStyle=solid height=100% width=100% backgroundColor=#ee mx:VBox label=Tab1 /mx:VBox mx:VBox label=Tab2 /mx:VBox mx:VBox label=Tab3 /mx:TabNavigator /mx:Application
[flexcoders] Re: Cairngorm and working with Delegate question
Hi, It turns out that there is a problem with my remote object (I think), because after I make the call, this function is executed. I know this one is executed because I did a Alert.show('test') within this function and it does the alert so this function must be getting called after I try to make a remote object call. // this is called when the delegate receives a fault from the service public function fault( rpcEvent : Object ) : void { model.errorStatus = Fault occured in LoadEmployeesCommand.; } I am thinking it may not be finding my CFC, butI am not sure, I just know its not calling the result function, its calling the fault function. Any help appreciated --- In flexcoders@yahoogroups.com, malik_robinson [EMAIL PROTECTED] wrote: Hi, I am trying to learn to use Cairngorm and I am trying to find out where I am going wrong. I have a CFC which I am trying to call and get a string back for testing to make sure its all working. The delegate should call the result or the fault function in my LoginUserCommand if I am correct. I am trying to see if the problem is the call to the CFC or the problem is in my LoginUserCommand which has functions that should handle the result or a fault. I have this in my LoginUserDelegate package com.adobe.myApp.business { import mx.rpc.AsyncToken; import mx.rpc.IResponder; import com.adobe.cairngorm.business.ServiceLocator; import mx.controls.Alert; public class LoginUserDelegate { private var command : IResponder; private var service : Object; public function LoginUserDelegate( command : IResponder ) { this.service = ServiceLocator.getInstance().getService( 'loginUserService' ); this.command = command; } public function loginUserService() : void { var token:AsyncToken = service.send(); token.addResponder( command ); } } } My services.xml: ?xml version=1.0 encoding=utf-8? cairngorm:ServiceLocator xmlns:mx=http://www.adobe.com/2006/mxml; xmlns:cairngorm=com.adobe.cairngorm.business.* mx:RemoteObject id=loginUserService destination=Coldfusion source=cf.com.User showBusyCursor=true mx:method name=sayHelloString / /mx:RemoteObject Then I have a LoginUserCommand: package com.adobe.myApp.command { import mx.rpc.IResponder; import com.adobe.cairngorm.commands.Command; import com.adobe.cairngorm.control.CairngormEvent; import com.adobe.myApp.business.LoginUserDelegate; import com.adobe.myApp.model.AppModelLocator; public class LoginUserCommand implements Command, IResponder { private var model : AppModelLocator = AppModelLocator.getInstance(); public function execute( loginEvent:CairngormEvent ) : void { var delegate : LoginUserDelegate = new LoginUserDelegate( this ); delegate.loginUserService(); } // this is called when the delegate receives a result from the service public function result( rpcEvent : Object ) : void { trace(rpcEvent.result); } public function fault( rpcEvent : Object ) : void { model.errorStatus = Fault occured in LoadEmployeesCommand.; } } } /cairngorm:ServiceLocator
[flexcoders] Remote object not working when called from delegate
Hi, I am trying to find out why this remote object does not return successfully using Cairngorm. I can use the same remote object in an application just by itself. The remote object invokes a CFC method and populates a datagrid just fine, but when I am trying to use a delegate to call this service, it is not working. It works for an HTTPService, but not remote object. Below is my Services.xml files ?xml version=1.0 encoding=utf-8? cairngorm:ServiceLocator xmlns:mx= http://www.adobe.com/2006/mxml; xmlns:cairngorm=com.adobe.cairngorm.business.* mx:RemoteObject id= loginUserService destination=ColdFusion source=myApp.cf.com.countries showBusyCursor=true mx:method name=getCountries / /mx:RemoteObject /cairngorm:ServiceLocator Here is the delegate: package com.adobe.myApp.business { import mx.rpc.AsyncToken; import mx.rpc.IResponder; import com.adobe.cairngorm.business.ServiceLocator; import mx.controls.Alert; public class LoginUserDelegate { private var command : IResponder; private var service : Object; public function LoginUserDelegate( command : IResponder ) { this.service = ServiceLocator.getInstance().getService( 'loginUserService' ); this.command = command; } public function loginUserServices() : void { // call the service var token:AsyncToken = service.send(); // notify this command when the service call completes token.addResponder( command ); } } }
[flexcoders] Re: Getting RPC Error, Channel.Connect.Failed error NetConnection.Call.Failed:HTTP
Hi, Where are the log files located that would contain information about an error like this and if there are multiple similar to the logs in ColdFusion (if your familiar), which log am I looking for? Thanks, Malik --- In flexcoders@yahoogroups.com, Tom Chiverton [EMAIL PROTECTED] wrote: On Monday 14 August 2006 06:50, malik_robinson wrote: error NetConnection.Call.Failed: HTTP: Status 500] That's the internal error HTTP status code. What's in the server logs ? -- Tom Chiverton 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 Law Society. 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 * 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] Re: Getting RPC Error, Channel.Connect.Failed error NetConnection.Call.Failed:HTTP
Hi, I checked in the ColdFusion Server Admin Area and I noticed this next to the CF version: ColdFusion/Flex Connectivity Beta 3 I am using Flex Builder 2, not the beta, but it still says this. Perhaps this is the issue? I thought CF 7.02 came with the flex/cf connector, but for some reason mine is showing Beta and I am unsure how to remove the beta connector. -Malik --- In flexcoders@yahoogroups.com, Tom Chiverton [EMAIL PROTECTED] wrote: On Monday 14 August 2006 06:50, malik_robinson wrote: error NetConnection.Call.Failed: HTTP: Status 500] That's the internal error HTTP status code. What's in the server logs ? -- Tom Chiverton 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 Law Society. 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 * 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] Re: Getting RPC Error, Channel.Connect.Failed error NetConnection.Call.Failed:HTTP
Hi, I believe your right. I am just perplexed on why I am getting this error. The CFC works fine, The code worked before and is exactly the same. I am using FDS 2, and Flex Builder 2 so when I saw that beta in the CF admin, I thought it may be the reason why remote services is not working. -Malik --- In flexcoders@yahoogroups.com, Simeon Bateman [EMAIL PROTECTED] wrote: Malik, When mystic was made final did you install the last release? Mystic was the code name for 7.0.2 when it was in beta, and it was released the same day the Flex Builder was released. I would guess your beta message is in response to that, not flex builder. simeon On 8/15/06, malik_robinson [EMAIL PROTECTED] wrote: Hi, I checked in the ColdFusion Server Admin Area and I noticed this next to the CF version: ColdFusion/Flex Connectivity Beta 3 I am using Flex Builder 2, not the beta, but it still says this. Perhaps this is the issue? I thought CF 7.02 came with the flex/cf connector, but for some reason mine is showing Beta and I am unsure how to remove the beta connector. -Malik --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Tom Chiverton tom.chiverton@ wrote: On Monday 14 August 2006 06:50, malik_robinson wrote: error NetConnection.Call.Failed: HTTP: Status 500] That's the internal error HTTP status code. What's in the server logs ? -- Tom Chiverton 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 Law Society. 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 * 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] Re: Getting RPC Error, Channel.Connect.Failed error NetConnection.Call.Failed:HTTP
Hi, Well, good news, problem solved. I reinstalled Updater 7.02 for CF and boom, my code works again. I then looked in the CF Admin and that beta text is gone next to the CF version so apparently that was the issue. -Malik --- In flexcoders@yahoogroups.com, malik_robinson [EMAIL PROTECTED] wrote: Hi, I believe your right. I am just perplexed on why I am getting this error. The CFC works fine, The code worked before and is exactly the same. I am using FDS 2, and Flex Builder 2 so when I saw that beta in the CF admin, I thought it may be the reason why remote services is not working. -Malik --- In flexcoders@yahoogroups.com, Simeon Bateman simbateman@ wrote: Malik, When mystic was made final did you install the last release? Mystic was the code name for 7.0.2 when it was in beta, and it was released the same day the Flex Builder was released. I would guess your beta message is in response to that, not flex builder. simeon On 8/15/06, malik_robinson Malik_Robinson@ wrote: Hi, I checked in the ColdFusion Server Admin Area and I noticed this next to the CF version: ColdFusion/Flex Connectivity Beta 3 I am using Flex Builder 2, not the beta, but it still says this. Perhaps this is the issue? I thought CF 7.02 came with the flex/cf connector, but for some reason mine is showing Beta and I am unsure how to remove the beta connector. -Malik --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Tom Chiverton tom.chiverton@ wrote: On Monday 14 August 2006 06:50, malik_robinson wrote: error NetConnection.Call.Failed: HTTP: Status 500] That's the internal error HTTP status code. What's in the server logs ? -- Tom Chiverton 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 Law Society. 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 * 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] CreationComplete?
Hi, I am trying to populate this data grid upon page load. If the page I am working has the mx:application tag, then I can use creationComplete(), but what can I do if I am working on a page which does not contain the mx:application I can load the data grid if I write a function, but I want it to execute automatically. -Malik -- 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] Getting RPC Error, Channel.Connect.Failed error NetConnection.Call.Failed:HTTP
Hi, I seem to be getting this error all of a sudden on some test code that used to work. Using Flex 2. Here is a snippet: Error: [RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 500"] ?xml version="1.0" encoding="utf-8"?mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="initApp()" mx:Script![CDATA[import mx.rpc.events.*;import mx.collections.ArrayCollection;public function initApp():void {artSvc.getArtists.send();} ]]/mx:Script mx:RemoteObject id="artSvc" destination="ColdFusion" source="myApp.cf.com.artists" showBusyCursor="true" / mx:Panel toolTip="Contacts" id="contacts" height="325" title="Contacts"mx:HBox width="100%" height="100%"mx:DataGrid dataProvider="{artSvc.getArtists.lastResult}" editable="true" resizableColumns="true" sortableColumns="true" height="100%"mx:columnsmx:DataGridColumn headerText="First Name" dataField="FIRSTNAME"/mx:DataGridColumn headerText="Last Name" dataField="LASTNAME"/mx:DataGridColumn headerText="City" dataField="CITY"/mx:DataGridColumn headerText="State" dataField="STATE"/mx:DataGridColumn headerText="Fax" dataField="FAX" //mx:columns/mx:DataGrid/mx:HBox/mx:Panel /mx:Application __._,_.___ -- 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. __,_._,___
[flexcoders] Dump?
Hi, How can I dump the following variable loginVO and see its output? public function loginUser() : void { var loginVO : LoginVO = new LoginVO(); loginVO.username = username.text; loginVO.password = password.text; var event : LoginEvent = new LoginEvent( loginVO ); CairngormEventDispatcher.getInstance ().dispatchEvent( event ); } I would like to dump similar to how you dump the output of a variable in ColdFusion Thanks, -Malik -- 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] Can someone explain this code, its related to Cairngorm?
Hi, I am trying to understand the ModelLocator and how Cairngorm works. I have been reading, but I think I need some additional information on the code below if possible. 1. What is the difference between Public function and Public Static function. I assume Public functions can be called from anywhere in the application. But what about the public static 2. Any info about the ModelLocator would be helpful. [Bindable] public class ModelLocator implements com.adobe.cairngorm.model.ModelLocator { private static var modelLocator:code.model.ModelLocator; public static function getInstance() : code.model.ModelLocator { if ( modelLocator == null ) modelLocator = new code.model.ModelLocator(); return modelLocator; } //--- -- public function ModelLocator() { if ( code.model.ModelLocator.modelLocator != null ) throw new Error( Only one ModelLocator instance should be instantiated ); } //--- -- public function initialise() : void { } Thanks, Malik -- 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] Re: Can someone explain this code, its related to Cairngorm?
Hi, Thanks for the quick responses. Helps a bunch. Malik --- In flexcoders@yahoogroups.com, Paul Andrews [EMAIL PROTECTED] wrote: - Original Message - From: malik_robinson [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Friday, July 28, 2006 12:18 AM Subject: [flexcoders] Can someone explain this code, its related to Cairngorm? Hi, I am trying to understand the ModelLocator and how Cairngorm works. I have been reading, but I think I need some additional information on the code below if possible. 1. What is the difference between Public function and Public Static function. I assume Public functions can be called from anywhere in the application. But what about the public static When something is declared as static there can only be one class instance. There's no need to instantiate the class as an object in order to call a static function or access a public static member. 2. Any info about the ModelLocator would be helpful. [Bindable] public class ModelLocator implements com.adobe.cairngorm.model.ModelLocator This is the interface the class implements { private static var modelLocator:code.model.ModelLocator; A class (static) variable for use by a class (static) function. public static function getInstance() : code.model.ModelLocator Call this to get the instance of the ModelLocator. { if ( modelLocator == null ) If the ModelLocator has never been instantiated then create it, otherwise return it. This inforces that only one ModelLocator instance exists - a singleton. modelLocator = new code.model.ModelLocator(); return modelLocator; } //--- -- public function ModelLocator() This is the Class constructor. If this is called and the reference to the ModelLocator exists then something has gone wrong - the constructor is called by the static function above. If the constructor is called twice there's a problem - there can only be one ModelLocator. { if ( code.model.ModelLocator.modelLocator != null ) throw new Error( Only one ModelLocator instance should be instantiated ); } //--- -- public function initialise() : void { } Thanks, Malik Hope that helps Paul -- 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: [Junk E-Mail - MED] [flexcoders] Problem with States and switching to a give
Hi, Thanks for the quick response. Makes sense a bit more. I posted a similar question before and got good answer but still wanted to get some additional insight. Thanks for the help! -Malik --- In flexcoders@yahoogroups.com, Shannon Hicks [EMAIL PROTECTED] wrote: You need to have LoginPanel.mxml fire off an event, then have Main.mxml capture the event, and change the state as the event result. Add this code to LoginPanel.mxml: mx:Metadata [Event(name=loggedin,type=flash.events.event)] /mx:Metadata Then change this: mx:Button label=Login click=dispatchEvent(new Event(loggedin))/ In Main.mxml, add: mx:Script ![CDATA[ public function loginComplete():void { currentState=home; } ]] /mx:Script And change this: view:LoginPanel id=login loggedin=loginComplete() / Now, this code obviously isn't tested, but it should send you down the right path :) Shan _ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of malik_robinson Sent: Tuesday, July 18, 2006 9:58 PM To: flexcoders@yahoogroups.com Subject: [Junk E-Mail - MED] [flexcoders] Problem with States and switching to a given state. Hi, How do you change the state from within different mxml files. My code is below. As of now I do not have any functions or anything written. I am just trying to work with the states in a simplistic manner. I have 3 files. Main.mxml, LoginPanel.mxml, Home.mxml. I want the base state to be the login page when Main.mxml is run, once the user logs in, then I want to go to Home.mxml. Does anyone see how I can fix this given the code I have put together, any suggestions as well.I am trying to learn Cairngorm, but for now any assistance appreciated. Main.mxml mx:Application xmlns:mx=HYPERLINK http://www.adobe.com/2006/mxmlhttp://www.adobe.com/2006/mxml; layout=absolute horizontalScrollPolicy=off verticalScrollPolicy=off xmlns:view=com.myHR.view.* mx:states mx:State name=home mx:AddChild mx:target view:Home id=home / /mx:target /mx:AddChild mx:RemoveChild target={login} / /mx:State /mx:states view:LoginPanel id=login / /mx:Application Home.mxml ?xml version=1.0 encoding=utf-8? mx:Canvas xmlns:mx=HYPERLINK http://www.adobe.com/2006/mxmlhttp://www.adobe.com/2006/mxml; width=100% mx:HBox y=50 x=20 mx:Panel id=myCompanies height=325 title=Companies x=26 y=60 mx:HBox width=100% height=100% mx:DataGrid resizableColumns=true sortableColumns=true height=100% mx:columns mx:DataGridColumn headerText=Name dataField=col1/ mx:DataGridColumn headerText=Type dataField=col2/ mx:DataGridColumn headerText=Level dataField=col3/ /mx:columns /mx:DataGrid /mx:HBox /mx:Panel /mx:HBox /mx:Canvas LoginPanel.mxml ?xml version=1.0 encoding=utf-8? mx:Canvas xmlns:mx=HYPERLINK http://www.adobe.com/2006/mxmlhttp://www.adobe.com/2006/mxml; width=400 height=300 mx:Panel xmlns:mx=HYPERLINK http://www.adobe.com/2006/mxmlhttp://www.adobe.com/2006/mxml; xmlns:view=com.myApp.view.* title=Login horizontalAlign=center mx:Form id=loginForm mx:FormItem label=Username: mx:TextInput id=username/ /mx:FormItem mx:FormItem label=Password: mx:TextInput id=password displayAsPassword=true/ /mx:FormItem /mx:Form !-- My Problem is here. I want to go back to the home state, but the actual states tags are defined in Main.mxml --- mx:ControlBar horizontalAlign=right mx:Button label=Login click=currentState='Main.home'/ /mx:ControlBar /mx:Panel /mx:Canvas -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.10.1/390 - Release Date: 7/17/2006 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.10.1/390 - Release Date: 7/17/2006 Yahoo! Groups Sponsor ~-- Check out the new improvements in Yahoo! Groups email. http://us.click.yahoo.com/6pRQfA/fOaOAA/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: [Junk E-Mail - MED] [flexcoders] Problem with States and switching to a give
Hi,Thanks for the assistance here.This line seems to throw an error actually Shannon.mx:Metadata [Event(name="loggedin",type="flash.events.event")]/mx:Metadata In the "problems" panel it says:Event type 'flash.events:event' is unavailable.-Malik--- In flexcoders@yahoogroups.com, "Shannon Hicks" [EMAIL PROTECTED] wrote: You need to have LoginPanel.mxml fire off an event, then have Main.mxml capture the event, and change the state as the event result. Add this code to LoginPanel.mxml: mx:Metadata [Event(name="loggedin",type="flash.events.event")] /mx:Metadata Then change this: mx:Button label="Login" click="dispatchEvent(new Event(loggedin))"/ In Main.mxml, add: mx:Script ![CDATA[ public function loginComplete():void { currentState="home"; } ]] /mx:Script And change this: view:LoginPanel id="login" loggedin="loginComplete()" / Now, this code obviously isn't tested, but it should send you down the right path :) Shan _From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of malik_robinson Sent: Tuesday, July 18, 2006 9:58 PM To: flexcoders@yahoogroups.com Subject: [Junk E-Mail - MED] [flexcoders] Problem with States and switching to a given state. Hi, How do you change the state from within different mxml files. My code is below. As of now I do not have any functions or anything written. I am just trying to work with the states in a simplistic manner. I have 3 files. Main.mxml, LoginPanel.mxml, Home.mxml. I want the base state to be the login page when Main.mxml is run, once the user logs in, then I want to go to Home.mxml. Does anyone see how I can fix this given the code I have put together, any suggestions as well.I am trying to learn Cairngorm, but for now any assistance appreciated. Main.mxml mx:Application xmlns:mx="HYPERLINK "http://www.adobe.com/2006/mxml"http://www.adobe.com/2006/mxml" layout="absolute" horizontalScrollPolicy="off" verticalScrollPolicy="off" xmlns:view="com.myHR.view.*"mx:states mx:State name="home" mx:AddChild mx:target view:Home id="home" / /mx:target /mx:AddChild mx:RemoveChild target="{login}" / /mx:State /mx:states view:LoginPanel id="login" / /mx:Application Home.mxml ?xml version="1.0" encoding="utf-8"? mx:Canvas xmlns:mx="HYPERLINK "http://www.adobe.com/2006/mxml"http://www.adobe.com/2006/mxml" width="100%" mx:HBox y="50" x="20"mx:Panel id="myCompanies" height="325" title="Companies" x="26" y="60" mx:HBox width="100%" height="100%"mx:DataGrid resizableColumns="true" sortableColumns="true" height="100%" mx:columns mx:DataGridColumn headerText="Name" dataField="col1"/ mx:DataGridColumn headerText="Type" dataField="col2"/ mx:DataGridColumn headerText="Level" dataField="col3"/ /mx:columns/mx:DataGrid /mx:HBox /mx:Panel /mx:HBox /mx:Canvas LoginPanel.mxml ?xml version="1.0" encoding="utf-8"? mx:Canvas xmlns:mx="HYPERLINK "http://www.adobe.com/2006/mxml"http://www.adobe.com/2006/mxml" width="400" height="300" mx:Panel xmlns:mx="HYPERLINK "http://www.adobe.com/2006/mxml"http://www.adobe.com/2006/mxml" xmlns:view="com.myApp.view.*"title="Login" horizontalAlign="center"mx:Form id="loginForm" mx:FormItem label="Username: " mx:TextInput id="username"/ /mx:FormItem mx:FormItem label="Password: " mx:TextInput id="password" displayAsPassword="true"/ /mx:FormItem /mx:Form !-- My Problem is here. I want to go back to the home state, but the actual states tags are defined in Main.mxml --- mx:ControlBar horizontalAlign="right" mx:Button label="Login" click="currentState='Main.home'"/ /mx:ControlBar /mx:Panel /mx:Canvas -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.10.1/390 - Release Date: 7/17/2006-- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.10.1/390 - Release Date: 7/17/2006 __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http:
[flexcoders] Trying out Cairngorm Login Example
Hi, I am trying to use the Cairngorm framework and following this tutorial, but I get1 error and 1 warningthat prevent things from working http://weblogs.macromedia.com/auhlmann/ - Link to tutorial for those who may be looking. This is just a warning in Flexbuilder so it might not be a big deal: Design mode: Error creating item LoginPanel in parent ViewStack "appView". Please choose Design Refresh to refresh design mode.Login.mxml The "other error" that causes things to break is:'login': identifier and class may not have the same name.Loginline 47July 17, 2006. It points to this line of code: view:LoginPanel id="login" login="{ model.login }"/ It seems to be some name clashing due to perhaps a class being named the same as the id attribute of the above. I am using this code right out of the box. Anyone have any suggestions or possibilities. I tried renaming the 'id' to something else, but it seems to require that Id as I got tons of other errors in other files that seem to be looking for a specific value of 'login' for the id attribute when I renmaed it. Thanks, Malik __._,_.___ -- 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. __,_._,___
[flexcoders] Question on States
Hi, I am trying to utilize states to ultimately have a login page when my app loads, upon successful login, I want my main.mxml file to load which is basically the home page of my application. As of now in the states panel, I have a base state, but my base state is my home page and I do not want this. I want my login page to be the base state. In the states panel, I tried adding a state called home, but I think everything is on the same state, meaning my login is not the base and my home page is not on the home state. If I click the base state, should I only see whats on that state? Are states like layers in a sense, layers in terms of Photoshop or Fireworks? In design view I can switch between states, but nothing really happens. Any help appreciated. As of now I just have two files. 1 main mxml file and 1 custom component. This is my login.mxml page, which I wanted to be a custom component (code borrowed from a tutorial): ?xml version=1.0 encoding=utf-8? mx:Panel xmlns:mx=http://www.adobe.com/2006/mxml; xmlns=* layout=absolute title=Member Login width=275 height=150 mx:Script ![CDATA[ private function handleLoginEvent():void { lblTest.text = logging in...; //login logic } ]] /mx:Script mx:Label x=8 y=20 text=Username/ mx:Label x=14 y=50 text=Password/ mx:TextInput x=78 y=18 id=txtUID/ mx:TextInput x=78 y=48 id=txtPwd displayAsPassword=true/ mx:Button x=188 y=78 label=Login click=handleLoginEvent ()/ mx:Label x=78 y=78 id=lblTest/ /mx:Panel thx -Malik 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/
[flexcoders] Re: Flex beta 3/CF and Datagrid not being populated
Hi, Sweet it is working now. The "lastResult" worked. Sothat is basically a reference to my query object? Once I did that, just for tests I removed the : public function initApp():void {// Force artists class to loadartSvc.getArtists.send();} I removed the "send()" and it still worked so I am not sure of the reason for it? Is isa coding practice to use that, either way it worked with and without the send() method call. How would you reference an array? Lets say I had a CFC that returned like a 2D array? I guess I really looking for more information on how a datagridor tree control or whatever it may be would handle things of different data types like an array or a query object or whatever. Thanks for the help! Highly appreciated! -Malik --- In flexcoders@yahoogroups.com, "Tim Hoff" [EMAIL PROTECTED] wrote: Yeah, Sorry, use: artSvc.getArtists.lastResult for the dataProvider, without artists at the end. -TH --- In flexcoders@yahoogroups.com, "malik_robinson" Malik_Robinson@ wrote: Hi,I ended up getting an error, I think it was due to the text "lastResult". Below is the error:I am very curious to know if someone can try this simple example and get a datagrid to populate via a query object from CF.Error: Unknown Property 'artists'. at mx.collections::ListCollectionView/http://www.adobe.com/2006/actionsc rip\ t/flash/proxy::getProperty() at mx.binding::PropertyWatcher/::updateProperty() at mx.binding::Watcher/mx.binding:Watcher::wrapUpdate() at mx.binding::PropertyWatcher/updateParent() at mx.binding::Watcher/updateChildren() at mx.binding::PropertyWatcher/::updateProperty() at mx.binding::Watcher/mx.binding:Watcher::wrapUpdate() at mx.binding::PropertyWatcher/eventHandler() at flash.events::EventDispatcher/dispatchEvent() at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::r esu\ ltHandler() at mx.rpc::Responder/result() at mx.rpc::AsyncRequest/acknowledge() at ::NetConnectionMessageResponder/NetConnectionChannel.as$42:NetConne ction\ MessageResponder::resultHandler() at mx.messaging::MessageResponder/result() Here is the CFC:cfcomponentcffunction name="getArtists" access="remote" returntype="query"cfset var artists = '' /cfquery name="Artists" datasource="cfcodeexplorer"SELECT firstname, lastnameFROM ARTISTS/cfquerycfreturn Artists //cffunction/cfcomponentHere is the current MXML:?xml version="1.0" encoding="utf-8"? mx:Application xmlns:mx="http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml " layout="absolute" creationComplete="initApp()"mx:Script ![CDATA[ import mx.rpc.events.*; import mx.collections.ArrayCollection; public function initApp():void { // Force artists class to load artSvc.getArtists.send(); }]] /mx:Scriptmx:RemoteObject id="artSvc" destination="ColdFusion" source="myApp.cf.com.artists" showBusyCursor="true" / mx:DataGrid id="dg" dataProvider="{artSvc.getArtists.artists}" x="177" y="65" mx:columns mx:DataGridColumn headerText="First Name" dataField="firstName"/ mx:DataGridColumn headerText="Last Name" dataField="lastName"/ /mx:columns /mx:DataGrid/mx:Application--- In flexcoders@yahoogroups.com, "Tim Hoff" TimHoff@ wrote: Hi Malik, I can't test this, but this is how the examples that I've seen work. -TH ?xml version="1.0" encoding="utf-8"? mx:Application xmlns:mx="http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml " layout="absolute" creationComplete="initApp()" mx:Script ![CDATA[ import mx.collections.ArrayCollection; import mx.rpc.events.*; public function initApp():void { // Force artists class to load artSvc.getArtists.send(); } ]] /mx:Script mx:RemoteObject id="artSvc" destination="ColdFusion" source="myapp.cf.com.artists" showBusyCursor="true" / mx:DataGrid id="dgArtists" dataProvider="{artSvc.getArtists.lastResult.artists}" x="177" y="65" mx:columns mx:DataGridColumn headerText="First Name" dataField="firstname"/ mx:DataGridColumn headerText="Last Name" dataField="lastname"/ /mx:columns /mx:DataGrid /mx:Application --- In flexcoders@yahoogroups.com, "malik_robinson" Malik_Robinson@ wrote: Hi, I have the following code that I *thought* would work, but it doesnot. Can anyone see why this might not work? Basically the datagriddoes not get loaded, the browser says "transferring data fromlocalhost", but it never popul
[flexcoders] Re: Flex beta 3/CF and Datagrid not being populated
Hi, Thanks for the help. It is almost working. It now appears that the grid is being populated but I do not see anything in the grid. The reason I know its being populated is when i move my mouse over, it highlights the rows. It also adds a scroll bar to the display indicating there are more records than can be displayed in the grid due to the current size of the grid. The only problem now is I do not see the values in the columns. The CFC does work and I have tested it using a basic .cfm page. I think I we are almost there, I just do not see the actual values in the grid. 1. Also, what is lastResult. Where does that come from and how would one know about this? 2. Any idea why I do not see any actual text in the grid? I tried firstname, FIRSTNAME, as I heard someone reference that I need to use CAPS, but either way I do not get values in the grid. But it does appear records are there as I move the mouse over, it highlights the *would be value*. mx:DataGrid id=dg dataProvider={artSvc.getArtists.lastResult} x=177 y=65 mx:columns mx:DataGridColumn headerText=First Name dataField=FIRSTNAME/ mx:DataGridColumn headerText=Last Name dataField=LASTNAME/ /mx:columns /mx:DataGrid --- In flexcoders@yahoogroups.com, Tim Hoff [EMAIL PROTECTED] wrote: Yeah, Sorry, use: artSvc.getArtists.lastResult for the dataProvider, without artists at the end. -TH --- In flexcoders@yahoogroups.com, malik_robinson Malik_Robinson@ wrote: Hi, I ended up getting an error, I think it was due to the text lastResult. Below is the error: I am very curious to know if someone can try this simple example and get a datagrid to populate via a query object from CF. Error: Unknown Property 'artists'. at mx.collections::ListCollectionView/http://www.adobe.com/2006/actionsc rip\ t/flash/proxy::getProperty() at mx.binding::PropertyWatcher/::updateProperty() at mx.binding::Watcher/mx.binding:Watcher::wrapUpdate() at mx.binding::PropertyWatcher/updateParent() at mx.binding::Watcher/updateChildren() at mx.binding::PropertyWatcher/::updateProperty() at mx.binding::Watcher/mx.binding:Watcher::wrapUpdate() at mx.binding::PropertyWatcher/eventHandler() at flash.events::EventDispatcher/dispatchEvent() at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::r esu\ ltHandler() at mx.rpc::Responder/result() at mx.rpc::AsyncRequest/acknowledge() at ::NetConnectionMessageResponder/NetConnectionChannel.as$42:NetConne ction\ MessageResponder::resultHandler() at mx.messaging::MessageResponder/result() Here is the CFC: cfcomponent cffunction name=getArtists access=remote returntype=query cfset var artists = '' / cfquery name=Artists datasource=cfcodeexplorer SELECT firstname, lastname FROM ARTISTS /cfquery cfreturn Artists / /cffunction /cfcomponent Here is the current MXML: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml layout=absolute creationComplete=initApp() mx:Script ![CDATA[ import mx.rpc.events.*; import mx.collections.ArrayCollection; public function initApp():void { // Force artists class to load artSvc.getArtists.send(); } ]] /mx:Script mx:RemoteObject id=artSvc destination=ColdFusion source=myApp.cf.com.artists showBusyCursor=true / mx:DataGrid id=dg dataProvider={artSvc.getArtists.artists} x=177 y=65 mx:columns mx:DataGridColumn headerText=First Name dataField=firstName/ mx:DataGridColumn headerText=Last Name dataField=lastName/ /mx:columns /mx:DataGrid /mx:Application --- In flexcoders@yahoogroups.com, Tim Hoff TimHoff@ wrote: Hi Malik, I can't test this, but this is how the examples that I've seen work. -TH ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml layout=absolute creationComplete=initApp() mx:Script ![CDATA[ import mx.collections.ArrayCollection; import mx.rpc.events.*; public function initApp():void { // Force artists class to load artSvc.getArtists.send(); } ]] /mx:Script mx:RemoteObject id=artSvc destination=ColdFusion source=myapp.cf.com.artists showBusyCursor=true / mx:DataGrid id=dgArtists dataProvider={artSvc.getArtists.lastResult.artists} x=177 y=65 mx:columns mx:DataGridColumn headerText=First Name dataField=firstname/ mx:DataGridColumn headerText=Last Name dataField=lastname/ /mx:columns /mx:DataGrid /mx:Application --- In flexcoders@yahoogroups.com, malik_robinson Malik_Robinson@ wrote: Hi, I have the following code that I *thought* would work, but it does not. Can
[flexcoders] Re: Flex beta 3/CF and Datagrid not being populated
Hi, It is all working great now. I am using ColdFusion and once I used CAPS for the columnNames in the dataField="FIRSTNAME" as opposed to "firstname" it works beautifully. Thanks for all the tips as well. It really helps. I think once I get the foundation and the ability to do things that I have been doing in ColdFusion then I am well on my way. This stuff is really cool. -Malik --- In flexcoders@yahoogroups.com, "Tim Hoff" [EMAIL PROTECTED] wrote: Hi Malik, Glad to help. Here are a couple of answers to your questions. What is "lastResult". Where does that come from and how would one know about this? lastResult is the ActionScript object that is returned from an RPC call. The name was changed from result to lastResult to distinguish it from the result of an event. You can search the help docs for lastResult to learn more. Any idea why I do not see any actual text in the grid? I tried firstname, FIRSTNAME, as I heard someone reference that I need to use CAPS, but either way I do not get values in the grid. But it does appear records are there as I move the mouse over, it highlights the *would be value*. The field names of your lastResult object are case sensitive. They need to match the field names in your query exactly. In this case firstname and lastname. I removed the "send()" and it still worked so I am not sure of the reason for it? Is is a coding practice to use that, either way it worked with and without the send() method call. Yes, this is a common coding practice. It helps you and other programmers read the code quickly to see when the data service is being called. How would you reference an array? Lets say I had a CFC that returned like a 2D array? Another common practice is to cast the lastResult from a service call to an ArrayCollection or an XMLListCollection. These objects can be easily accessed, manipulated (filter, sort...) and bound to list-based controls (DataGrid, Tree...). The members of the ArrayCollection can be accessed with dot notations like: contactsAC.phoneNumbers.homePhone. It is also common to use onResult and onFault event listener functions with RPC calls. But, let's take this one step at a time. See the example below. ?xml version="1.0" encoding="utf-8"? mx:Application xmlns:mx="http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml " layout="absolute" creationComplete="initApp()" mx:Script ![CDATA[ import mx.collections.ArrayCollection; import mx.utils.ArrayUtil; import mx.rpc.events.*; public function initApp():void { // Force artists class to load artSvc.getArtists.send(); } ]] /mx:Script mx:RemoteObject id="artSvc" destination="ColdFusion" source="myapp.cf.com.artists" showBusyCursor="true" / mx:ArrayCollection id="artistsAC" source="mx.utils.ArrayUtil.toArray(artSvc.getArtists.lastResult)"/ mx:DataGrid id="dgArtists" dataProvider="{artistsAC}" x="177" y="65" mx:columns mx:DataGridColumn headerText="First Name" dataField="firstname"/ mx:DataGridColumn headerText="Last Name" dataField="lastname"/ /mx:columns /mx:DataGrid /mx:Application Hope that this helps, -TH --- In flexcoders@yahoogroups.com, "malik_robinson" Malik_Robinson@ wrote:Hi, Sweet it is working now. The "lastResult" worked. So that is basically a reference to my query object? Once I did that, just for tests I removed the : public function initApp():void { // Force artists class to load artSvc.getArtists.send(); } I removed the "send()" and it still worked so I am not sure of the reason for it? Is is a coding practice to use that, either way it worked with and without the send() method call. How would you reference an array? Lets say I had a CFC that returned like a 2D array? I guess I really looking for more information on how a datagrid or tree control or whatever it may be would handle things of different data types like an array or a query object or whatever. Thanks for the help! Highly appreciated! -Malik --- In flexcoders@yahoogroups.com, "Tim Hoff" TimHoff@ wrote: Yeah, Sorry, use: artSvc.getArtists.lastResult for the dataProvider, without artists at the end. -TH --- In flexcoders@yahoogroups.com, "malik_robinson" Malik_Robinson@ wrote: Hi, I ended up getting an error, I think it was due to the text"lastResult". Below is the error: I am very curious to know if someone can try this simple example and geta datagrid to populate via a query object from CF. Error: Unknown Property 'artists'.at mx.collections::ListCollectionView/http://www.adobe.com/2006/actionsc rip\t/flash/proxy::getProperty()at mx.binding::PropertyWatcher/::updateProperty()at mx.
[flexcoders] Flex beta 3/CF and Datagrid not being populated
Hi, I have the following code that I *thought* would work, but it does not. Can anyone see why this might not work? Basically the datagrid does not get loaded, the browser says transferring data from localhost, but it never populates the grid, no error, I see the show busy cursor and my empty datagrid. I am using CF 7 and there is a datasource that is defined when you install the tutorials. It is basically a database of artists or something. I wrote a test page to ensure my CFC works and it does return a query object, so I know the CFC is fine. I am just trying to have it load the datagrid upon creationComplete Here is the main.mxml: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute creationComplete=initApp() mx:Script ![CDATA[ import mx.collections.ArrayCollection; import mx.rpc.events.*; public function initApp():void { // Force artists class to load artSvc.getArtists(); } ]] /mx:Script mx:RemoteObject id=artSvc destination=ColdFusion source=myapp.cf.com.artists showBusyCursor=true / mx:DataGrid id=dgArtists dataProvider={artSvc.getArtists.artists} x=177 y=65 mx:columns mx:DataGridColumn headerText=First Name dataField=firstname/ mx:DataGridColumn headerText=Last Name dataField=lastname/ /mx:columns /mx:DataGrid /mx:Application Any ideas? -Malik Yahoo! Groups Sponsor ~-- Yahoo! Groups gets a make over. See the new email design. http://us.click.yahoo.com/XISQkA/lOaOAA/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] Re: Flex beta 3/CF and Datagrid not being populated
Hi, I ended up getting an error, I think it was due to the text "lastResult". Below is the error: I am very curious to know if someone can try this simple example and get a datagrid to populate via a query object from CF. Error: Unknown Property 'artists'.at mx.collections::ListCollectionView/http://www.adobe.com/2006/actionscript/flash/proxy::getProperty()at mx.binding::PropertyWatcher/::updateProperty()at mx.binding::Watcher/mx.binding:Watcher::wrapUpdate()at mx.binding::PropertyWatcher/updateParent()at mx.binding::Watcher/updateChildren()at mx.binding::PropertyWatcher/::updateProperty()at mx.binding::Watcher/mx.binding:Watcher::wrapUpdate()at mx.binding::PropertyWatcher/eventHandler()at flash.events::EventDispatcher/dispatchEvent()at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()at mx.rpc::Responder/result()at mx.rpc::AsyncRequest/acknowledge()at ::NetConnectionMessageResponder/NetConnectionChannel.as$42:NetConnectionMessageResponder::resultHandler()at mx.messaging::MessageResponder/result() Here is the CFC: cfcomponent cffunction name="getArtists" access="remote" returntype="query" cfset var artists = '' / cfquery name="Artists" datasource="cfcodeexplorer" SELECT firstname, lastname FROM ARTISTS /cfquery cfreturn Artists / /cffunction /cfcomponent Here is the current MXML: ?xml version="1.0" encoding="utf-8"?mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="initApp()" mx:Script![CDATA[import mx.rpc.events.*;import mx.collections.ArrayCollection;public function initApp():void {// Force artists class to loadartSvc.getArtists.send();} ]]/mx:Script mx:RemoteObject id="artSvc" destination="ColdFusion" source="myApp.cf.com.artists" showBusyCursor="true" / mx:DataGrid id="dg" dataProvider="{artSvc.getArtists.artists}" x="177" y="65"mx:columnsmx:DataGridColumn headerText="First Name" dataField="firstName"/mx:DataGridColumn headerText="Last Name" dataField="lastName"//mx:columns/mx:DataGrid/mx:Application --- In flexcoders@yahoogroups.com, "Tim Hoff" [EMAIL PROTECTED] wrote: Hi Malik, I can't test this, but this is how the examples that I've seen work. -TH ?xml version="1.0" encoding="utf-8"? mx:Application xmlns:mx="http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml " layout="absolute" creationComplete="initApp()" mx:Script ![CDATA[ import mx.collections.ArrayCollection; import mx.rpc.events.*; public function initApp():void { // Force artists class to load artSvc.getArtists.send(); } ]] /mx:Script mx:RemoteObject id="artSvc" destination="ColdFusion" source="myapp.cf.com.artists" showBusyCursor="true" / mx:DataGrid id="dgArtists" dataProvider="{artSvc.getArtists.lastResult.artists}" x="177" y="65" mx:columns mx:DataGridColumn headerText="First Name" dataField="firstname"/ mx:DataGridColumn headerText="Last Name" dataField="lastname"/ /mx:columns /mx:DataGrid /mx:Application --- In flexcoders@yahoogroups.com, "malik_robinson" Malik_Robinson@ wrote: Hi, I have the following code that I *thought* would work, but it does not. Can anyone see why this might not work? Basically the datagrid does not get loaded, the browser says "transferring data from localhost", but it never populates the grid, no error, I see the show busy cursor and my empty datagrid. I am using CF 7 and there is a datasource that is defined when you install the tutorials. It is basically a database of artists or something. I wrote a test page to ensure my CFC works and it does return a query object, so I know the CFC is fine. I am just trying to have it load the datagrid upon creationComplete Here is the main.mxml: ?xml version="1.0" encoding="utf-8"? mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="initApp()" mx:Script ![CDATA[ import mx.collections.ArrayCollection; import mx.rpc.events.*;public function initApp():void { // Force artists class to load artSvc.getArtists(); } ]] /mx:Script mx:RemoteObject id="artSvc" destination="ColdFusion" source="myapp.cf.com.artists" showBusyCursor="true" / mx:DataGrid id="dgArtists" dataProvider="{artSvc.getArtists.artists}" x="177" y="65" mx:columns mx:DataGridColumn headerText="First Name" dataField="firstname"/ mx:DataGridColumn headerText="Last Name" dataField="lastname"/ /mx:colu
[flexcoders] Flex/CF Tutorial PDF Posted on Adobe Site, having problem, getting errors.
Hi, I am trying to use this example to get Flex 2.0 Beta 3, Mystic, and CF 7.02 to work together but having some problems. If someone has a few moments to help that would be great, there is not much code to struggle through and this example is posted on the Macromedia/Adobe Site. I am using CF 7.02 with the built in web server, Flex 2.0 Beta 3, FDS, with CF Extensions. The code I am trying is here: http://download.macromedia.com/pub/labs/flex/2/b3_usingcfwithflex_0503.pdf. This is posted on the Macromedia site. Has anyone gotten this to work? I am trying to follow the code in "section 1" of this PDF. It specifically states: "To specify a CFC to connect to, you do one of the following:" This seems to mean I can use a "Named Resource" OR specify the full path to the cfc in the source attribute which is what I am trying to do. I know the Flex can see my CFC and that this is not a path issue or a case where it can't find the CFC because I accidentally declared two methods with the same name, compiled the Flex App and ran it, and it told me that I can't declare two methods with the same name obviously. The error I am getting when clicking "Get Secure Data" is: [RPC Fault faultString="Didn't receive an acknowledge message" faultCode="Server.Acknowledge.Failed" faultDetail="Was expecting mx.messaging.messages.AcknowledgeMessage, but received null"]at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()at mx.rpc::Responder/fault()at mx.rpc::AsyncRequest/fault()at ::NetConnectionMessageResponder/NetConnectionChannel.as$42:NetConnectionMessageResponder::resultHandler()at mx.messaging::MessageResponder/result()The MXML File: ?xml version="1.0" encoding="utf-8"?mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" layout="absolute" mx:Script![CDATA[import mx.rpc.events.ResultEvent;import mx.utils.ObjectUtil;import mx.controls.Alert;import mx.rpc.events.FaultEvent;private function logIn():void{cf.setRemoteCredentials(this.username.text, this.password.text);}private function logOut():void{cf.setRemoteCredentials(null, null);cf.logoutuser();}private function getData():void{cf.getData();}private function serverFault(event:FaultEvent):void{Alert.show( ObjectUtil.toString(event.fault) );Alert.show( "error" );}private function serverResult(event:ResultEvent):void{Alert.show( ObjectUtil.toString(event));Alert.show( "success" );}]]/mx:Scriptmx:RemoteObject id="cf" destination="ColdFusion" source="myapp.com.menu"mx:method name="getData" result="serverResult(event)" fault="serverFault(event)" /mx:method name="logoutuser" //mx:RemoteObjectmx:Form x="10" y="10"mx:FormItem label="username"mx:TextInput id="username" text="admin"//mx:FormItemmx:FormItem label="password"mx:TextInput id="password" text="adminpwd"//mx:FormItemmx:FormItem direction="horizontal"mx:Button label="Login" click="logIn();"/mx:Button label="Logout" click="logOut()"//mx:FormItemmx:Button label="Get Secure Data" click="getData();"//mx:Form /mx:Application This seems to be a basic app. It only has 3 files. The mxml file, the cfc and the application.cfm file. Can anyone try this or shed some light. The app loads fine no errors. I click "Login" It sets some cookie no errors at all. I click "Logout" and it errors with : ArgumentError: Error #2004: One of the parameters is invalid. I click "Get Secure Data" and I get the big error message I displayed above. Any help appreciated. Thanks, -MR __._,_.___ -- 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] Re: New to Flex, and mxml and getting an error trying to use RSS
Hi, thanks for the help. Everything seems to be working fine and I am getting the data in my grid, appreciated. -Malik --- In flexcoders@yahoogroups.com, Franck de Bruijn [EMAIL PROTECTED] wrote: Hi Malik, I have been able to reproduce your error. The '?xml . ' part needs to start at exactly the 1st row and the 1st column of your .mxml file. If you add a space or a new line before it, the error you mention below will appear. I think we were a little bit put on the wrong foot thinking your problem was a runtime error, but it appears to be a compile time error. Try to be more specific next time. Cheers, Franck _ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of malik_robinson Sent: vrijdag 6 januari 2006 8:52 To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: New to Flex, and mxml and getting an error trying to use RSS Hi, I get this error with that code: The processing instruction target matching [xX][mM][lL] is not allowed. I copied that exact code into flex builder 2 alpha version and I get that error message. I wonder do I not have it setup correctly. -Malik --- In flexcoders@yahoogroups.com, fla coder [EMAIL PROTECTED] wrote: the example still works for me today try this code: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.macromedia.com/2005/mxml; xmlns=* initialize=feedRequest.send() mx:HTTPService id=feedRequest url=http://weblogs.macromedia.com/mchotin/index.xml; useProxy=false/ mx:Canvas width=100% height=100% mx:Label x=20 y=50 text={feedRequest.result.rss.channel.title }/ mx:DataGrid x=20 y=80 width=400 dataProvider={ feedRequest.result.rss.channel.item} id=dgPosts mx:columns mx:DataGridColumn headerText=Posts columnName=title/ mx:DataGridColumn headerText=Date columnName=pubDate/ /mx:columns /mx:DataGrid mx:TextArea x=20 y=245 width=400 htmlText={ dgPosts.selectedItem.description}/ mx:Link x=20 y=300 label=Read full post click=getURL ( dgPosts.selectedItem.link);/ /mx:Canvas /mx:Application On 04/01/06, malik_robinson [EMAIL PROTECTED] wrote: Hi, I tried pointing it at the following URL: weblogs.macromedia.com/mchotin and I received the same error, can you try it using this URL and let me know if you are able to see the result. This URL should have the crossdomain.xml file in it as this URL is used in a tutorial on the Macromedia/Adobe website. Thanks for the response. Malik --- In flexcoders@yahoogroups.com, Franck de Bruijn [EMAIL PROTECTED] wrote: Hi Malik, It looks like your url is not pointing to a real XML file. I tried your app and I got the message 'Error #1090: XML parser failure: element is malformed'. Also be aware that you cannot point to any arbitrary URL in the WWW, since Flex apps are only allowed to obtain resources from the server they have been deployed from, unless there is a crossdomain.xml file present granting you access to the resource. Cheers, Franck _ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of malik_robinson Sent: dinsdag 3 januari 2006 8:14 To: flexcoders@yahoogroups.com Subject: [flexcoders] New to Flex, and mxml and getting an error trying to use RSS Hi, I am very new to Flex and trying to try some basic tutorials in the help documentation that comes with Flex Builder 2 alpha. I searched the mailing list/archives trying to find out why I get the following error message but to no avail. The error is below: The processing instruction target matching [xX][mM][IL] is not allowed. My code is below and is basically from the documentation that comes with the flex builder 2 alpha 1 version. The main difference is I am trying to point it as a different url other than the weblogs.macromedia.com/mchotin or whatever the exact url is. I am trying to point it at a different URL. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.macromedia.com/2005/mxml; xmlns=* initialize=feedRequest.send() mx:HTTPService id=feedRequest url=http://groups.yahoo.com/group/flexcoders/; useProxy=false/ mx:Canvas width=100% height=100% mx:Label x=20 y=50 text={feedRequest.result.rss.channel.title}/ mxataGrid x=20 y=80 id=dgPosts width=400 mx:columns mxataGridColumn headerText=Column 1 columnName=col1/ mxataGridColumn headerText=Column 2 columnName=col2/ /mx:columns /mxataGrid
[flexcoders] Re: New to Flex, and mxml and getting an error trying to use RSS
Hi,I tried pointing it at the following URL:weblogs.macromedia.com/mchotin and I received the same error, can you try it using this URL and let me know if you are able to see the result. This URL should have the crossdomain.xml file in it as this URL is used in a tutorial on the Macromedia/Adobe website.Thanks for the response.Malik--- In flexcoders@yahoogroups.com, "Franck de Bruijn" [EMAIL PROTECTED] wrote: Hi Malik,It looks like your url is not pointing to a real XML file. I tried your app and I got the message 'Error #1090: XML parser failure: element is malformed'.Also be aware that you cannot point to any arbitrary URL in the WWW, since Flex apps are only allowed to obtain resources from the server they have been deployed from, unless there is a crossdomain.xml file present granting you access to the resource.Cheers, Franck_ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of malik_robinson Sent: dinsdag 3 januari 2006 8:14 To: flexcoders@yahoogroups.com Subject: [flexcoders] New to Flex, and mxml and getting an error trying to use RSSHi, I am very new to Flex and trying to try some basic tutorials in the help documentation that comes with Flex Builder 2 alpha. I searched the mailing list/archives trying to find out why I get the following error message but to no avail. The error is below: "The processing instruction target matching "[xX][mM][IL]" is not allowed." My code is below and is basically from the documentation that comes with the flex builder 2 alpha 1 version. The main difference is I am trying to point it as a different url other than the weblogs.macromedia.com/mchotin or whatever the exact url is. I am trying to point it at a different URL. ?xml version="1.0" encoding="utf-8"? mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml" xmlns="*" initialize="feedRequest.send()" mx:HTTPService id="feedRequest" url="" useProxy="false"/ mx:Canvas width="100%" height="100%" mx:Label x="20" y="50" text="{feedRequest.result.rss.channel.title}"/ mxataGrid x="20" y="80" id="dgPosts" width="400" mx:columns mxataGridColumn headerText="Column 1" columnName="col1"/ mxataGridColumn headerText="Column 2" columnName="col2"/ /mx:columns /mxataGrid mx:TextArea x="20" y="245" width="400" / mx:Link x="20" y="300" label="Read Full Post" / /mx:Canvas /mx:Application -- 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 http://groups.yahoo.com/group/flexcoders " on the web. * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to the Yahoo! http://docs.yahoo.com/info/terms/ 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 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] New to Flex, and mxml and getting an error trying to use RSS
Hi, I am very new to Flex and trying to try some basic tutorials in the help documentation that comes with Flex Builder 2 alpha. I searched the mailing list/archives trying to find out why I get the following error message but to no avail. The error is below: The processing instruction target matching [xX][mM][IL] is not allowed. My code is below and is basically from the documentation that comes with the flex builder 2 alpha 1 version. The main difference is I am trying to point it as a different url other than the weblogs.macromedia.com/mchotin or whatever the exact url is. I am trying to point it at a different URL. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.macromedia.com/2005/mxml; xmlns=* initialize=feedRequest.send() mx:HTTPService id=feedRequest url=http://groups.yahoo.com/group/flexcoders/; useProxy=false/ mx:Canvas width=100% height=100% mx:Label x=20 y=50 text={feedRequest.result.rss.channel.title}/ mx:DataGrid x=20 y=80 id=dgPosts width=400 mx:columns mx:DataGridColumn headerText=Column 1 columnName=col1/ mx:DataGridColumn headerText=Column 2 columnName=col2/ /mx:columns /mx:DataGrid mx:TextArea x=20 y=245 width=400 / mx:Link x=20 y=300 label=Read Full Post / /mx:Canvas /mx:Application -- 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/