tags:

views:

174

answers:

3

I am getting the following error while accessing the

The "MARKETPRICELISTVIEW" argument passed to the "GetMarketPriceList" function is not of type "app.market.wallst.MarketPrice.MarketPriceListView."
If the component name is specified as a type of this argument, its possible that a definition file for the component cannot be found or is not accessible.

The Function is as follows:-

    <cffunction name="GetMarketPriceList" returntype="void" access="public" output
    ="false"> 
            <cfargument name="MarketPriceListView" 
type="app.market.wallst.MarketPrice.MarketPriceListView" required="true"> 
                <cfargument name="Task" type="app.market.wallst.Task.Task"> 
                <cfargument name="LoginView" type="app.market.wallst.Login.LoginView"> 
                   <cfscript>  
                    arguments.MarketPriceListView.SetMarketPriceListQuery
                         (variables.MarketPriceDataDelegate.GetMarketPriceList
                           (arguments.MarketPriceListView.GetMarketPrice()));      
                    arguments.Task.SetError(false); 
                    arguments.LoginView; 
                   </cfscript> 
                </cffunction>

Kindly help what this error could be?

+1  A: 

The first thing that I notice is that there is a space in your type declaration for the argument.

Is the object being passed in a CFC, or another type of object? If it is derived, my experience is that CF doesn't always get the type right.

Ben Doom
I corrected the "type declaration" Typo.
vas
the object is being passed in a CFC, and is derived.Now how to make sure that it is "getting the right type."
vas
Is the argument type exactly the CFC type? Or is it a type the CFC is derived from?
Ben Doom
+1  A: 

Are you using an object factory? Please post the code the creates the MarketPriceListView component and the code that calls the GetMarketPriceList method.

Aaron Greenlee
+1  A: 

Your function: GetMarketPriceList() requires an argument named MarketPriceListView that is an instance of the CFC file located here: /app/market/wallst/MarketPrice/MarketPriceListView.cfc

Hopefully you have some prior variable set that instantiates that cfc, so that you can pass it to GetMarketPriceList();

The code that calls that function is actually more important to answer this question than the function itself.

Just guessing, but it should be something along the lines of this, (unless you're using Coldspring)

<!--- Review MarketPriceListView to see if it has a required init() method --->
<cfset mpListView = createObject("component", "app.market.wallst.MarketPrice.MarketPriceListView")>

<!--- Guessing how these are implemented, probably require init() and Task and LoginView are probably functions rather than the CFC file. --->
<cfset task = createObject("component","app.market.wallst.Task.Task")>
<cfset loginView = createObject("component","app.market.wallst.Login.LoginView")>

<cfset result = GetMarketPriceList( mpListView, task, loginView)>

Another guess at the implementation:

<cfscript>
    // init the components:
    marketPrice  = createObject("component", "app.market.wallst.MarketPrice").init();
    taskManager  = createObject("component","app.market.wallst.Task").init();
    loginManager = createObject("component","app.market.wallst.Login").init();

    // call the appropriate methods to get the data - example implementation
    mpListView  = marketPrice.MarketPriceListView( symbol=form.symbol );
    task        = taskManager.task( task=form.task );
    loginView   = loginManager.loginView( view=form.view );

    result = GetMarketPriceList( mpListView, task, loginView );
</cfscript>
Dan Sorensen