all groups > coldfusion flash integration > march 2005 >
You're in the

coldfusion flash integration

group:

Tab Navigation with Flash Forms/CFGrid


Tab Navigation with Flash Forms/CFGrid lgschulz
3/29/2005 8:20:03 PM
coldfusion flash integration:
I have three tabs for three different types of comodities. The user can
search for that part on either one of the tabs. When they select search, I
want the page to load the the correct tab showing. Here is my code.



<!---Material Query--->
<cfif not IsDefined("form.mcn")>
<cfset form.mcn = "*">
</cfif>
<cfif not IsDefined("form.procurement_document")>
<cfset form.procurement_document = "*">
</cfif>
<cfif not IsDefined("form.description")>
<cfset form.description = "*">
</cfif>
<cfif not IsDefined("form.material_description")>
<cfset form.material_description = "*">
</cfif>
<cfquery name="Materials" datasource="ITPROD">
SELECT MCN, REV, PROCUREMENT_DOCUMENT, DESCRIPTION, MATERIAL_DESCRIPTION
FROM LPDB.LMPDB
where
mcn like '#UCase ('#Replace(form.mcn, "*", "%")#')#'
and
procurement_document like '#UCase ('#Replace(form.procurement_document,
"*", "%")#')#'
and
description like '#UCase ('#Replace(form.description, "*", "%")#')#'
and
material_description like '#UCase ('#Replace(form.material_description,
"*", "%")#')#'
ORDER BY MCN ASC
</cfquery>

<!---Hardware Query--->
<cfif not IsDefined("form.part_number")>
<cfset form.part_number = "*">
</cfif>
<cfif not IsDefined("form.ProDoc")>
<cfset form.ProDoc = "*">
</cfif>
<cfif not IsDefined("form.Desc")>
<cfset form.Desc = "*">
</cfif>
<cfif not IsDefined("form.MatDesc")>
<cfset form.MatDesc = "*">
</cfif>
<cfquery name="Hardware" datasource="ITPROD">
SELECT PART_NUMBER, PROCUREMENT_DOCUMENT, DESCRIPTION, MATERIAL_DESCRIPTION
FROM LPDB.LMHDB
where
part_number like '#UCase ('#Replace(form.part_number, "*", "%")#')#'
and
description like '#UCase ('#Replace(form.description, "*", "%")#')#'
ORDER BY PART_NUMBER ASC
</cfquery>

<!---Connectors Query--->
<cfquery name="Connectors" datasource="ITPROD">
SELECT PART_NUMBER, REV, PROCUREMENT_DOCUMENT, DESCRIPTION,
MATERIAL_DESCRIPTION
FROM LPDB.LMHDB_CONNECTORS
ORDER BY PART_NUMBER ASC
</cfquery>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>MHC DATABASE SEARCH</title>
</head>

<body>

<!--- Specify the form height and width and color--->
<cfform name="Search" height="1000" width="900" format="Flash"
skin="HaloOrange" preservedata="yes">

<!--- Set the TabNaviagtor and formating --->
<cfformgroup type="tabnavigator"
style="marginTop:0;
backgroundColor:##FFFFEE;
fontSize:10;
marginBottom:5;
fontStyle:normal;
backgroundColor:##FFFFEE">

<!---1st-Material Tab Navigation--->
<cfformgroup type="page" label="Material Search">

<!---box to seperate the input boxes from the buttons--->
<cfformgroup type="hdividedbox" >

<!--- Group the Material input boxes, aligned vertically. --->
<cfformgroup type="VBox" style="fontSize:12; fontStyle:normal;
height:auto">
<cfformgroup type="vertical" height="80">

<!--- Group the Material input boxes, aligned vertically. --->
<cfformgroup type="VBox" style="fontSize:12; fontStyle:normal;
height:auto">
<cfformgroup type="vertical" height="80">
<cfinput type="text" name="mcn" width="100" label="MCN">
<cfinput type="text" name="procurement_document" label="Procurement
Document" width="400"/>
<cfinput type="text" name="description" label="Description"
width="300"/>
<cfinput type="text" name="Material_Description" label="Mat'l
Description" width="300"/>
</cfformgroup>
</cfformgroup>
</cfformgroup>
</cfformgroup>

