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

dynamic cflayoutareas based on a recordset from cfquery - coldfusion version 9

New Here ,
Jan 02, 2015 Jan 02, 2015

Copy link to clipboard

Copied

cflayout type="tab" name="mainTab" >

<cfloop query="qgetdcfg">

    <!--- Each layoutarea is one tab. --->

    <cflayoutarea title="#qgetdcfg.dsource#-#qgetdcfg.djobnamespec#"

       name="#qgetdcfg.dsource#-#qgetdcfg.djobnamespec#"

   selected = "true"

   >

    <h2>Tab name</h2>

    <p>

  <cfset datasource = "#qgetdcfg.dsource#">

  <cfset duser = "#qgetdcfg.duser#">

  <cfset dpassword = "#qgetdcfg.dpassword#">

  <cfset djobnamespec = "#qgetdcfg.djobnamespec#">

  <cfinclude template=all_js.cfm>

    </p>

    </cflayoutarea>

</cfloop>

</cflayout>

The above almost works. The all_js.cfm has only two parts to it, it formats a pie chart and then displays a few rows of data based on the datasource, user and password and djobnamespec variables.

The two tab shows up. The two charts show up in the appropriate table, but the data-table- rows - are always on the first tab. They do not follow the chart that is on the second tab. Are there any restrictions on cfinclude with cflayoutarea.

The contents of all_js.cfm is similar to what is enclosed below.

<cfquery name="qsummary" datasource="#datasource#" username="#duser#" password="#dpassword#">

select STATUS, cnt from stab

</cfquery>

<cfchart style="blue" showborder="yes" show3d="yes" chartwidth="250"

chartheight="250"  pieslicestyle="sliced">

    <cfchartseries type="pie"  query="qsummary" 

itemcolumn="STATUS"  valuecolumn="cnt">

    </cfchartseries>

</cfchart>

<cfquery name="qall_jstatus" datasource="#datasource#" username="#duser#" password="#dpassword#">

select col1, col2 from table1

</cfquery>

<cfoutput query=”qall_jstatus>

<tr>

<td bgcolor=#color#>#qall_jstatus.col1#</td>

<td bgcolor=#color#>#qall_jstatus.col2#</td>

<cfform action=”kkkk.cfm” method=”post”>

            <input type="hidden" name="duser" value="#duser#">

            <input type="hidden" name="dpassword" value="#dpassword#">

</cfform>

</tr>

</cfoutput>

Views

188

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
Community Expert ,
Jan 05, 2015 Jan 05, 2015

Copy link to clipboard

Copied

LATEST

You might require a <table> tag before the <cfoutput query=""> tag. It might be that the <tr> tags are stranded without the <table> tag.

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