2 Replies Latest reply on Feb 13, 2009 9:48 AM by buyusedtoyota

    flex & cf 6, am i missing something - code snippet

    buyusedtoyota
      So my first attempt at this, and I wondering if I'm missing something....

      Flex Builder 3 app, calling a cfm proc on a CF6 server. Code snippet below. Just a simple call to return some CGI vars as a test.

      I'm not getting my datagrid populated, not sure if it's just not communicating, or what. Thanks for any suggestiongs, or help.

      ---- mxml code ----

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" xmlns="*" layout="absolute" creationComplete="userRequest.send()">

      <mx:HTTPService id="userRequest" url=" http://xxxxxx.com/test/cgi-vars-for-flex.cfm"
      useProxy="false" method="POST">
      </mx:HTTPService>

      <mx:DataGrid id="dgUserRequest" x="10" y="10" dataProvider="{userRequest.lastResult.cgi.vars}" height="142">
      <mx:columns>
      <mx:DataGridColumn headerText="CGI Variable" dataField="name"/>
      <mx:DataGridColumn headerText="Value" dataField="value"/>
      </mx:columns>
      </mx:DataGrid>

      <mx:Form x="10" y="10" width="100">
      </mx:Form>
      <mx:Button label="Refresh" click="userRequest.send()" x="10" y="160"/>

      </mx:Application>


      ---- cgi-vars-for-flex.cfm ----

      <cfprocessingdirective pageencoding = "utf-8" suppressWhiteSpace = "Yes">
      <cfxml variable="cgiXML">
      <cgi>
      <cfoutput>
      <vars>
      <name>CGI.SCRIPT_NAME</name>
      <value>#CGI.SCRIPT_NAME#</value>
      </vars>
      <vars>
      <name>CGI.SERVER_NAME</name>
      <value>#CGI.SERVER_NAME#</value>
      </vars>
      </cfoutput>
      </cgi>
      </cfxml>
      <cfoutput>#cgiXML#</cfoutput>

      <!--- <cfdump var=#cgiXML#> --->

      </cfprocessingdirective>