I have been using the CFDIV and BIND attribute since we switched to Coldfusion 8. This week it really came in handy.
I helped a co-worker create a dropdown list that changes based on year selected. Some options were not available in previous years.
But then I found a really nifty use for it. I am building a trouble ticket system which gathers information from the user as a series of questions. Each question offers answers which then lead to another question, a solution, or a message (no ticket event)
I needed a way to make the next question appear dynamically based on the previous questions answer. CFDIV bind allowed me to do this. I start with Q1 which has selection form element that helps id the general problem. If the user picks answer 1.1 they will then be prompted to answer Q2, answer Q2.1 may prompt them to answer Q3, while answer Q2.2 may prompt them to answer Q5. By using a new CFDIV bound to the previous question I am able to display these items in sequence within a form. the questions and answers are stored in database tables and are retrieved based on the Q# or Answer Id#. I have a component with functions to manage the SQL and a separate action CFM page to manage the output. Thus the system is self looping until the user reaches a point where they either have a solution, a message, or get to open their ticket.
Process:
Display Q1 on Create New page
on Answer(bind event) call the action page
action page runs logic tests and invokes the components and methods which return data to the action page
action page evaluates the output (cfif logic) and writes the next question, solution, message, or form elements needed to create the ticket on the Create new form in the location of the CFDIV.
If new question is required, a CFDIV is then created and bound to the new questions Answers. Upon Answer it will go to action page and repeat the process.
This process could be used for any Q&A system that requires decision processing and skipping of sequential questions. After I finish my project I will try to build a sample Application should any one want it. You can contact me if you would like to see the code.