Solved

Bind expressions cannot be empty.(coldfusion)

Posted on 2009-05-12
2
749 Views
Last Modified: 2013-12-20
Hello experts.
I have a query:
<cfquery name="getmodell" datasource="#request.dsn#">
SELECT Modell
From Artikel
WHERE Mobile_Sub_ID = <cfqueryparam cfsqltype="cf_sql_integer" value="#Url.Mobile_Sub_ID#">
Order by Modell ASC
</cfquery>
<cfset modellist= valuelist(getmodell.Modell,',')>

And a cfinput:
<cfinput  type="text" name="S_Modell" Autosuggest="#modellist#" />

If i don't have any records (recordcount = 0) i have the error Bind expressions cannot be empty.
Any help to solve the problem?
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
2 Comments
 
LVL 27

Accepted Solution

by:
azadisaryev earned 500 total points
ID: 24373697
wrap your <cfinput> in a <cfif> block checking for listlen(modellist), and if list is empty, show a plain text input box (without autosuggest):

<cfif listlen(modellist)>
  <cfinput  type="text" name="S_Modell" Autosuggest="#modellist#" />
<cfelse>
  <cfinput  type="text" name="S_Modell" />
</cfif>

Azadi
0
 
LVL 2

Author Closing Comment

by:Panos
ID: 31580861
Thank you azadi fr yur help
regards
panos
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Suggested Solutions

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
The purpose of this video is to demonstrate how to insert an Iframe into WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Open Page or Post…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …

696 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