all groups > coldfusion flash integration > may 2007 >
You're in the

coldfusion flash integration

group:

Dynamic Tabs with Dynamic Grids


Dynamic Tabs with Dynamic Grids Jim Schell
5/30/2007 7:33:43 AM
coldfusion flash integration:
Hello all,

I have what is probably a simple problem for you but not for this CF
Neewbie.

I am creating a tab form that has sub tabs, this part works no problem, and
on the sub tab I need to display a cfgrid.

Problem is when I make this dynamic, ie the parent tab gets it's name from a
query and the sub tab(s) for that specific parent tab get it's/their name(s)
from a query etc.

I place a cfgrid statement in the middle of this and my flash form fails to
load, I have heard that my problem is that my cfgrid has the same name for
multiple instances and this cannot be.

Ok then how do I make the name of the grid dynamic.I have tried to change
the name to a variable by adding the pound signs inside the double quotes
where the variable is equal to an id pulled from a query that populates the
grid.

Any suggestions here? I have very little hair left and what is left is
turning gray!!

Thanks for any help

Jim

Re: Dynamic Tabs with Dynamic Grids Jim Schell
5/30/2007 7:38:50 AM
Forgot to add my template code:

Here it is:


<cfform format="flash">

<!--- Query for Parent tabs --->
<cfquery name = "GetParentTab" dataSource = "rules">
SELECT RMSTab
from Rules
group by rmstab
</cfquery>

<cfformgroup type="tabnavigator" query="GetParentTab">

<cfloop query="GetParentTab">

<cfformgroup type="page" label="#GetParentTab.RMSTab#">

<!--- Query for Sub tabs --->
<cfquery name = "GetChildTab" dataSource = "rules">
SELECT RMSSubTab
from Rules
where RMSTab = '#GetParentTab.RMSTab#'
group by rmssubtab
</cfquery>

<cfformgroup type="tabnavigator" query="GetChildTab">

<cfloop query="GetChildTab">
<cfset VarGridName="#GetParentTab.RMSTab#"&"#GetChildTab.RMSSubTab#">
<cfformgroup type="page" label="#GetChildTab.RMSSubTab#">



<!--- Query for Rules --->
<cfquery name="GetRules" datasource="rules">
Select RuleFileName, RuleID
from Rules
where RMSSubTab ='#GetChildTab.RMSSubTab#'
</cfquery>

<cfloop query="Getrules">



<!--- With the following three lines commented out the template work but
the grid does not work and I get a blank screen --->
<cfgrid name= "#GetRules.RuleID#" query="getrules" format="flash">
<!--- <cfgridcolumn name="RuleFileName" header="Rule">
--->
<cfgridrow data="RuleFileName">
</cfgrid>

</cfloop>


</cfformgroup>
</cfloop>
</cfformgroup>


</cfformgroup>
</cfloop>
</cfformgroup>
</cfform>

[quoted text, click to view]

AddThis Social Bookmark Button