RE: [flexcoders] Is it possible to return multiple recordsets to Flex from one Remote Object call
Darius, I dont know, passing back an uber array feels a bit monolithic (but maybe good for performance?). Why not break them down into different Arrays of Value Objects. For example: EmployeeListVO array of Employee VOs InvoiceListVO array of Invoice VOs FooListVO array of Foo VOs Now you have the fine grained control of just asking for one or all of them. And you can do what you want with each. We represent our VOs as CFCs. This allows you to type the package path in the returnType attribute of your CFCs. Queries and Structures are not typed, you could get anything back and ColdFusion wont report any problems. How do you check for a well formed Struct or a well formed Query? You might also want to look at the advantages of automatic object conversion into ActionScript. You could have a 1:1 mapping between FooVO.cfc and FooVO.as. Hope that helps, Allen www.prismix.com/ From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Mika Kiljunen Sent: 19 August 2005 06:42 To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Is it possible to return multiple recordsets to Flex from one Remote Object call Why not return an arrray containing recordsets and then setting the recordsets from the array as dataproviders to your controls by actionscript as follows: resultArray looks like: [0] Recordset1 (an array of resultobjects from query 1) [1] Recordset2 (an array of resultobjects from query 2) [2] Recordset3 (an array of resultobjects from query 3) . And: myGrid.dataProvider = resultArray[0]; myOtherGrid.dataProvider = resultArray[1]; -Mika From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of coldfs Sent: 19. elokuuta 2005 3:40 To: flexcoders@yahoogroups.com Subject: [flexcoders] Is it possible to return multiple recordsets to Flex from one Remote Object call Hi, My Flex app connects to a large ColdFusion application. When I make calls from Flex via RO to CF, I need to return more than one recordset in order to populate my various datagrids. I know how to return one recordset as an Array of Structures, but what if I have 5 different querries that have 5 different recordsets. How does one deal with this? Many thanks for any clarification one can give. Darius -- 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. -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.338 / Virus Database: 267.10.12/77 - Release Date: 18/08/2005 -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.338 / Virus Database: 267.10.12/77 - Release Date: 18/08/2005
RE: [flexcoders] Is it possible to return multiple recordsets to Flex from one Remote Object call
I'd take a very different view on this; if you have a business need to pass back a collection of data, that collection of data must have some "semantic" business meaning. Perhaps it is "initialisation data" or "customer overview" or "customer portfolio" or "dashboard summary" or something similar. A "dashboard summary" might be a list of recent orders, a list of sales by territory and a summary of invoices owed. So ... I'd create a business object - let's call it DashboardSummaryVO - and that would contain an array of OrderVO (recent orders), an array of TerritorySalesVO (sales by territory - probably a business object that by composition contains a further array of SalesVO objects) and an array of InvoiceVOs (for oustanding invoices). I'd then return that DashboardSummaryVO from my service, which encapsulates in business/object terms, the data that is being returned to the client. Furthermore, the code that picks apart the DashboardSummaryVO and updates your model/whatever will have infinitely more clarity for this object model. Flex is the technology, but Object Oriented design is the paradigm (I hate people that use that word too), so be mindful of creating a well-defined object model. Make sense ? Steven -- Steven WebsterTechnical Director iteration::two[EMAIL PROTECTED] Office: +44 (0)131 338 6108Mobile: +44 (0)7977 216 223 This e-mail and any associated attachments transmitted with it may contain confidential information and must not be copied, or disclosed, or used by anyone other than the intended recipient(s). If you are not the intended recipient(s) please destroy this e-mail, and any copies of it, immediately.Please also note that while software systems have been used to try to ensure that this e-mail has been swept for viruses, iteration::two do not accept responsibility for any damage or loss caused in respect of any viruses transmitted by the e-mail. Please ensure your own checks are carried out before any attachments are opened. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Allen ManningSent: 19 August 2005 13:19To: flexcoders@yahoogroups.comSubject: RE: [flexcoders] Is it possible to return multiple recordsets to Flex from one Remote Object call Darius, I dont know, passing back an uber array feels a bit monolithic (but maybe good for performance?). Why not break them down into different Arrays of Value Objects. For example: EmployeeListVO array of Employee VOs InvoiceListVO array of Invoice VOs FooListVO array of Foo VOs Now you have the fine grained control of just asking for one or all of them. And you can do what you want with each. We represent our VOs as CFCs. This allows you to type the package path in the returnType attribute of your CFCs. Queries and Structures are not typed, you could get anything back and ColdFusion wont report any problems. How do you check for a well formed Struct or a well formed Query? You might also want to look at the advantages of automatic object conversion into ActionScript. You could have a 1:1 mapping between FooVO.cfc and FooVO.as. Hope that helps, Allen www.prismix.com/ From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Mika KiljunenSent: 19 August 2005 06:42To: flexcoders@yahoogroups.comSubject: RE: [flexcoders] Is it possible to return multiple recordsets to Flex from one Remote Object call Why not return an arrray containing recordsets and then setting the recordsets from the array as dataproviders to your controls by actionscript as follows: resultArray looks like: [0] Recordset1 (an array of resultobjects from query 1) [1] Recordset2 (an array of resultobjects from query 2) [2] Recordset3 (an array of resultobjects from query 3) . And: myGrid.dataProvider = resultArray[0]; myOtherGrid.dataProvider = resultArray[1]; -Mika From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of coldfsSent: 19. elokuuta 2005 3:40To: flexcoders@yahoogroups.comSubject: [flexcoders] Is it possible to return multiple recordsets to Flex from one Remote Object call Hi,My Flex app connects to a large ColdFusion application. When I make calls from Flex via RO to CF, I need to return more than one recordset in order to populate my various datagrids. I know how to return one recordset as an Array of Structures, but what if I have 5 different querries that have 5 different recordsets. How does one deal with this?Many thanks for any clarification one can give.Darius --No virus found in this incoming message.Checked by AVG Anti-Virus.Version: 7.0.338 / Virus Database: 267.10.12/77 - Release Date: 18/08/2005 --No virus found in this outgoing message.Checked by AVG Anti-Virus.Version: 7.0.338 / Virus Database: 267.10.12/77 - Release Date: 18/08/2005 -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives:
RE: [flexcoders] Is it possible to return multiple recordsets to Flex from one Remote Object call
Steven, I think you are right. My point was more about breaking them into VOs first, rather then piping the whole query back direct. Allen www.prismix.com/ From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Steven Webster Sent: 19 August 2005 14:10 To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Is it possible to return multiple recordsets to Flex from one Remote Object call I'd take a very different view on this; if you have a business need to pass back a collection of data, that collection of data must have some semantic business meaning. Perhaps it is initialisation data or customer overview or customer portfolio or dashboard summary or something similar. A dashboard summary might be a list of recent orders, a list of sales by territory and a summary of invoices owed. So ... I'd create a business object - let's call it DashboardSummaryVO - and that would contain an array of OrderVO (recent orders), an array of TerritorySalesVO (sales by territory - probably a business object that by composition contains a further array of SalesVO objects) and an array of InvoiceVOs (for oustanding invoices). I'd then return that DashboardSummaryVO from my service, which encapsulates in business/object terms, the data that is being returned to the client. Furthermore, the code that picks apart the DashboardSummaryVO and updates your model/whatever will have infinitely more clarity for this object model. Flex is the technology, but Object Oriented design is the paradigm (I hate people that use that word too), so be mindful of creating a well-defined object model. Make sense ? Steven -- Steven Webster Technical Director iteration::two [EMAIL PROTECTED] Office: +44 (0)131 338 6108 Mobile: +44 (0)7977 216 223 This e-mail and any associated attachments transmitted with it may contain confidential information and must not be copied, or disclosed, or used by anyone other than the intended recipient(s). If you are not the intended recipient(s) please destroy this e-mail, and any copies of it, immediately. Please also note that while software systems have been used to try to ensure that this e-mail has been swept for viruses, iteration::two do not accept responsibility for any damage or loss caused in respect of any viruses transmitted by the e-mail. Please ensure your own checks are carried out before any attachments are opened. From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Allen Manning Sent: 19 August 2005 13:19 To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Is it possible to return multiple recordsets to Flex from one Remote Object call Darius, I dont know, passing back an uber array feels a bit monolithic (but maybe good for performance?). Why not break them down into different Arrays of Value Objects. For example: EmployeeListVO array of Employee VOs InvoiceListVO array of Invoice VOs FooListVO array of Foo VOs Now you have the fine grained control of just asking for one or all of them. And you can do what you want with each. We represent our VOs as CFCs. This allows you to type the package path in the returnType attribute of your CFCs. Queries and Structures are not typed, you could get anything back and ColdFusion wont report any problems. How do you check for a well formed Struct or a well formed Query? You might also want to look at the advantages of automatic object conversion into ActionScript. You could have a 1:1 mapping between FooVO.cfc and FooVO.as. Hope that helps, Allen www.prismix.com/ From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Mika Kiljunen Sent: 19 August 2005 06:42 To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Is it possible to return multiple recordsets to Flex from one Remote Object call Why not return an arrray containing recordsets and then setting the recordsets from the array as dataproviders to your controls by actionscript as follows: resultArray looks like: [0] Recordset1 (an array of resultobjects from query 1) [1] Recordset2 (an array of resultobjects from query 2) [2] Recordset3 (an array of resultobjects from query 3) . And: myGrid.dataProvider = resultArray[0]; myOtherGrid.dataProvider = resultArray[1]; -Mika From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of coldfs Sent: 19. elokuuta 2005 3:40 To: flexcoders@yahoogroups.com Subject: [flexcoders] Is it possible to return multiple recordsets to Flex from one Remote Object call Hi, My Flex app connects to a large ColdFusion application. When I make calls from Flex via RO to CF, I need to return more than one recordset in order to populate my various datagrids. I know how to return one recordset as an Array of Structures, but what if I have 5 different querries that have 5 different
RE: [flexcoders] Is it possible to return multiple recordsets to Flex from one Remote Object call
Allen Stephen, Thank you both for you advice. I like your ideas of passing back an Array of Value Objects. I've read only generalities on how to actually code this. Currently, my Flex app calls a cfc thatincludes a query and populates an Array of Structures. I took a stab at trying to re-code this buthave gotten stuck (code below). I think I'm still unclear as to how to build an array of VOs (let alone returning multiple one's). Can you take a look? BTW, I just finished Chapter 8 of your great book, Stephen! I know all us Flex newbies are indebted to you for this invaluable resource. Best regards, Darius Flex: private function getObject():Void{var aperson :Object = new Object();aperson.username="dfatta";aperson.CCode= "37";aperson.CFlag="No";aperson.COAFlag = "No";ro.getObject({p:aperson});} CFC: cfcomponent cffunction name="getObject" access="remote" returnType="Array" cfargument name="p" required="true" type="Array"cfset var arrResult =ArrayNew(1)cfset AuthorizedUserId =p[1] cfset CCode =p[2]cfset CFlag =p[3]cfset COAFlag =p[4] cfinclude template="qry_UpdateAuthorization.cfm" cfoutput query="qGetUpdateAuthorization"cfset stItem = StructNew()/cfset stItem["Function"] = #qGetUpdateAuthorization.Function#cfset stItem["Description"] = #qGetUpdateAuthorization.Description#cfset arrayAppend(arrResult,stItem)/ /cfoutput cfreturn arrResult/ /cffunction/cfcomponent -Original Message-From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]On Behalf Of Allen ManningSent: Friday, August 19, 2005 5:19 AMTo: flexcoders@yahoogroups.comSubject: RE: [flexcoders] Is it possible to return multiple recordsets to Flex from one Remote Object call Darius, I don’t know, passing back an uber array feels a bit monolithic (but maybe good for performance?). Why not break them down into different Array’s of Value Objects. For example: EmployeeListVO – array of Employee VOs InvoiceListVO – array of Invoice VOs FooListVO – array of Foo VOs Now you have the fine grained control of just asking for one or all of them. And you can do what you want with each. We represent our VOs as CFCs. This allows you to type the package path in the returnType attribute of your CFCs. Queries and Structures are not typed, you could get anything back and ColdFusion won’t report any problems. How do you check for a well formed Struct or a well formed Query? You might also want to look at the advantages of automatic object conversion into ActionScript. You could have a 1:1 mapping between FooVO.cfc and FooVO.as. Hope that helps, Allen www.prismix.com/ From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Mika KiljunenSent: 19 August 2005 06:42To: flexcoders@yahoogroups.comSubject: RE: [flexcoders] Is it possible to return multiple recordsets to Flex from one Remote Object call Why not return an arrray containing recordsets and then setting the recordsets from the array as dataproviders to your controls by actionscript as follows: resultArray looks like: [0] Recordset1 (an array of resultobjects from query 1) [1] Recordset2 (an array of resultobjects from query 2) [2] Recordset3 (an array of resultobjects from query 3) …. And: myGrid.dataProvider = resultArray[0]; myOtherGrid.dataProvider = resultArray[1]; … -Mika From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of coldfsSent: 19. elokuuta 2005 3:40To: flexcoders@yahoogroups.comSubject: [flexcoders] Is it possible to return multiple recordsets to Flex from one Remote Object call Hi,My Flex app connects to a large ColdFusion application. When I make calls from Flex via RO to CF, I need to return more than one recordset in order to populate my various datagrids. I know how to return one recordset as an Array of Structures, but what if I have 5 different querries that have 5 different recordsets. How does one deal with this?Many thanks for any clarification one can give.Darius --No virus found in this incoming message.Checked by AVG Anti-Virus.Version: 7.0.338 / Virus Database: 267.10.12/77 - Release Date: 18/08/2005 --No virus found in this outgoing message.Checked by AVG Anti-Virus.Version: 7.0.338 / Virus Database: 267.10.12/77 - Release Date: 18/08/2005 -- 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.
RE: [flexcoders] Is it possible to return multiple recordsets to Flex from one Remote Object call
Why not return an arrray containing recordsets and then setting the recordsets from the array as dataproviders to your controls by actionscript as follows: resultArray looks like: [0] Recordset1 (an array of resultobjects from query 1) [1] Recordset2 (an array of resultobjects from query 2) [2] Recordset3 (an array of resultobjects from query 3) . And: myGrid.dataProvider = resultArray[0]; myOtherGrid.dataProvider = resultArray[1]; -Mika From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of coldfs Sent: 19. elokuuta 2005 3:40 To: flexcoders@yahoogroups.com Subject: [flexcoders] Is it possible to return multiple recordsets to Flex from one Remote Object call Hi, My Flex app connects to a large ColdFusion application. When I make calls from Flex via RO to CF, I need to return more than one recordset in order to populate my various datagrids. I know how to return one recordset as an Array of Structures, but what if I have 5 different querries that have 5 different recordsets. How does one deal with this? Many thanks for any clarification one can give. Darius -- 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.