Solved

cfdiv bind problem

Posted on 2009-04-01
4
799 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Domain Name E-mail Address & Outlook Integration 3 43
connection string question 2 73
Firewall Speed Issue 6 76
HTTPS for signup & login - HTTP for all other pages 10 51
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
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 …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

726 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