Re: [flexcoders] Re: what the hell am I doing wrong here
In the first CFC you set the return type to STRING but actually returning a QUERY! cffunction name=qpAdminFiles access=remote returntype=string output=true cfargument name=mySearch type=string required=yes / cfquery name=qpAdminFiles datasource=#application.dsn# select * from tbl_smartPanel_propInfo where fld_fileNum like '%#arguments.mySearch#%' /cfquery cfreturn qpAdminFiles / /cffunction In the second CFC you haven't specified a return type but returning a QUERY again. cffunction name=qpTest access=remote output=true cfargument name=mySearch type=string required=no / cfquery name=qpTest datasource=#application.dsn# select * from tbl_smartPanel_propInfo_Sale where fld_fileNum like '%#arguments.mySearch#%' /cfquery cfreturn qpTest / /cffunction Note that coldfusion might get you the result when you dont specify a return type(may be it assumes returntype=any if you dont specify one) but for webservice you should specify one. Code a new CFC function which will return a STRING and make sure you could get the output in your flex app. Mohanraj --- Jeff Tapper [EMAIL PROTECTED] wrote: Jeremy - Testing as a web service from a cfm page is still throwing errors. Looks like you are missing the return type on the method. Thats required for making cfcs available as a WebService: cfobject webservice=http://flex.homesmartagent.com/wsdl/hs2f.cfc?wsdl; name=srv/ cfset test = srv.qpTest(hi there) cfdump var=#test# AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException faultSubcode: faultString: Error attempting to create Java skeleton for CFC web service; nested exception is: coldfusion.xml.rpc.CFCInvocationException: [coldfusion.xml.rpc.CFCInvocationException : returnType must be defined for remote CFC functions.] faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}hostname:Webserver1 At 02:01 PM 12/29/2005, you wrote: I removed the function and added this new function. I can invoke the cfc correctly with in a cfm page. cffunction name=qpTest access=remote output=true cfargument name=mySearch type=string required=no / cfquery name=qpTest datasource=#application.dsn# select * from tbl_smartPanel_propInfo_Sale where fld_fileNum like '%#arguments.mySearch#%' /cfquery cfreturn qpTest / /cffunction --- In flexcoders@yahoogroups.com, Jeff Tapper [EMAIL PROTECTED] wrote: Seems to be a problem in the CFC. I tried calling it from a cfm page and got an error, which said Error Executing Database Query.][java.sql.SQLException : Table 'test.tbl_smartPanel_propInfo' doesn't exist] My test cfm has only this: cfobject webservice=http://flex.homesmartagent.com/wsdl/hs2f.cfc?wsdlhttp://flex.homesmartagent.com/wsdl/hs2f.cfc?wsdl; name=srv/ cfset test = srv.qpAdminFiles(hi there) cfdump var=#test# At 11:18 AM 12/29/2005, you wrote: Ok I will post this again, I have a simple test flex app that I am using (code below). That connects to a cfc, that accpets the incoming argument mySearch. The cfc compares the argument passed agaist the database and then returns a value. However, everytime I run this code and input a value in the input box and hit submit, it comes back saying Http Request Error. I have the crossdomain in my webroot (/var/www/html/) and I also have it in my site root (/var/www/html/hs2f) and I also have it in my cfc root (/var/www/html/hs2f/wsdl). I have tried having it only in my root, root + site root and so on. Here is my code. Flex: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.macromedia.com/2005/mxmlhttp://www.macromedia.com/2005/mxml; xmlns=* mx:WebService id=srv wsdl=http://flex.homesmartagent.com/wsdl/hs2f.cfc?wsdlhttp://flex.ho mesmartagent.com/wsdl/hs2f.cfc?wsdl showBusyCursor=true / mx:Script ![CDATA[ function qpAdminFiles(mySearch){ srv.qpAdminFiles(mySearch);} ]] /mx:Script mx:states mx:State name=results mx:PropertyOverride target={panel1} property=width value=100%/ mx:PropertyOverride target={panel1} property=height value=100%/ mx:AddChild target={canvas1} position=lastChild mx:DataGrid x=1 width=100% dataProvider={srv.qpAdminFiles.result} height=50% y=85 mx:columns mx:DataGridColumn headerText=File Number: columnName=FLD_FILENUM/ mx:DataGridColumn headerText=Archived: columnName=col2/ mx:DataGridColumn headerText=Last Update: columnName=col3/ /mx:columns /mx:DataGrid /mx:AddChild mx:PropertyOverride target={panel1} property=title value=File Search/ /mx:State /mx:states mx:Panel height=101 width=514 id=panel1 title=File Search resizeEffect=Resize mx:Canvas height=100% width=100% id=canvas1 mx:Label x=7 y=22 text=File Number: height=20 id=label1/ mx:TextInput x=85 y=20
Re: [flexcoders] How do I generate useful CFC Errors?
Most of my functions in the CFC return's an object (Struct) that has both the 'code' and 'message' apart from the other details you need. Here's an example cfcomponent .. cffunction name=getQuery hint= returntype=struct access=remote cfargument type=struct name=stData required=yes cfset var retStruct = StructNew() cfset retStruct['code']= 0 cfset retStruct['message'] = Message from Function getQuery: cftry cfquery name=qry_getqry datasource=#dsn# your query /cfquery cfset retStruct['dpCustomQuery'] = queryToArray(qry_getqry) cfset retStruct['code'] = 100 cfset retStruct['messaage'] = 'Custom query data retrieved successfully' cfcatch type=any cfset retStruct['message'] = Error Details : retStruct['message'] cfcatch.Message cfcatch.Detail /cfcatch /cftry cfreturn retStruct /cffunction /cfcomponent In your Flex code , you will always get 'code' and 'message' in your 'result' object and you can process your code based upon the 'code' you receive. Hope this helps. Mohanraj --- Greg Johnson [EMAIL PROTECTED] wrote: Right now, when something goes caput in a cfc I get back a realitivly meaningless set of information in Flex vs and CFML doc calling the same CFC and getting an error. __ Yahoo! DSL Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com Yahoo! Groups Sponsor ~-- Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life. http://us.click.yahoo.com/KIlPFB/vlQLAA/TtwFAA/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] DataGrid with colspans
Hi, I am trying to create a DataGrid with the following structure Colspaned Grid | Col B | Col A | Col B1 | Col B2 | Col B3 | Clicking on the bottom columns (Col A, Col B1 etc.) should sort the data as well. Its pretty simple to create such grid with mx:Grid tag, but I need all other functionality provided by a DataGrid. This I believe would need both Header CellRenderer and Column CellRenderer. I am trying to do this at my end but I am spending too much time to create one without success. Can you share your thoughts on how to create such grid? Thanks, Mohan __ Yahoo! DSL Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com Yahoo! Groups Sponsor ~-- AIDS in India: A lurking bomb. Click and help stop AIDS now. http://us.click.yahoo.com/9QUssC/lzNLAA/TtwFAA/nhFolB/TM ~- -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
RE: [flexcoders] Cell Renderers: How to put 2 images in datagrid cell
Thanks Philippe. That works. --- Philippe Maegerman [EMAIL PROTECTED] wrote: you are putting both images on level 1, that could be a reason why they overwrite each other :) should be image1, 1 / image2, 2 Philippe From: flexcoders@yahoogroups.com on behalf of Mohanraj Jayaraman Sent: Fri 9/12/2005 2:57 To: flexcoders@yahoogroups.com Subject: [flexcoders] Cell Renderers: How to put 2 images in datagrid cell Hi All, In my datagrid column I want to display 2 images in a datagrid cell and sometimes only one. I have an image Renderer which works fine if I am using only one image. But when I have my second image 'image2' the first image is not getting displayed at all. I beleive the second image is overwriting the first one. function createChildren(Void) : Void{ image = createClassObject( Image, image, 1, {owner:this}); image2 = createClassObject( Image, image2, 1, {owner:this}); } I want to attach 'click' events to these buttons as well. Can someone explain me what I doing wrong here and gimme tips to code this renderer? Would be great if you can provide sample code for the same. Thanks in advance Mohan __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development http://groups.yahoo.com/gads?t=msk=Web+site+design+developmentw1=Web+site+design+developmentw2=Computer+software+developmentw3=Software+design+and+developmentw4=Macromedia+flexw5=Software+development+best+practicec=5s=166.sig=L-4QTvxB_quFDtMyhrQaHQ Computer software development http://groups.yahoo.com/gads?t=msk=Computer+software+developmentw1=Web+site+design+developmentw2=Computer+software+developmentw3=Software+design+and+developmentw4=Macromedia+flexw5=Software+development+best+practicec=5s=166.sig=lvQjSRfQDfWudJSe1lLjHw Software design and development http://groups.yahoo.com/gads?t=msk=Software+design+and+developmentw1=Web+site+design+developmentw2=Computer+software+developmentw3=Software+design+and+developmentw4=Macromedia+flexw5=Software+development+best+practicec=5s=166.sig=1pMBCdo3DsJbuU9AEmO1oQ Macromedia flex http://groups.yahoo.com/gads?t=msk=Macromedia+flexw1=Web+site+design+developmentw2=Computer+software+developmentw3=Software+design+and+developmentw4=Macromedia+flexw5=Software+development+best+practicec=5s=166.sig=OO6nPIrz7_EpZI36cYzBjw Software development best practice http://groups.yahoo.com/gads?t=msk=Software+development+best+practicew1=Web+site+design+developmentw2=Computer+software+developmentw3=Software+design+and+developmentw4=Macromedia+flexw5=Software+development+best+practicec=5s=166.sig=f89quyyulIDsnABLD6IXIw 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! Terms of Service http://docs.yahoo.com/info/terms/ . -- **STATEMENT OF CONFIDENTIALITY** This e-mail and any attached files are confidential and intended solely for the use of the individual to whom it is addressed. If you have received this email in error please send it back to the person that sent it to you. Any views or opinions presented are solely those of author and do not necessarily represent those the Emakina Company. Unauthorized publication, use, dissemination, forwarding, printing or copying of this email and its associated attachments is strictly prohibited. We also inform you that we have checked that this message does not contain any virus but we decline any responsability in case of any damage caused by an a non detected virus. -- __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com Yahoo! Groups Sponsor ~-- Fair play? Video games influencing politics. Click and talk back! http://us.click.yahoo.com/u8TY5A/tzNLAA/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
[flexcoders] Cell Renderers: TreeGrid Renderer issue
Hi All, I am using a Tree Grid sample provided by James at http://www.cayambe.com/plog/index.php?op=ViewArticlearticleId=6blogId=1 It works fine as it is. But in my grid I had 2 more columns and these columns have a simple ImageRenderer attached to it. mx:DataGrid id=mxmlTree dataProvider={dpGrid} verticalAlign=middle width=700 height=500 variableRowHeight=true rowHeight=50 sortableColumns=false borderThickness=1 borderColor=0x00 selectable=true hGridLines=true hGridLineColor=0xD2D2D2 headerHeight=40 headerStyle=headerText mx:columns mx:Array mx:DataGridColumn columnName=fa headerText=Area width=300 cellRenderer=TreeGridCellRenderer/ mx:DataGridColumn columnName=stage1 headerText=Stage width=100 cellRenderer=ImageRenderer/ mx:DataGridColumn columnName=stage2 headerText=Stage2 width=100 cellRenderer=ImageRenderer/ /mx:Array /mx:columns /mx:DataGrid When I open the TreeRow in the grid, Child rows are displayed and the images in Stage1 and Stage2 of the child rows are displayed correctly. But when I close the TreeRow the child rows get closed but the images in the child rows still appear in the grid. Can someone explain what I need to do in Renderers to make those images disappaer? Thanks in advance Mohan __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com Yahoo! Groups Sponsor ~-- 1.2 million kids a year are victims of human trafficking. Stop slavery. http://us.click.yahoo.com/.QUssC/izNLAA/TtwFAA/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] Dispathching and Event from Combo Box cell renderer
Hi , I have a main.mxml where I have this DataGrid function initListener(){ addEventListener(statusChanged, mx.utils.Delegate.create(this, onStatusChange)); } function onStatusChange(e){ mx.controls.Alert.show(listener is Listening); } mx:DataGrid id=datagrid1 rowHeight=100 dataProvider={tp} editable=true mx:columns mx:Array mx:DataGridColumn headerText=Name columnName=name editable=false/ mx:DataGridColumn headerText=City columnName=city editable=false / mx:DataGridColumn headerText=Birthday columnName=day / mx:DataGridColumn headerText=Status columnName=status editable=true cellRenderer=ComboCellRenderer / /mx:Array /mx:columns /mx:DataGrid Whenever the combox box value is changed I want to call a remote object with the datagrid's selectedItem object. I am handling the 'change' event in the ComboCellRenderer and dispatching a 'statusChanged' event and I also have a listener attached to main.mxml for the 'statusChanged' event. But whenever the combo box value is changed the listener function onStatusChange in main.mxml is not called. Can you tell me what I am missing here? Thanks Mohan __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
RE: [flexcoders] Dispathching and Event from Combo Box cell renderer
Hi Matt, Thanks , that worked. Mohanraj --- Matt Chotin [EMAIL PROTECTED] wrote: It's the ComboCellRenderer dispatching the statusChanged event? In that case the addEventListener is on the wrong thing because it's not main dispatching the event. I think if the ComboCellRenderer does listOwner.parentDocument.dispatchEvent({type: 'statusChanged'}) then it will execute on main.mxml. Matt From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mohanraj Jayaraman Sent: Tuesday, May 24, 2005 4:53 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Dispathching and Event from Combo Box cell renderer Hi , I have a main.mxml where I have this DataGrid function initListener(){ addEventListener(statusChanged, mx.utils.Delegate.create(this, onStatusChange)); } function onStatusChange(e){ mx.controls.Alert.show(listener is Listening); } mx:DataGrid id=datagrid1 rowHeight=100 dataProvider={tp} editable=true mx:columns mx:Array mx:DataGridColumn headerText=Name columnName=name editable=false/ mx:DataGridColumn headerText=City columnName=city editable=false / mx:DataGridColumn headerText=Birthday columnName=day / mx:DataGridColumn headerText=Status columnName=status editable=true cellRenderer=ComboCellRenderer / /mx:Array /mx:columns /mx:DataGrid Whenever the combox box value is changed I want to call a remote object with the datagrid's selectedItem object. I am handling the 'change' event in the ComboCellRenderer and dispatching a 'statusChanged' event and I also have a listener attached to main.mxml for the 'statusChanged' event. But whenever the combo box value is changed the listener function onStatusChange in main.mxml is not called. Can you tell me what I am missing here? Thanks Mohan __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.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] mailto:[EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service http://docs.yahoo.com/info/terms/ . __ Yahoo! Mail Stay connected, organized, and protected. Take the tour: http://tour.mail.yahoo.com/mailtour.html 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] Repeater with Checkboxes
Hi All, I have a repeater with checkboxes. I want the checkboxes to be checked/unchecked based on the data I receive from a RemoteObject. What I receive from the remote object is a string with list of State ID's like '100,400'. Now based on this list I want check/uncheck the corresponding check boxes programmatically. Here's a sample code/model. Can someone explain me how this could be done? mx:Model id=mdl_state node node ID=100 LABEL=CA node ID=200 LABEL=NY node ID=300 LABEL=NJ node ID=400 LABEL=KY . . . /node /mx:Model mx:Repeater id=rep_state dataProvider={mdl_state} mx:CheckBox label={rep_state.currentItem.LABEL} click=fnSiteSelected(event.target); / /mx:Repeater Thanks, Mohanraj __ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
RE: [flexcoders] Exchanging data between MXML Components
This works. Thanks a ton for the example Abdul. Mohanraj --- Abdul Qabiz [EMAIL PROTECTED] wrote: Hi Mohanraj, It's very much possible, I have modified the previous example to dispatch eventsIt would give you some idea, how you can achieve the same. I am using Metadata tag for mxml components, you can find more about in docs. ##main.mxml### mx:Application xmlns:mx=http://www.macromedia.com/2003/mxml; xmlns=* mx:Script ![CDATA[ var dp:Array = [ {label:Abdul,data:1}, {label:Manish,data:2}, {label:Sam, data:3} ]; function startListening() { //you can also subscribe to change event of comp1 on this way... cmp1.addEventListener(change, mx.utils.Delegate.create(this, onCMP1Change)); } function onCMP1Change(event) { cmp2.textValue = event.target.selectedItem.label; } ]] /mx:Script !-- you can assign event handlers to change attribute also. Following lin is commented now../-- !-- comp id=cmp1 dataProvider={dp} chnage=onCMP1Change(event);/ /-- comp1 id=cmp1 dataProvider={dp}/ comp2 id=cmp2 creationComplete=startListening(); / /mx:Application ##comp1.mxml### mx:VBox xmlns:mx=http://www.macromedia.com/2003/mxml; mx:Metadata !-- this tells the compiler to embed relevant code, so that you can broadcast 'change' event /-- [Event(change)] /mx:Metadata mx:Script ![CDATA[ public var dataProvider:Array; public var selectedItem:Object; //call this function from change handler of combobox and this function dispatches the change event.. function onSelectionChange(event) { selectedItem = event.target.selectedItem; dispatchEvent({type:'change'}); } ]] /mx:Script mx:ComboBox id=_cb dataProvider={dataProvider} change=onSelectionChange(event);/ /mx:VBox ##comp2.mxml### mx:VBox xmlns:mx=http://www.macromedia.com/2003/mxml; mx:Script ![CDATA[ var textValue:String; ]] /mx:Script mx:TextInput id=_ti text={textValue}/ /mx:VBox About Metadata tag: http://livedocs.macromedia.com/flex/15/flex_docs_en/0459.htm Hope that helps... -abdul -Original Message- From: Mohanraj Jayaraman [mailto:[EMAIL PROTECTED] Sent: Saturday, April 09, 2005 4:13 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Exchanging data between MXML Components Hi Abdul and Tracy, Thanks for the example.It works, but I was expecting an event driven model instead of binding to exchange data between components. Can the same be explained with broadcast/listener model? Thanks, Mohanraj --- Abdul Qabiz [EMAIL PROTECTED] wrote: Hi, You can achieve this by using Data Binding in Flex. Did you look at binding? You can bind two controls like this.. mx:Application .. mx:ComboBox id=_cb dataProvider=[{label:'India', data:1}, {label:'USA', data:2}]/ mx:TextInput id=_ta text={_cb.selectedItem.label}/ /mx:Application In above code, when combo box selection changes, TextArea would be populated with selected item's label. Please look at Binding and Storing Data in Flex section Flex docs.. http://livedocs.macromedia.com/flex/15/flex_docs_en/wwhelp/wwhimpl/js/html/w whelp.htm?href=0687.htm Another quick-dirty example might give you an some idea: ##comp1.mxml### mx:VBox xmlns:mx=http://www.macromedia.com/2003/mxml; mx:Script ![CDATA[ var dataProvider:Array; var selectedItem:Object; ]] /mx:Script mx:ComboBox id=_cb dataProvider={dataProvider} change=selectedItem = event.target.selectedItem;/ /mx:VBox === message truncated === __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.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
[flexcoders] Exchanging data between MXML Components
Hi , I have two MXML components 'comp1' and 'comp2' in my main application file 'main' mx:application ... comp1 id=cmp1 / comp2 id=cmp2 / /mx:application 'Comp1' populates a combo box 'cmb' with the result from RemoteObject call. Upon selecting an Item from combo box 'cmb', I should popualte a text box 'tbox' in 'Comp2' Basically 'Comp2' is dependant on comp1. Can someone explain me with a simple example on how 'Comp2' text box can receive the combo box data everytime the combo box selection has changed? Thanks, Mohanraj __ Do you Yahoo!? Yahoo! Personals - Better first dates. More second dates. http://personals.yahoo.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
RE: [flexcoders] Exchanging data between MXML Components
Hi Abdul and Tracy, Thanks for the example.It works, but I was expecting an event driven model instead of binding to exchange data between components. Can the same be explained with broadcast/listener model? Thanks, Mohanraj --- Abdul Qabiz [EMAIL PROTECTED] wrote: Hi, You can achieve this by using Data Binding in Flex. Did you look at binding? You can bind two controls like this.. mx:Application .. mx:ComboBox id=_cb dataProvider=[{label:'India', data:1}, {label:'USA', data:2}]/ mx:TextInput id=_ta text={_cb.selectedItem.label}/ /mx:Application In above code, when combo box selection changes, TextArea would be populated with selected item's label. Please look at Binding and Storing Data in Flex section Flex docs.. http://livedocs.macromedia.com/flex/15/flex_docs_en/wwhelp/wwhimpl/js/html/w whelp.htm?href=0687.htm Another quick-dirty example might give you an some idea: ##comp1.mxml### mx:VBox xmlns:mx=http://www.macromedia.com/2003/mxml; mx:Script ![CDATA[ var dataProvider:Array; var selectedItem:Object; ]] /mx:Script mx:ComboBox id=_cb dataProvider={dataProvider} change=selectedItem = event.target.selectedItem;/ /mx:VBox ##comp2.mxml### mx:VBox xmlns:mx=http://www.macromedia.com/2003/mxml; mx:Script ![CDATA[ var textValue:String; ]] /mx:Script mx:TextInput id=_ti text={textValue}/ /mx:VBox ##main.mxml## mx:Application xmlns:mx=http://www.macromedia.com/2003/mxml; xmlns=* mx:Script ![CDATA[ var dp:Array = [ {label:Manish,data:2}, {label:Sam, data:3}, {label:Abdul,data:1} ]; ]] /mx:Script comp1 id=cmp1 dataProvider={dp}/ comp2 id=cmp2 textValue={cmp1.selectedItem.label}/ /mx:Application -abdul -Original Message- From: Mohanraj Jayaraman [mailto:[EMAIL PROTECTED] Sent: Saturday, April 09, 2005 12:45 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Exchanging data between MXML Components Hi , I have two MXML components 'comp1' and 'comp2' in my main application file 'main' mx:application ... comp1 id=cmp1 / comp2 id=cmp2 / /mx:application 'Comp1' populates a combo box 'cmb' with the result from RemoteObject call. Upon selecting an Item from combo box 'cmb', I should popualte a text box 'tbox' in 'Comp2' Basically 'Comp2' is dependant on comp1. Can someone explain me with a simple example on how 'Comp2' text box can receive the combo box data everytime the combo box selection has changed? Thanks, Mohanraj __ Do you Yahoo!? Yahoo! Personals - Better first dates. More second dates. http://personals.yahoo.com Yahoo! Groups Links __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
RE: [flexcoders] How to pass AS Objects to a CFC
I was about to post a question on 'Using Value Objects with CFC' and your example explains it all. Thanks again. Mohanraj --- Mehdi, Agha [EMAIL PROTECTED] wrote: You can also implement mapping like this = 1.AS VO -- Class TestVO { public var test1 : String; public var test2 : Array; function TestVO () { Object.registerClass ( testVO, TestVO ); } } testVO = new TestVO(); remoteObject.passToCF ( testVO ); = 2.CF -- cffunction name=getASObject returntype=any access=remote cfargument name=testVO type=struct required=yes cfset var _asVO = arguments.testVO.getType() cfset var _cfVO = CreateObject( component, _asVO ) cfset _cfVO[test1] = arguments.testVO[test1] cfset _cfVO[test2] = arguments.testVO[test2] /cffunction cffunction name=passASObject returntype=struct access=remote cfargument name=cfVO type=TestVO required=yes cfset var _asVO = CreateObject( java, flashgateway.io.ASObject ).init() cfset _asVO.setType( testVO ) cfset _asVO[test1] = arguments.cfVO[test1] cfset _asVO[test2] = arguments.cfVO[test2] cfreturn _asVO /cffunction === 3.AS receiving the VO from CF -- public / private var testVO : TestVO; testVO = event.result; == That should get you going. You might wanna make this mapping a process, which your service layer invokes before getting Vos into and out of your backend. You can make it so that you define variables of your CF VO as properties and loop over the properties to auto populate the AS VO going out and the same when you read the AS VO. You might also wanna look into Tartan, which has this mapping built into it and offers seemless integration. Let me know if you have any questions. Thanks -Original Message- From: Tom Link [mailto:[EMAIL PROTECTED] Sent: Monday, March 28, 2005 9:59 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] How to pass AS Objects to a CFC I believe the solution Dirk provided solves this problem as well. That is, in addition to Mehdi's initial solution #2: remoteObject.cfFunction ( toPass, true ); You can use named argument syntax: remoteObject.cfFunction({arg1:toPass}); Where arg1 is also the name of the argument in the CFC method cfFunction. Mohanraj, this is the solution I posted in my blog: http://tomlink.net/blog/index.cfm?mode=entryentry=BBFE84D5-7E97-A3B0-EE0B2D C292F5272F, where you also posed this question. Please correct me if I am missing something. -tom -Original Message- From: Mohanraj Jayaraman [mailto:[EMAIL PROTECTED] Sent: Friday, March 25, 2005 5:44 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] How to pass AS Objects to a CFC Thanks for the explantion Peter. That really helps. Mehdi thanks for yet another Tip. It works in FLEX. Mohanraj --- Mehdi, Agha [EMAIL PROTECTED] wrote: Thanks Peter for the explanation. That explains it. I am glad it worked Mohanraj. There's one more way of doing it without having to specify the other argument. var testObject = new Array(); // it has to be an array. It won't work if you did new Object() testObject[var1] = var1; testObject[var2] = var2 remoteObject.cfFunction ( testObject ); cffunction name=cfFunction access=remote cfargument name=testObject type=struct /cffunction It works in Flash. Haven't tried it on Flex but shouldn't have any problems. It is simple if all you want to pass is an object with some properties instead of sending over a class. -Original Message- From: Peter Farland [mailto:[EMAIL PROTECTED] Sent: Friday, March 25, 2005 11:25 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] How to pass AS Objects to a CFC The history of this problem stems way back from Flash Remoting in ColdFusion 6.0. ActionScript 1.0 APIs for Flash Remoting introduced named arguments for CF-based invocation. The syntax for passing named arguments was usually listed like this in documentation: myCFService.cfFunction({var1:foo,var2:bar}); Which was intended to match a CFC API: cffunction name=cfFunction access=remote cfargument name=var1 cfargument name=var2 /cffunction The {} syntax, however, really just means an untyped Object, so this invocation information is lost once it is serialized over AMF. But AMF isn't the real issue - the Flash Remoting gateway can't adapt accordinly as it can't get
Re: [flexcoders] How to pass AS Objects to a CFC
Thanks Paul. This seems to be a complex project and I am having a hard time following it. I wish they had a simple example. But I am still experimenting with ValueObject.cfc and hope I can get this done pretty soon. --- Paul Kenney [EMAIL PROTECTED] wrote: At work we figured out how to do this a little while back for the Tartan Framework (http://www.tartanframework.org). If you download the code, take a look at the file /tartan/vo/ValueObject.cfc, and in particular the getFlashRemotingData() and setFlashRemotingData() methods. On Thu, 24 Mar 2005 10:37:27 -0800 (PST), Mohanraj Jayaraman [EMAIL PROTECTED] wrote: Hi Dirk, Thanks for your suggestion. But my condition differs from your example. Lets assume I had an AS Class 'MyClass.as' I am trying to do something like this in my MXML var o:Object = new MyClass(); I build an 'array of structures' in MyClass Object and I do pass the complex Object as input with another Object wrapper. Here's an example by Macromedia on how exchange complex data http://www.macromedia.com/devnet/flex/articles/complex_data_03.html According to macromedia When invoking methods remotely, you can pass objects back and forth (as the methods' input parameters and return value) between the client and the server. This example is explained with Java and I am trying to replicate the same with Coldfusion CFC's. Thanks, Mohanraj --- Dirk Eismann [EMAIL PROTECTED] wrote: Hi Mohanraj, CF needs named parameters when dealing with complex types passed as CFC arguments. You have to wrap the object you want to send to the CFC into another wrapper object. Inside the wrapper you define properties for every named argument. This should work: // AS snippet // setup the object to be passed to the CFC var o:Object = new Object(); o.name = Foo; o.date = new Date(); o.otherData = [1,2,3,4,5]; // create a wrapper for the object // input is the named argument of the CFC var request = new Object(); request.input = o; // send it ro.sendComplexData(request); The wrapper's input property is also used to identify the argument inside the CFC: !--- CFC snippet --- cffunction name=sendComplexData access=remote returntype=string cfargument name=input type=struct required=yes cfreturn obj.name /cffunction Dirk. -Original Message- From: Mohanraj Jayaraman [mailto:[EMAIL PROTECTED] Sent: Thursday, March 24, 2005 3:12 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] How to pass AS Objects to a CFC Hi Clint, Thanks for your reply. I think i was not clear ealrier on my problem. Here's a sample code I am dealing with. Please note the property 'modarray' of the 'pData' object. 'modarray' is populated with SelTP object _s whcih is an Array of Structures. Here I polupate the _s with selectedIndices of a data gris I am using. The required parameter 'MODARRAY' not passed to the function! is the message I get following my RemoteObject call Any idea what I am missing here. __ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ Yahoo! Groups Sponsor ADVERTISEMENT 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 the Yahoo! Terms of Service. -- Paul Kenney [EMAIL PROTECTED] [EMAIL PROTECTED] http://www.pjk.us __ Do you Yahoo!? Make Yahoo! your home page http://www.yahoo.com/r/hs Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
RE: [flexcoders] How to pass AS Objects to a CFC
Thanks for the explantion Peter. That really helps. Mehdi thanks for yet another Tip. It works in FLEX. Mohanraj --- Mehdi, Agha [EMAIL PROTECTED] wrote: Thanks Peter for the explanation. That explains it. I am glad it worked Mohanraj. There's one more way of doing it without having to specify the other argument. var testObject = new Array(); // it has to be an array. It won't work if you did new Object() testObject[var1] = var1; testObject[var2] = var2 remoteObject.cfFunction ( testObject ); cffunction name=cfFunction access=remote cfargument name=testObject type=struct /cffunction It works in Flash. Haven't tried it on Flex but shouldn't have any problems. It is simple if all you want to pass is an object with some properties instead of sending over a class. -Original Message- From: Peter Farland [mailto:[EMAIL PROTECTED] Sent: Friday, March 25, 2005 11:25 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] How to pass AS Objects to a CFC The history of this problem stems way back from Flash Remoting in ColdFusion 6.0. ActionScript 1.0 APIs for Flash Remoting introduced named arguments for CF-based invocation. The syntax for passing named arguments was usually listed like this in documentation: myCFService.cfFunction({var1:foo,var2:bar}); Which was intended to match a CFC API: cffunction name=cfFunction access=remote cfargument name=var1 cfargument name=var2 /cffunction The {} syntax, however, really just means an untyped Object, so this invocation information is lost once it is serialized over AMF. But AMF isn't the real issue - the Flash Remoting gateway can't adapt accordinly as it can't get the necessary CFC API or argument type information from the CFC function before invoking it (a limitation in CF), so now it has a problem - how would it know that you're passing a single struct or named arguments? To disambiguate you use either of the two approaches that Mehdi described. -Original Message- From: Mohanraj Jayaraman [mailto:[EMAIL PROTECTED] Sent: Friday, March 25, 2005 2:12 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] How to pass AS Objects to a CFC WOW! It works Mehdi. As you pointed out the second variable passed in the CFC function call did the magic! If possible, an explanation on why it works with the second variable will be more useful Mehdi. My guess is that one should have good knowledge of Flash/ActionScript before venturing into doing any complex stuff with FLEX. Thanks a lot sharing this. Mohanraj --- Mehdi, Agha [EMAIL PROTECTED] wrote: Mohanraj, I learned it the hard way. There are two ways to do it. 1. Flex side: var toPass = new MyClass(); toPass.var1 = value; toPass.var2 = value; remoteObject.cfFunction ( toPass ); CF Side: cffunction name=cfFunction access=remote cfargument name=var1 cfargument name=var2 /cffunction I'm sure it's not acceptable. 2. Flex Side: var toPass = new MyClass(); toPass.var1 = value; toPass.var2 = value; remoteObject.cfFunction ( toPass, true ); CF Side: cffunction name=cfFunction access=remote cfargument name=toPass /cffunction That works beautifully. The second arg from Flex doesn't have to be a boolean but it just easy to type. Please let me know if that works. -Original Message- From: Mohanraj Jayaraman [mailto:[EMAIL PROTECTED] Sent: Thursday, March 24, 2005 10:37 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] How to pass AS Objects to a CFC Hi Dirk, Thanks for your suggestion. But my condition differs from your example. Lets assume I had an AS Class 'MyClass.as' I am trying to do something like this in my MXML var o:Object = new MyClass(); I build an 'array of structures' in MyClass Object and I do pass the complex Object as input with another Object wrapper. Here's an example by Macromedia on how exchange complex data http://www.macromedia.com/devnet/flex/articles/complex_data_03.html According to macromedia When invoking methods remotely, you can pass objects back and forth (as the methods' input parameters and return value) between the client and the server. This example is explained with Java and I am trying to replicate the same with Coldfusion CFC's. Thanks, Mohanraj === message truncated === __ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ 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
RE: [flexcoders] How to pass AS Objects to a CFC
Hi Dirk, Thanks for your suggestion. But my condition differs from your example. Lets assume I had an AS Class 'MyClass.as' I am trying to do something like this in my MXML var o:Object = new MyClass(); I build an 'array of structures' in MyClass Object and I do pass the complex Object as input with another Object wrapper. Here's an example by Macromedia on how exchange complex data http://www.macromedia.com/devnet/flex/articles/complex_data_03.html According to macromedia When invoking methods remotely, you can pass objects back and forth (as the methods' input parameters and return value) between the client and the server. This example is explained with Java and I am trying to replicate the same with Coldfusion CFC's. Thanks, Mohanraj --- Dirk Eismann [EMAIL PROTECTED] wrote: Hi Mohanraj, CF needs named parameters when dealing with complex types passed as CFC arguments. You have to wrap the object you want to send to the CFC into another wrapper object. Inside the wrapper you define properties for every named argument. This should work: // AS snippet // setup the object to be passed to the CFC var o:Object = new Object(); o.name = Foo; o.date = new Date(); o.otherData = [1,2,3,4,5]; // create a wrapper for the object // input is the named argument of the CFC var request = new Object(); request.input = o; // send it ro.sendComplexData(request); The wrapper's input property is also used to identify the argument inside the CFC: !--- CFC snippet --- cffunction name=sendComplexData access=remote returntype=string cfargument name=input type=struct required=yes cfreturn obj.name /cffunction Dirk. -Original Message- From: Mohanraj Jayaraman [mailto:[EMAIL PROTECTED] Sent: Thursday, March 24, 2005 3:12 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] How to pass AS Objects to a CFC Hi Clint, Thanks for your reply. I think i was not clear ealrier on my problem. Here's a sample code I am dealing with. Please note the property 'modarray' of the 'pData' object. 'modarray' is populated with SelTP object _s whcih is an Array of Structures. Here I polupate the _s with selectedIndices of a data gris I am using. The required parameter 'MODARRAY' not passed to the function! is the message I get following my RemoteObject call Any idea what I am missing here. __ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ 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] How to pass AS Objects to a CFC
Hi All, I've been trying to pass an AS Object to a Coldfusion CFC thorough FLEX RemoteObject calls. But I havent found any success so far. I knew there are examples provided my Macromedia for exchanging complex objects (http://www.macromedia.com/devnet/flex/articles/complex_data_03.html) , but they are explained with Java which I am not able to reproduce the same with Coldfusion CFC's. Have anybody tried this before? If so,can you explain it with a simple example? Thanks, Mohanraj __ Do you Yahoo!? Make Yahoo! your home page http://www.yahoo.com/r/hs Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [flexcoders] How to pass AS Objects to a CFC
Hi Clint, Thanks for your reply. I think i was not clear ealrier on my problem. Here's a sample code I am dealing with. Please note the property 'modarray' of the 'pData' object. 'modarray' is populated with SelTP object _s whcih is an Array of Structures. Here I polupate the _s with selectedIndices of a data gris I am using. The required parameter 'MODARRAY' not passed to the function! is the message I get following my RemoteObject call Any idea what I am missing here. SelTP.as -- class SelTP { var tp : Array; function SelTP() { tp=new Array(); } function addItem(item : Object,index: Number) : Void { index=index==null?0:index; tp.addItemAt(index, {ID: item.TPID, DE: item.DES}); } function getItemCount() : Number { return tp.length; } } == MXML --- mx:Script ![CDATA[ import SelTP; var _s:Object; var myModel: Object; var updRes:String; function fn_buildObj():Void { _s = new SelTP(); for(var v:Number=0;vgrd_tp.selectedIndices.length;v++){ _s.addItem(myModel[grd_tp.selectedIndices[v]],_s.getItemCount()); } return _s; } function fn_repData():Void{ var pData:Object = new Object(); pData.modarray = fn_buildObj(); rob_gD.fn_updData(pData); } ]] /mx:Script mx:RemoteObject id=rob_gD endpoint=http://127.0.0.1:8500/flashservices/gateway; source=MetricportalNew.reus.components.GetNm showBusyCursor=true mx:method name=fn_getEmpDets result=myModel=event.result / mx:method name=fn_updData result=updRes=event.result / /mx:RemoteObject = CFC -- cffunction name=fn_updData returntype=string access=remote cfargument name=modarray Type=any required=true cfset var v = Bad data cfif IsArray(modarray) cfset v = Array cfelseif IsObject(modarray) cfset v = Object cfelseif IsStruct(modarray) cfset v = Struct /cfif cfreturn v /cffunction --- Clint Tredway [EMAIL PROTECTED] wrote: function sendToCF(){ var send = new Object(); send.param1 = hello; send.param2 = world; your_svc.sayHello(send); } this will show up in the Flash scope inside CF as #flash.param1# and #flash.param2#.. This is a simple example but it should help you... if not I would be happy to try and help you figure out what you need... HTH, Clint On Wed, 23 Mar 2005 17:41:11 -0800 (PST), Mohanraj Jayaraman [EMAIL PROTECTED] wrote: Hi All, I've been trying to pass an AS Object to a Coldfusion CFC thorough FLEX RemoteObject calls. But I havent found any success so far. I knew there are examples provided my Macromedia for exchanging complex objects (http://www.macromedia.com/devnet/flex/articles/complex_data_03.html) , but they are explained with Java which I am not able to reproduce the same with Coldfusion CFC's. Have anybody tried this before? If so,can you explain it with a simple example? Thanks, Mohanraj __ Do you Yahoo!? Make Yahoo! your home page http://www.yahoo.com/r/hs Yahoo! Groups Links -- My Blog http://www.clinttredway.com Are you diabetic? http://www.diabetesforums.com __ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ 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/