Skip to main content
Known Participant
October 19, 2009
Question

How to specify function argument type in script-style?

  • October 19, 2009
  • 2 replies
  • 1115 views
<cffunction name="setPerson">
 
<cfargument name="person" type="com.Person"/>
</cffunction>

I tried:

function setPerson(com.Person person){}

and it does NOT work either. CF says "You cannot use a variable reference with "." operators in this context"


if this is indeed a bug, pls vote at: http://cfbugs.adobe.com/cfbugreport/flexbugui/cfbugtracker/main.html#bugId=80394

    This topic has been closed for replies.

    2 replies

    Inspiring
    October 22, 2009

    function setPerson(com.Person person){}

    Try this:

    import "com"

    function setPerson(Person person){}

    This works for me.�� It'd be good if your approach worked too, though.�� I'll vote for your issue.

    --

    Adam

    Message was edited by: Adam Cameron

    Inspiring
    October 22, 2009

    Jesus these forums suck.

    I'll try again.

    Try this:

    import "com";

    function setPerson(Person person){}

    This approach works for me, althuogh I would prefer to use your approach.  I'll vote for your issue.

    --

    Adam

    Known Participant
    October 22, 2009

    I tried that, but it doesn't work.

    If you open the cfc with CFCExplorer, it will Still expect Person in the same package of the cfc, not com.Person.

    Thanks.

    Inspiring
    October 20, 2009

    I don't know if it's a bug, but I do know that it does not coincide with what the manual says.  Are you sure the tag version of your code works?