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

Render CFM to string

New Here ,
Feb 23, 2007 Feb 23, 2007

Copy link to clipboard

Copied

Hi,

I have the following need. I am building a webservice that needs to be deployed in some machines. I would like the client machines to have very little to do with the processing of forms. All the client does is invoke the webservice and it should return the forms and validation.

Well, I have an app working well with cfinvoke method=.... however, I would like to make this work as a webservice too.

So, I suppose I need to be able to return something to the client. However, I have come to learn that <cfinvoke .. doesn't return anything to the client (as it should). The only thing going back to the client is the returned variable.

So, I need to do all rendering a cfm into a string object that I can return back to the client.

I just don't know how this can be done.

My other solution is to copy all the html + scripts from cfms and put them in the cfc and add quotations. Well, That's not a bad idea. But that's a bit silly if I have to copy the javascript libraries and so on.

Any ideas on the matter are greatly welcomed,


Roland
TOPICS
Advanced techniques

Views

280

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 ,
Feb 23, 2007 Feb 23, 2007

Copy link to clipboard

Copied

I'm not 100% clear on what you are trying to do, but I think the
<cfsaveContent...> tag could do what you need.

<cfoutput>
<cfSaveContent variable="foobar">
<html>
<head>
<title>A Test</title>
</head>
<body>
<p>#dateFormat(now(),"dd mmmm yyyy")#</p>
</body>
</html>
</cfSaveContent>
</cfoutput>


<cfoutput>#foobar#</cfoutput>

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
New Here ,
Feb 23, 2007 Feb 23, 2007

Copy link to clipboard

Copied

LATEST
Kudos Ian,

Thanks a bunch.

Roland

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