Highlighted

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

New Here ,
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

149

Likes

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

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

New Here ,
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

150

Likes

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
Jan 02, 2015 0
BKBK LATEST
Adobe Community Professional ,
Jan 05, 2015

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
Jan 05, 2015 0