• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Passing form data to CFC

Contributor ,
Sep 18, 2008 Sep 18, 2008

Copy link to clipboard

Copied

Is there a way to just pass the form structure to a CFC without breaking it down into each field?
TOPICS
Advanced techniques

Views

8.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 18, 2008 Sep 18, 2008

Copy link to clipboard

Copied

Dinghus wrote:
> Is there a way to just pass the form structure to a CFC without breaking it down into each field?

Yes...Do you want it is a single structure in the CFC or have ColdFusion
break it down into arguments automatically for you?

Former:
myCFC.aFunction(form)

OR

<cfinvoke componet="#myCFC#" anArgument="#form#" method="aFunction"/>

OR

<cfinvokde component="#myCFC# methode="aFunction"/>
<cfinvokeArgument name="anArgument" value="#form#">
</cfinvoke>

Latter:

<cfinvoke component="#myCFC# argumentCollection="#form#" method="aFunction/>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 18, 2008 Sep 18, 2008

Copy link to clipboard

Copied

Oops forgot this one to pass in the form structure as a single argument.

myCFC.aFunction(anArgument=form)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 18, 2008 Sep 18, 2008

Copy link to clipboard

Copied

Ian Skinner wrote:
> Dinghus wrote:
>> Is there a way to just pass the form structure to a CFC without
>> breaking it down into each field?
>
> Yes...Do you want it is a single structure in the CFC or have ColdFusion
> break it down into arguments automatically for you?
>
> Former:
> myCFC.aFunction(form)
>
> OR
>
> <cfinvoke componet="#myCFC#" anArgument="#form#" method="aFunction"/>
>
> OR
>
> <cfinvokde component="#myCFC# methode="aFunction"/>
> <cfinvokeArgument name="anArgument" value="#form#">
> </cfinvoke>
>
> Latter:
>
> <cfinvoke component="#myCFC# argumentCollection="#form#"
> method="aFunction/>
>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Sep 19, 2008 Sep 19, 2008

Copy link to clipboard

Copied

I already have it instantiated so I guess I have to go with the structure as a whole or reinvoke it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 19, 2008 Sep 19, 2008

Copy link to clipboard

Copied

Dinghus wrote:
> I already have it instantiated so I guess I have to go with the structure as a whole or reinvoke it.

That is a *VERY* common misinterpretation of the usage of the
<cfinvoke...> tag, that is can not be used with an already instantiated
component.

<cfinvoke component="path.to.my.compoent"...> instantiates a component.

<cfinvoke componet="#myInvokedComponentVariable#"...> works with an
already instantiated component.



Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 19, 2008 Sep 19, 2008

Copy link to clipboard

Copied

LATEST
Alternatively, one could create an object and then call the functions.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation