{"id":260,"date":"2010-07-02T12:01:35","date_gmt":"2010-07-02T16:01:35","guid":{"rendered":"http:\/\/erics-test-lab.com\/?p=260"},"modified":"2010-07-02T12:01:35","modified_gmt":"2010-07-02T16:01:35","slug":"cfdiv-and-bind","status":"publish","type":"post","link":"https:\/\/www.esearing.com\/v2010\/2010\/07\/cfdiv-and-bind\/","title":{"rendered":"cfdiv and bind"},"content":{"rendered":"<p>I have been using the CFDIV and BIND attribute since we switched to Coldfusion 8. This week it really came in handy.<br \/>\nI helped  a co-worker create a dropdown list that changes based on year selected. Some options were not available in previous years. <\/p>\n<p>But then I found a really nifty use for it. <!--more-->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)<\/p>\n<p>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.<\/p>\n<p>Process:<br \/>\nDisplay Q1 on Create New page<br \/>\non Answer(bind event) call the action page<br \/>\naction page runs logic tests and invokes the components and methods which return data to the action page<br \/>\naction 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.<br \/>\nIf 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.<\/p>\n<p>This process could be used for any Q&#038;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.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &hellip; <a href=\"https:\/\/www.esearing.com\/v2010\/2010\/07\/cfdiv-and-bind\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,16],"tags":[],"class_list":["post-260","post","type-post","status-publish","format-standard","hentry","category-code","category-coldfusion"],"_links":{"self":[{"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/posts\/260","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/comments?post=260"}],"version-history":[{"count":0,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/posts\/260\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/media?parent=260"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/categories?post=260"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/tags?post=260"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}