Solved

cfdiv bind problem

Posted on 2009-04-01
4
794 Views
Last Modified: 2013-12-24
Hello experts
Using <cfdiv bind from this solution:http://www.experts-exchange.com/Software/Photos_Graphics/Web_Graphics/Macromedia_Flash/ActionScript/Q_23826174.html
i get the recorcount without submitting my search form.
Now i have a problem trying to get the recordcount when i select hersteller_ID.
I have an error:http: Error retrieving markup for element theDiv : Error Executing Database Query.
but when i submit the form i get the result i want in my result page where i have the same query.
Here is the code that has the problem:
<cfinvoke component="test.com.getsearchmodell" method="getHersteller" returnvariable="qHersteller">
</cfinvoke>
<script type="text/javascript" src="../js/engine_micro.js"></script>
<script language="javascript" type="text/javascript">
function getModell(ID){
 //set the params required for your function
 if (isNaN(ID) || ID <= 0) ID = 0;
 var param = 'herstellerid='+ID;
 http('POST','../com/getsearchmodell.cfc?method=getMenu',showModell_response,param);
}
function showModell_response(obj){
 var mySelect = document.getElementById('S_Modell_ID');
 mySelect.options.length = 0;
 for (var c = 0; c < obj.modell_id.length; c++)
 {
  //note that jsmx calls always return lower case
  mySelect.options[c] = new Option(obj.modell_de[c] , obj.modell_id[c]);
 }      
}
</script>

<cfform>
<cfdiv bind="url:../resultscheck.cfm?S_Hersteller_ID={S_Hersteller_ID}" ID="theDiv" style="height:20px; width:80px;"/>
<cfselect name="S_Hersteller_ID" class="selectleftbig" id="S_Hersteller_ID" onchange="getModell(this.value);">
                       <option value="">beliebig</option>
                         <cfoutput query="qHersteller">
                                <option value="#qHersteller.Hersteller_ID#" >#qHersteller.Hersteller_Text#</option>
                             </cfoutput>
                           </cfselect>
<cfform>

resultscheck:
<cfquery name="WADAdboartikel" datasource="carfree24">
SELECT  Herstellers_ID
FROM artikel
WHERE (0=0
<cfif isdefined("Url.S_Hersteller_ID")>
    <cfif Url.S_Hersteller_ID NEQ "">
 AND  a.Herstellers_ID = <cfqueryparam value="#URL.S_Hersteller_ID#" cfsqltype="cf_sql_integer">
      </cfif>
  </cfif>  
     )
</cfquery>
 
<cfoutput>#WADAdboartikel.RecordCount#</cfoutput>
0
Comment
Question by:Panos
  • 3
4 Comments
 
LVL 27

Assisted Solution

by:azadisaryev
azadisaryev earned 300 total points
ID: 24037622
see if moving your cfdiv to AFTER your cfselect solves the problem.

or, maybe putting a <cfparam name="form.S_Hersteller_ID" default=""> somewhere at the top of your page will solve this...


Azadi
0
 
LVL 27

Assisted Solution

by:azadisaryev
azadisaryev earned 300 total points
ID: 24037642
you can also try adding bindonload="false" to your cfdiv - this should prevent it from loading the binding on pageload when S_Hersteller_ID is not yet defined...

Azadi
0
 
LVL 2

Accepted Solution

by:
Panos earned 0 total points
ID: 24037947
Hi azadi
The problem was in the query.
 a.Herstellers_ID (a. is not defined and i could not see the error the way i did put the cfdiv.)
Now i did put the cfdiv in the bottom and i saw clearly the error.
Anyway thank you again for your help
0
 
LVL 27

Expert Comment

by:azadisaryev
ID: 24038355
i have totally missed that...
but i am glad i could help you find the problem!

Azadi
0

Featured Post

Network it in WD Red

There's an industry-leading WD Red drive for every compatible NAS system to help fulfill your data storage needs. With drives up to 8TB, WD Red offers a wide array of solutions for customers looking to build the biggest, best-performing NAS storage solution.  

Join & Write a Comment

Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
This video discusses moving either the default database or any database to a new volume.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now