Re: What's the easiest way to do this?
Yes, this is a task well suited to AJAX. Perhaps look at AjaxCFC (the JQuery version) or mxAjax so that you get an integrated CF solution out of the box. As I use mxAjax, I'd use the mxData component to run a CFC method that returns values based on those dropdowns; then I'd write the new data into the last dropdown (perhaps with the DOM or with innerHTML). On 6/12/07, Will Tomlinson [EMAIL PROTECTED] wrote: I have a form that uses qForms for 7 dynamic select menus. There's one other dataset/filter I need to add, but it isn't directly connected with the data in the related menus. I can query this data and filter it using the related selects, but I only know how to do it the old fashioned way - hit the server with a submit button and return the data to a newly shown dropdown for courses. How could I do this with say, a button, Show course filter. You click the button and it asynchrously runs the course query, using the filters from the related selects. Then display it in a another dropdown filter. I know this has AJAX written all over it, but could somebody point me in the right direction? -- mxAjax / CFAjax docs and other useful articles: http://www.bifrost.com.au/blog/ ~| Macromedia ColdFusion MX7 Upgrade to MX7 experience time-saving features, more productivity. http://www.adobe.com/products/coldfusion?sdid=RVJW Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280737 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: What's the easiest way to do this?
As I use mxAjax, I'd use the mxData component to run a CFC method that returns values based on those dropdowns; then I'd write the new data into the last dropdown (perhaps with the DOM or with innerHTML). Thanks james. I'll investigate this. Will ~| Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 Flex 2 Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280751 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: What's the easiest way to do this?
James, Will this work if I have multiple form fields that need to be passed to the cfc? What's mixing me up is the source attribute. Here's what I'm passing. 3 items, from 3 formfields. !--- Start ajaxcfc call --- cfoutput script type='text/javascript' src='../mxAjax/core/js/prototype.js'/script script type='text/javascript' src='../mxAjax/core/js/mxAjax.js'/script script type='text/javascript' src='../mxAjax/core/js/mxSelect.js'/script /cfoutput script language=javascript var url = cfoutput#ajaxUrl#/cfoutput; function init() { new mxAjax.Select({ parser: new mxAjax.CFArrayToJSKeyValueParser(), executeOnLoad: true, target: course, paramArgs: new mxAjax.Param(url,{param:eval={eval},T7={Tier7},T6={Tier6}, httpMethod:get, cffunction:getCourses}), source: eval,Tier7,Tier6 }); } addOnLoadEvent(function() {init();}); /script If I change one of the dropdowns, nothing happens. Thanks, Will ~| Macromedia ColdFusion MX7 Upgrade to MX7 experience time-saving features, more productivity. http://www.adobe.com/products/coldfusion?sdid=RVJW Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280754 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: What's the easiest way to do this?
Instead of using the mxselect use mxdata - this will let you pass in each dropdown value as an argument to your CFC and get a return you can use to build the last dropdown. Check my blog or the mxdata example for some more details on mxdata. If you have more problems with it let me know and I'll blog a solution. On 6/12/07, Will Tomlinson [EMAIL PROTECTED] wrote: James, Will this work if I have multiple form fields that need to be passed to the cfc? What's mixing me up is the source attribute. Here's what I'm passing. 3 items, from 3 formfields. !--- Start ajaxcfc call --- cfoutput script type='text/javascript' src='../mxAjax/core/js/prototype.js'/script script type='text/javascript' src='../mxAjax/core/js/mxAjax.js'/script script type='text/javascript' src='../mxAjax/core/js/mxSelect.js'/script /cfoutput script language=javascript var url = cfoutput#ajaxUrl#/cfoutput; function init() { new mxAjax.Select({ parser: new mxAjax.CFArrayToJSKeyValueParser(), executeOnLoad: true, target: course, paramArgs: new mxAjax.Param(url,{param:eval={eval},T7={Tier7},T6={Tier6}, httpMethod:get, cffunction:getCourses}), source: eval,Tier7,Tier6 }); } addOnLoadEvent(function() {init();}); /script If I change one of the dropdowns, nothing happens. Thanks, Will ~| CF 8 â Scorpio beta now available, easily build great internet experiences â Try it now on Labs http://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_adobecf8_beta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280757 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: What's the easiest way to do this?
Thanks a ton james! Let me ask you something. I've spent quite a bit of time integrating qForms into this page to get the organization dropdowns talkin' to one another. http://208.106.220.252/soundings/T8Report.cfm It all works perfectly. Choose test eval 1 in the eval dropdown. Then Business Technologies Information technologies ITN. At that point you can click refresh and I'm just submitting that form to populate the course dropdown. So depending on what you select in those three dropdowns, the form submits and it runs a query of courses with those criterias. THAT's the part I'd like to sub out with Ajax. So to get to my question, do you think I can integrate CFAjax for this? And it won't affect my qForms? I'm hopin' it will, since the target course dropdown really isn't involved in the qForm calls. Except the course dropdown IS in the qForm object. Just wanna make sure I don't waste alot of time on somethin' that may not work anyway. Thanks much, Will ~| Create Web Applications With ColdFusion MX7 Flex 2. Build powerful, scalable RIAs. Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280781 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: What's the easiest way to do this?
Yes, that should work fine with mxAjax (or any of the other choices you have). It can even be triggered in the onChange on the tier5 box, just like the qforms scripts are triggered on the others. On 6/12/07, Will Tomlinson [EMAIL PROTECTED] wrote: Thanks a ton james! Let me ask you something. I've spent quite a bit of time integrating qForms into this page to get the organization dropdowns talkin' to one another. http://208.106.220.252/soundings/T8Report.cfm It all works perfectly. Choose test eval 1 in the eval dropdown. Then Business Technologies Information technologies ITN. At that point you can click refresh and I'm just submitting that form to populate the course dropdown. So depending on what you select in those three dropdowns, the form submits and it runs a query of courses with those criterias. THAT's the part I'd like to sub out with Ajax. So to get to my question, do you think I can integrate CFAjax for this? And it won't affect my qForms? I'm hopin' it will, since the target course dropdown really isn't involved in the qForm calls. Except the course dropdown IS in the qForm object. Just wanna make sure I don't waste alot of time on somethin' that may not work anyway. -- mxAjax / CFAjax docs and other useful articles: http://www.bifrost.com.au/blog/ ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 MX7 integration create powerful cross-platform RIAs http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280784 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: What's the easiest way to do this?
Yes, that should work fine with mxAjax (or any of the other choices you have). It can even be triggered in the onChange on the tier5 box, just like the qforms scripts are triggered on the others. oops, I meant mxAjax. I've been lookin' at so many the last day or so I can't keep'em straight. :) ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion MX7 with Flex 2 http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280787 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: What's the easiest way to do this?
Yes, this is a task well suited to AJAX. Perhaps look at AjaxCFC (the JQuery version) or mxAjax so that you get an integrated CF solution out of the box. I'm hijackin' code from yer blog right now. Gonna try and make this work. I'll keep ya posted. ~| ColdFusion 8 beta â Build next generation applications today. Free beta download on Labs http://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_adobecf8_beta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280790 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: What's the easiest way to do this?
Ok James, I'm gettin close! I have it runnin the query when the page loads, which is of course not what I want. But this tells me things are workin. I've modified the example on your blog. Now, I'm REAL slow when it comes to JS, so bear with me here. Here's my JS call: script language=javascript var url = cfoutput#ajaxUrl#/cfoutput; cfoutput function init() { new mxAjax.Data({ executeOnLoad:true, paramArgs: new mxAjax.Param(url,{param:eval=#FORM.eval#,T7=#FORM.Tier7#,T6=#FORM.Tier6#, cffunction:getCourses}), postFunction: handleData }); function handleData(response) { var myHTMLOutput = JSON.parse(response); document.getElementById(myTargetSpan).innerHTML = myHTMLOutput; } } addOnLoadEvent(function() {init();}); /cfoutput /script I left executeonload to true because This script is wrapped with a cfif anyway. It won't fire when the page loads, so I'm good to go there. Here's the function I stuck in example.cfc: cffunction name=getCourses output=true cfargument name=eval cfargument name=T7 cfargument name=T6 cfset var courseArray = ArrayNew(1) cfset var getCourses = cfquery datasource=#APPLICATION.dsn# name=getCourses SELECT SectionID, Section, evalid, Title, StudentID, Course FROM tblstudentcourses !--- Get courses for the evaluation selected --- WHERE evalid = cfqueryparam cfsqltype=cf_sql_integer value=#ARGUMENTS.eval# !--- Filter courses according to any organizational filters submitted --- cfif Len(ARGUMENTS.T7) AND ARGUMENTS.T7 NEQ All AND orgtier7code = cfqueryparam value=#ARGUMENTS.T7# /cfif cfif Len(ARGUMENTS.T6) AND ARGUMENTS.T6 NEQ All AND orgtier6code = cfqueryparam value=#ARGUMENTS.T6# /cfif /cfquery cfsavecontent variable=showCourseMenu select name=course option value=AllAll/option cfoutput query=getCourses option value=#sectionid##section# - #title#/option /cfoutput /select /cfsavecontent cfreturn showCourseMenu /cffunction Up to this point, things are workin nicely. That menu pops right up when an eval is chosen in the top dropdown - This is the coolest thing I've ever done! Here's my trouble. How do I get it to fire off when any of those organization filters are changed? I already have an onChange in them for the qForms. Here's an example of Tier 7 (stripping out the conditional stuff for easier reading: select name=Tier7 onChange=objForm.Tier6.populate(stcTiers[objForm.Tier7.getValue()], null, null, stcBlank); option value=AllAll/option cfoutput query=get7OrgTiers group=orgtier7id cfoutput group=orgtier7id option value=#orgtier7code##orgtier7title#/option /cfoutput /select How do you fire this thing off? Can it be appended to the onChange? Thanks a ton james! Will ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 MX7 integration create powerful cross-platform RIAs http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280826 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
What's the easiest way to do this?
I have a form that uses qForms for 7 dynamic select menus. There's one other dataset/filter I need to add, but it isn't directly connected with the data in the related menus. I can query this data and filter it using the related selects, but I only know how to do it the old fashioned way - hit the server with a submit button and return the data to a newly shown dropdown for courses. How could I do this with say, a button, Show course filter. You click the button and it asynchrously runs the course query, using the filters from the related selects. Then display it in a another dropdown filter. I know this has AJAX written all over it, but could somebody point me in the right direction? Thanks, Will ~| ColdFusion MX7 and Flex 2 Build sales marketing dashboard RIAâs for your business. Upgrade now http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280733 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4