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

CFC Question

Guest
Jun 25, 2010 Jun 25, 2010

Hi,

Have a problem and I'll probably  explain this wrong, but here goes. I invoke a CFC:

<cfinvoke 
  component="cfc.price.PriceGateway"
  method="getById"
   id="1"
  returnvariable="priceResults">
</cfinvoke>

that  returns the following (from a cfdump):

Price  Results - component cfc.price.PriceBean
PROPERTIES
priceid1
descriptionService
price500.00
METHODS

How would I  grab the values of the PROPERTIES and display them on a page? For  example, just the price, or just the priceid?  I can't find an example  and I've searched without results.

Thanks.

608
Translate
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
Community Beginner ,
Jun 25, 2010 Jun 25, 2010

Try <cfoutput>#priceResults.properties.price#</cfoutput>

Translate
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
Guest
Jun 25, 2010 Jun 25, 2010

Thanks, but that errors:

Element  PROPERTIES.PRICE is undefined in PRICERESULTS.

Translate
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 ,
Jun 26, 2010 Jun 26, 2010

Make property singular instead of plural.


Translate
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
New Here ,
Jun 26, 2010 Jun 26, 2010

Same error with property. What I did was change the return to a query and used:

<cfoutput query="priceResults">#price#</cfoutput>

That solved my issues and I thank you all for your suggestions.

Translate
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 ,
Jun 29, 2010 Jun 29, 2010
LATEST

Leave out the "properties" entirely.  The data would be in priceResults.priceid, priceResults.description, and priceResults.price

A CFDump shows all the properties of the dump and any methods of the dump.  You don't use the word "properties" or "methods" to access those items -- those words are just there to describe what you're looking at.

Translate
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