New AJAX Feature - <tap:div />

So I just added an item to the framework's default stylesheet for <tap:div /> and also added it to the documentation for the xhtml tag library (which incidentally shows up both under function libraries and custom tags in the docs). You know all the underlying structure was already there, it just wasn't plugged together this way, but now you can use tap:div basically the same way the CFDIV tag works in ColdFusion 8 -- any links inside the div will fetch content via a framework gateway element (AJAX). So here's the code I tested it with.

<cfparam name="attributes.submitted" type="string" default="" />
<cfset attributes.submitted = val(attributes.submitted) />

<div xmlns:tap="" style="margin:20px; text-align:center;">
<a href="?">
<tap:url name="submitted" value="attributes.submitted+1" />
click me!
<div>You clicked the link <tap:variable name="attributes.submitted" /> times.</div>

So all the XSL sheet is doing is a real simple copy of the div and its attributes and then adding a tap:gateway inside with a gaterespond event that imports the returned content to the gateway's parent element. So it's the same as if you had written this:

<tap:event name="gaterespond">
<tap:import target="javascript:element.parentNode" />

... links go here ...

I love it when a new feature comes so easily. :)

BlogCFC was created by Raymond Camden. This blog is running version 5.5.006. | Protected by Akismet | Blog with WordPress