Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6646669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:26:41+00:00 2026-05-26T00:26:41+00:00

CFM <html> <head> <title>Test Page</title> </head> <body> <cfform> <cfinput type="text" name="input"> </cfform> <cfscript> calc

  • 0

CFM

<html>

<head>

<title>Test Page</title>

</head>

<body>

    <cfform>
        <cfinput type="text" name="input">
    </cfform>

    <cfscript>
        calc = CreateObject("component", "TestCFC");
    </cfscript>

    <cfdiv bind="cfc:TestCFC.func({input})"></cfdiv>
    <cfdiv bind="cfc:TestCFC.func2()"></cfdiv>

    
</body>
</html>

CFC

<cfcomponent>
    <cfscript>
        this.output = '';
        
        remote function func(input){
            output = input;
            return output;  
        }
        remote function func2(){
            return output & ' Hello World.';    
        }
    </cfscript>
</cfcomponent>

Input:

First Words:

Expected output

First Words:

First Words: Hello World.

Workarounds are welcome.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:26:42+00:00Added an answer on May 26, 2026 at 12:26 am

    cfdiv bindings are single requests to the CFC–state is not cached or maintained between them. Access to internal shared scopes like VARIABLES ends at the return of the request. You must build/maintain this state manually.

    Step 1: Put your CFC in the same directory as an Application.cfc that enables SessionManagement:

    <cfset this.sessionManagement = true />
    <cfset this.sessionTimeout = createTimeSpan(0,20,0,0) />
    

    Step 2: Change your CFC so that the intended variable that will persist between each individual request resides in the SESSION scope:

    <cfcomponent>
    
        <cfset session.output = '' />
    

    Step 3: Write your functions so that you read/write this stateful scope:

        remote function func(input){
            session.output = arguments.input;
            return session.output;
        }
    

    Step 4:

    Come up with a mechanism for your client to chain ‘onchange’ events across DIVs. It can be done any number of ways, but must be done by you (it’s not automatic) — The quickest starting point would be to refer to your previous question about binding dynamic events to multiple fields.

    It’s worth it to note that using a CFC to wrap a scope like SESSION should absolutely be done with care, use protections where possible (ie StructKeyExists(SESSION,'output') ), as different types of requests (web vs. service) invoke shared scopes differently (or not at all), and you also have timeouts to worry about.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

CFM <html> <head> <title>Test Page</title> <script type=text/javascript> function toggleV(value){ document.getElementById('blah').value = value; } </script>
I have made this nice little table: testPage.cfm: <html> <head> <title>Test Page</title> <style> .blue{
I have code that looks something like this: <html> <head> <script type=text/javascript src=http://code.jquery.com/jquery-latest.min.js></script> <script
I have a form "test.cfm" It passes values to an action page "testAction.cfm"! test.cfm
Rather than population said DOM object with an external page such as HTML CFM
I would like to turn the HTML generated by my CFM page into a
I have the following $.ajax({ type: POST, url: qry_invControl.cfm, data: p_sales_price= + input.val() +
I am working on the following page. http://www.ranger.ryerson.ca/library/test/steveDev/testcarousel/test.html it works in firefox, chrome, and
I am passing value of text-area in a.cfm in variable of GetXmlHttpObject to b.cfm
I've got a very simple cfform with a single form field: <cfform action=asdf.cfm method=post>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.