Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cfargument Question

Status
Not open for further replies.

RosieGp

Programmer
Jun 23, 2009
83
US
I have a combobox and textinput where the user makes a selection from the combobox and then put text in textinput box to retrieve information... Now in cfc
I have the following:
Code:
<cfcomponent  output="false">
<cffunction name="getData" access="remote" returnType="query" output="false">
<cfarument name="TextUserInput" required="true"/>
<cfset var DataQRY ="">
<cfquery datasource="SQL" username="***" password="***" name="SQLQuery">
       select EmpID, EmpName
       from   Employee
[COLOR=red]       where  TextUserInput IN (#ListQualify('#TextUserInput#')#) [/color red]
</cfquery> 
<cfquery datasource="oracle" username="***" password="***" name="OracleQuery">
       select emp_NUM, emp_DATE
       from   emp_INFO  
[COLOR=red]       where  TextUserInput IN (#ListQualify('#TextUserInput#')#)[/color red] 
</cfquery>
<cfquery dbtype="query" name="DataQRY">
       select SQLQuery.EmpID, SQLQuery.EmpName, OracleQuery.emp_DATE
       from SQLQuery, OracleQuery 
       Where SQLQuery.EmpID=OracleQuery.emp_NUM
</cfquery>
        <cfreturn DataQRY>
        </cffunction>
</cfcomponent>

I don't know if this is correct way of getting the argument...
my flex end looks like the following:

Code:
<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="[URL unfurl="true"]http://www.adobe.com/2006/mxml"[/URL] layout="absolute" backgroundColor="0xFFFFFF" left="10" right="10" top="10" bottom="10" creationComplete="init()" xmlns:src="*">

      <mx:Script>

            <![CDATA[

                  import mx.controls.Alert;

                  import mx.controls.Alert;

                  import mx.collections.ArrayCollection;

                  import mx.rpc.events.ResultEvent;

                  import mx.rpc.events.FaultEvent;

                  import mx.controls.dataGridClasses.DataGridColumn;

                  import mx.utils.ObjectUtil;

                  

                  [Bindable] public var EMP:String;

                  [Bindable] public var ary:Array = ["EMP Name", "EMP ID", "Emp Detail"];

            [Bindable] public var RefDataProvider:ArrayCollection; 

            [Bindable] public var Data:ArrayCollection;                          

                  private function init():void {

                  }

                  private function selection():void{

                        var i:int;

                        var UserData:String = txt.text;

                        var DataValueCur:String;

                        

                        for(i=0;i<ary.length;i++)

                              DataValueCur=UserData;              

                  }

                  private function resultgetData(event:ResultEvent):void{

                  RefDataProvider = ArrayCollection(event.result);

                  if(RefDataProvider.toString()==''){Alert.show("No Data to Display");}

            }

            ]]>

      </mx:Script>

      

      <!--Database Server Connection -->

      <mx:RemoteObject id="cf" destination="ColdFusion" source="Emp-debug.CFC.EmpRef" showBusyCursor="true">

        <mx:method name="getData" result="resultgetData(event)" fault="Alert.show(event.fault.message)"/>

    </mx:RemoteObject>        

            <mx:DataGrid id="OrderGrid" dataProvider="{RefDataProvider}" left="10" right="10" bottom="60" top="74">

                  <mx:columns>      

                 <mx:DataGridColumn headerText="Emp NAME" dataField="EmpName"/>     

                 <mx:DataGridColumn headerText="Emp ID" dataField="EmpID"/>

                 <mx:DataGridColumn headerText="Date UPDATED" dataField="emp_DATE"/>

                </mx:columns>

            </mx:DataGrid>

      

      <mx:ComboBox id="cb" x="10" y="31" dataProvider="{ary}" prompt="Make a Selection" change="selection()" fontSize="10" fontWeight="bold" width="170" color="#3333ff"></mx:ComboBox>      

      <mx:Label x="10" y="0" text="Employee Detail" fontWeight="bold" fontSize="17" color="#CC0099"/>

      <mx:TextInput id="txt" x="188" y="32" width="170" height="24" fontSize="12" color="#3333ff" restrict="A-Z a-z 012345689"/>

      <mx:Button id="searchBtn" x="366" y="32" label="Search" fontSize="10" color="0x3333ff" click="selection()"/>

      <mx:Button id="clearBtn" label="Clear" click="txt.text =''" color="0x3333ff"  x="439" y="32" width="65"/>


</mx:Application>

Nothing is working right now. Please can you point the prolem...
Thanks in advance...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top