Dynamically populating a CFINCLUDE

2000-06-04 Thread C

I'd like to setup a CFINCLUDE that dynamically populates.. something like:

CFINCLUDE TEMPLATE="#var#

This would go to fill a DIV component with HTML that explains the 
selection they are making..

Now, I obviously don't want them to have to submit the form in order to see 
what the heck the option is, I need a way for once they click any of the 
image options / radioboxes / or make a CFSELECT for, within the same page, 
it to transfer the variable to the CFINCLUDE.

Or do I need to start thinking about a different solution?

--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Dynamically populating a CFINCLUDE

2000-06-04 Thread C

I'd like to setup a CFINCLUDE that dynamically populates.. something like:

CFINCLUDE TEMPLATE="#var#

This would go to fill a DIV component with HTML that explains the 
selection they are making..

Now, I obviously don't want them to have to submit the form in order to see 
what the heck the option is, I need a way for once they click any of the 
image options / radioboxes / or make a CFSELECT for, within the same page, 
it to transfer the variable to the CFINCLUDE.

Or do I need to start thinking about a different solution?

-

Following up myself, I'm beginning to wonder if this is the means..

have the divCFINCLUDE TEMPLATE="finder.cfm?#var# /div

And have the finder.cfm basically turn the var field into the HTML to load 
where finder.cfm ends up starting a second spawn of CFINCLUDE with the 
proper file selected ... the problem is turning the image map variables, or 
just a Javascript feed into the #var#

then again, it's 2AM, the problem could be no sleep!

--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: Dynamically populating a CFINCLUDE

2000-06-04 Thread Seth Petry-Johnson

 I'd like to setup a CFINCLUDE that dynamically populates.. something like:

 CFINCLUDE TEMPLATE="#var#

 This would go to fill a DIV component with HTML that explains the
 selection they are making..
snip

 have the divCFINCLUDE TEMPLATE="finder.cfm?#var# /div

 And have the finder.cfm basically turn the var field into the HTML to load
 where finder.cfm ends up starting a second spawn of CFINCLUDE with the
 proper file selected ... the problem is turning the image map variables,
or
 just a Javascript feed into the #var#

It sounds like you're having trouble differentiating between client side
code and server side code.  CF is server side, which means that CF
statements are evaluated BEFORE the page gets sent to the browser.  User
requests page - CF server evaluates CF code and creates a simple HTML
document - HTML document is sent to user.  Once the browser receives the
HTML no more CF code will run unless you request another page from the
server.

You can not invoke any CF tags such as CFINCLUDE once the page has been sent
to the browser, so you're going to have to find another way of doing what
you want.

Based upon your application specs there are a couple of ways you can do
this.  They all require some level of JavaScript support by the browser.

1) Each time the user makes a selection you could reload the page to show
the info about their selection, but this is a pretty nasty way to go.
However, it requires no special client side scripting and will work in all
browsers.

2) You could create a series of overlapping layers where each layer contains
the info for one of the possible selections.  Each time the user clicks on a
selection you could make the relevant layer to the "highest" on the stack,
thereby making it visible.  This should work in both Netscape and IE (4.x+
versions) but has two disadvantages: first, you would have to include the
info for all possible selections as hidden layers.  This could result in the
document becoming relatively large and therefore a long download.  Secondly,
the HTML code itself could get a little ugly with all of the overlapped
layers.

3) If you are targeting an IE 4.x+ audience only you can use the DIV's
.innerHTML or .innerText properties to dynamically rewrite the contents of
the DIV tag.  This is far easier to do then the layer method but only works
on IE 4 and up.

4) You could use frames in such a way that each time the user makes a
selection a frame updates to show the info for that selection.  This will
work in all frame aware browsers and is better than option 1 because only a
small portion of the page reloads each time the user makes a selection.

Hope this helps,
Seth Petry-Johnson
Argo Enterprise and Associates
Using
divCFINCLUDE TEMPLATE="finder.cfm?#var# /div

will result in a DIV section containing the output of finder.cfm, but

--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: Dynamically populating a CFINCLUDE

2000-06-04 Thread C


It sounds like you're having trouble differentiating between client side
code and server side code.  CF is server side, which means that CF
statements are evaluated BEFORE the page gets sent to the browser.  User
requests page - CF server evaluates CF code and creates a simple HTML
document - HTML document is sent to user.  Once the browser receives the
HTML no more CF code will run unless you request another page from the
server.

Yep, I figured that, I just figured there was a way to basically drop down 
CFINCLUDEs.. after a good night sleep (which was needed) I came to this 
conclusion:

2) You could create a series of overlapping layers where each layer contains
the info for one of the possible selections.  Each time the user clicks on a
selection you could make the relevant layer to the "highest" on the stack,
thereby making it visible.  This should work in both Netscape and IE (4.x+
versions) but has two disadvantages: first, you would have to include the
info for all possible selections as hidden layers.  This could result in the
document becoming relatively large and therefore a long download.  Secondly,
the HTML code itself could get a little ugly with all of the overlapped
layers.

This is somewhat what I did.  I created 5 DIVS with seperate CFINCLUDEs 
so that I can continuously change the content upon demand and enabled them 
via DHTML drop downs..

3) If you are targeting an IE 4.x+ audience only you can use the DIV's
.innerHTML or .innerText properties to dynamically rewrite the contents of
the DIV tag.  This is far easier to do then the layer method but only works
on IE 4 and up.

Yeah, I thought about this, but had to rule it out ;(

Using multiple DIVCFINCLUDE TEMPLATE functions basically worked out to 
fix the problem I was after.. and it fundamentally wasn't that bad.

(then again, I'm not trying to recreate madness, ala 
http://news.ortaga.com/ which someone referred me to, just four dropdowns.. )

CW

--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: Dynamically populating a CFINCLUDE

2000-06-04 Thread Fred T. Sanders

Why not just use a cfswitchcfset group and bring up
whatever cfinclude you need.

cfparam name="url.dspaction" type="string"
default="mydefault"

cfswitch expression = "#url.dspaction"

cfcase value="mydefault"
cfinclude template="mydefault.cfm"
/cfcase

cfcase value="mysecondchoice"
cfinclude template="my2ndchoice.cfm"
/cfcase

cfcase value="mythirdchoice"
cfinclude template="my3rdchoice.cfm"
/cfcase

/cfswitch

like so.  your template might be a little lengthy but the
resulting html should be a bit smaller, and load faster.

Fred

- Original Message -
From: "C" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, June 04, 2000 11:30 AM
Subject: Re: Dynamically populating a CFINCLUDE
 snip snip ---


 Yeah, I thought about this, but had to rule it out ;(

 Using multiple DIVCFINCLUDE TEMPLATE functions
basically worked out to
 fix the problem I was after.. and it fundamentally wasn't
that bad.

 (then again, I'm not trying to recreate madness, ala
 http://news.ortaga.com/ which someone referred me to, just
four dropdowns.. )

 CW


--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.