I am refactoring some very old ColdFusion code (ColdFusion 5,
not done by me), and I'm considering replacing a huge and complex
HTML table with a CFGrid.
This HTML table is in an INCLUDE file and called from two
places, each time it gets a CFQuery with the same name and columns,
so the HTML table loop over it, but the (very complex) Queries are
It would be a major hassle to "open up" the original queries
and build them into the CFC that should supply the data for my
CFGrid, so my idea is to wrap the original query into a QoQ, and
use the QoQ to display and maybe filter the CFGrid.
But my problem is, the CFC that I use to bind to the CFGrid
has to somehow get the original CFQuery to base the QOQ upon, and I
haven't found any way to pass the CFQuery to it! I tried to pass
the CFQuery itself in the bind expression as:
<cfgrid format="html" name="gridTravel" pagesize=25
colheaderbold="false" colheaderfont="Franklin Gothic Medium"
And I also tried to first initialize the CFC with the CFQuery
before the binding:
travelCfc = createObject("component", "travel");
travelCfc.travelListBase = TravelSel;
But nothing works.
My question, does the binding of CFGrid to a CFC only works
in a "static" way (in Java term)?! In that case, the initialization
method would clearly never work properly, is it then possible to
pass the CFQuery in the Bind at all?
Given my requirement, what would be the best way of achieving
what I'm doing?
Any suggestion will be appreciated, and many thanks in