<!--- Group the Material buttons, aligned vertically. --->
<cfformgroup type="VBox" height="150">
<cfformgroup type="tile" height="80" width="100" label="Tile box">
<cfinput type = "submit" name="submit" width="100" value = "Search">
<!---onClick="GridData.insertRow(gridMaterial);">--->
<cfinput type = "button" name="reset" width="100" value = "Reset Fields"
onclick="mcn.text='*'; procurement_document.text='*';
description.text='*'; Material_Description.text='*'">
</cfformgroup>
</cfformgroup>
</cfformgroup>

<!--- Horizontal rule styles specify the rule characteristics. --->
<cfformitem type="hrule" style="color:##999900; shadowColor:##DDDD66;
strokeWidth:4"/>

<!---Formats the Material data in the Grid--->
<cfformgroup type="vbox" style="fontSize:12; fontStyle:normal;
verticalGap:5; marginLeft:1; marginRight:1">

<!---Display the Material Grid--->
<cfgrid name="gridMaterial" format="flash" query="Materials"
selectmode="single" width="825" height="300">
<cfgridcolumn name="MCN"
width="100"
header="MCN">
<cfgridcolumn name="Rev"
width="50"
header="Rev">
<cfgridcolumn name="procurement_document"
header="Proc. Doc"
width="120">
<cfgridcolumn name="Description"
header="Description">
<cfgridcolumn name="material_description"
header="Mat'l Description">
</cfgrid>
</cfformgroup>
</cfformgroup>

<!--- 2nd Label on tab navigation--->
<cfformgroup type="page" label="Hardware Search">

<!---box to seperate the input boxes from the buttons--->
<cfformgroup type="hdividedbox" >

<!--- Group the Hardware input boxes, aligned vertically. --->
<cfformgroup type="VBox" style="fontSize:12; fontStyle:normal;
height:auto">
<cfformgroup type="vertical" height="80">

<!--- Group the Hardware input boxes, aligned vertically. --->
<cfformgroup type="VBox" style="fontSize:12; fontStyle:normal;
height:auto">
<cfformgroup type="vertical" height="80">
<cfinput type="text" name="part_number" label="Part Number"
width="100"/>
<cfinput type="text" name="ProDoc" label="Procurement Document"
width="400"/>
<cfinput type="text" name="Desc" label="Description" width="300"/>
<cfinput type="text" name="MatDesc" label="Mat'l Description"
width="300"/>
</cfformgroup>
</cfformgroup>
</cfformgroup>
</cfformgroup>

<!--- Group the Hardware buttons, aligned vertically. --->
<cfformgroup type="VBox" height="150">
<cfformgroup type="tile" height="80" width="100" label="Tile box">
<cfinput type = "submit" name="submit1" width="100" value = "Search">
<cfinput type = "button" name="reset1" width="100" value = "Reset Fields"
onclick="part_number.text='*'; ProDoc.text='*'; Desc.text='*';
MatDesc.text='*'">
</cfformgroup>
</cfformgroup>
</cfformgroup>

<!--- Horizontal rule styles specify the rule characteristics. --->
<cfformitem type="hrule" style="color:##999900; shadowColor:##DDDD66;
Re: Tab Navigation with Flash Forms/CFGrid apleonard
4/5/2005 11:06:48 AM
To do this I set a boolean variable as TRUE if a form has been submitted...

<cfset formsubmitted = (form.myParameter neq "")>

I then set the selectedIndex attribute on the cfformgroup tag (the one that
that defines the tabnavigator group) programmatically on the server (using the
CF function iif) as follows...

<cfform format="flash">
<cfformgroup type="tabnavigator" selectedindex="#iif(formsubmitted, de('1'),
de('0'))#">
etc...
</cfformgroup>
</cfform>

AddThis Social Bookmark Button