Solved

cfdiv bind problem

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

919 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

19 Experts available now in Live!

Get 1:1 Help Now