• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Dynamic Quoted Value List Column

Guest
May 28, 2007 May 28, 2007

Copy link to clipboard

Copied

While working on an autosuggest custom tag, I am allowing the user to pass in either an array or a query. If a query, I need to loop through each column and add it to the possible suggestions. I cannot however get the dynamic column name to read without CF7.02 throwing an error. I have attached the snippet. The error received is: Invalid CFML construct found on line 98 at column 77.

ColdFusion was looking at the following text: [

Any help would be much appreciated.

TOPICS
Advanced techniques

Views

406

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
May 28, 2007 May 28, 2007

Copy link to clipboard

Copied

Hi, something like this should do the trick:

<cfset mySuggestions = Evaluate("QuotedValueList(attributes.suggestion." & queryColumn & ")")>

I'm not sure if you're aware, but you'll get an error if attributes.suggestion contains more than one column. You might need to change it to loop through the column list instead?

cheers

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 29, 2007 May 29, 2007

Copy link to clipboard

Copied

> <cfset mySuggestions =
> quotedValueList(attributes.suggestion[queryColumn])>
> </cfif>

<cfset mySuggestions =
listQualify(arrayToList(attributes.suggestion[queryColumn]), "'")>

--
Adam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 29, 2007 May 29, 2007

Copy link to clipboard

Copied

LATEST
Thank you guys.

efecto747 that is what I was going for. I did realize that if there was more than one column it would break, but I didn't know how to dynamically call each column as I looped through. Now I do. Thanks!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation