1 Reply Latest reply on Dec 20, 2011 1:38 PM by ilssac

    Is it possible to isolate and refresh an include?

    emartek1

      I am working with a form that has an include. The include template dynamically generates input fields. It has to refresh each time a new row is added. It works but each time it refreshes I lose the data in the original form. How do I get my form page to retain its data if the include page is refreshed. BTW...the only way I could get the form and include to work was to allow the whole page to be refreshed. I was unable to figure out a way to isolate the include and make it refresh only.

        • 1. Re: Is it possible to isolate and refresh an include?
          ilssac Level 5

          It really sounds like you are mixing up what happens on a server and what happens on a client.

           

          By 'include' I am presuming you are talking about <cfincludes>.  And yes, there is no way for the client to refresh just the part of the code that came from the <cfinclude> tag.  All that happens on the server and the client as no idea how the http response was built.  It just receives one entire response and does what it does best with it.

           

          On the server you have the <iframe> tag (and the older, despied and deprecated <frame> consturct. To build a page from multiple requests.  If you do this you can easily use javascript to refresh one or more <iframe> sections in a apage.  Now, wheter you can use an <iframe> tag in the place of your code where you want this to happen is an open question.

           

          Finally you can just flat out use AJAX functionality to make a new request and have the response handler for that request rebuild a section of a page.

           

          Now this client side and server side techniques are completer indipendant of each other.  <iframe> and AJAX funtions can make requests to CFML resources that do or do not use <cfinculde> tags.  And <cfinclude> tags and be used to generate HTTP responses that may or may not be used in single or composite using <iframe> and|or AJAX HTML pages.

           

          All that long explanation is to say that YES, I suspect that there is some way or another to acomplish what you want to do.  With without some idea of what you are actually trying to do, it is rather difficult to suggest anything more specific.