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
Solved

cfdiv bind problem

Posted on 2009-04-01
4
798 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Service "nameserver" appears to be down 4 625
LAMP problem identifier tool ? 9 123
ColdFusion Rereplace 3 81
Redirect to HTTPS results in Infinite LOOP 4 135
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…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

856 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