Mark,
I haven't done much AJAX using the built in ColdFusion tags, so my solution
would use jQuery and be vastly different so I won't bother posting.
But I did find this article by Ray Camden where he shows how to update a
cfdiv using a JavaScript call:
http://www.coldfusionjedi.com/index.cfm/2007/7/19/Building-an-auto-refresh-div-with-ColdFusion-8

<http://www.coldfusionjedi.com/index.cfm/2007/7/19/Building-an-auto-refresh-div-with-ColdFusion-8>Based
on that, I think you could setup a click handler on your links.  A simple
example would be:

<cfdiv id="myDiv" bind="url:bind_get_art.cfm?artistID={artistID}"></cfdiv>
<a href="get_art_noJS.cfm?artistID=1"
onClick="ColdFusion.navigate('bind_get_art.cfm?artistID=1', 'myDiv');return
false;" >First Art</a>
<a href="get_art_noJS.cfm?artistID=2"
onClick="ColdFusion.navigate('bind_get_art.cfm?artistID=2', 'myDiv');return
false;" >Second Art</a>


If that isn't clear, I assumed you have a get_art_noJS page that the user
will be directed to if they do not have JS enabled, and because I have "return
false;" in the click event, if a user has JS enabled, that link will not be
used and instead the ColdFusion.navigate code will be called.  This is a
crude way to gracefully degrade the functionality of the page for non-JS
users.

This code isn't tested and may be completely incorrect [and I am sure this
isn't "best practice"], so buyer beware :)

--Ken

On Fri, Nov 20, 2009 at 9:17 AM, Mark Davis <[email protected]>wrote:

>  I am looking at replacing some pages in am old app with some AJAX stuff
> but am having trouble finding exactly what I am looking for.
>
> I want to bind a cfdiv to the results of a cfc such as this...
>
>
> <cfdiv bind="url:bind_get_art.cfm?artistID={artistID}"></cfdiv>
>
> but every example I find is using a cfform element to determine the variable 
> in the bind.
>
> How can I accomplish this from a link on the page instead of a cfform?  So 
> user clicks a link and the div gets bound to the results of the url (or even 
> better, a cfc function call)
>
> Thanks.
>
> Mark
>
>  --
> You received this message because you are subscribed to the "Houston
> ColdFusion Users' Group" discussion list.
> To unsubscribe, send email to [email protected]
> For more options, visit http://groups.google.com/group/houcfug?hl=en

-- 
You received this message because you are subscribed to the "Houston ColdFusion 
Users' Group" discussion list.
To unsubscribe, send email to [email protected]
For more options, visit http://groups.google.com/group/houcfug?hl=en

Reply via email to