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

valuelist question

Participant ,
Aug 06, 2009 Aug 06, 2009

I use valuelist to display a list of values :

#valuelist(qry.qualifierText, ", ")#

However, it will display continually across the page until it runs out of room, then wraps to the next line and continue until done.

How can I define it so that it will display only five on one line, then skip and dispaly the next five, then skip, etc. until completed ?

642
Translate
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 ,
Aug 07, 2009 Aug 07, 2009

Don't use valuelist.  Use cfoutput query = yourquery.  Use the mod operator to decide where to put your line breaks.

Translate
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
Advocate ,
Aug 11, 2009 Aug 11, 2009

You could also get away with a crafty regular expression that places a "<br/>" just before every fifth comma.   Something like this:

#ReReplace(sValueList, "(([^,]*,){5})", "$1<br/>", "all")#

Translate
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
Engaged ,
Aug 12, 2009 Aug 12, 2009
LATEST

Use arrays.  "Lists" are faked with commas.  ColdFusion does not have a genuine "list" data-type.

Translate
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