Ask a Question related to Coldfusion Flash Integration, Design and Development.
-
dpinder123 #1
Display search results from Flash Form to CFGrid
Yet another CF flash form question:
I'm not sure if this is possible, but, I would like to display search results
using flash forms and display the results in a grid. Is that possible? I would
think so.....
Code attached.
<!--- Search: search for order --->
<cfif IsDefined ("FORM.searchBTN")>
<cfgridupdate grid="searchGrid" datasource="User" tablename="dbo.mortgageLog"
keyonly="yes">
<!---search QUERY--->
<cfquery name="searchOrders" datasource="User">
SELECT
fileNumber,
fileName
FROM dbo.mortgageLog
WHERE fileName LIKE '%#FORM.fileName#%'
ORDER BY fileNumber
</cfquery>
<!---end of Search--->
</cfif>
<cfform action="untitled2.cfm" format="flash">
<cfinput type="text" name="fileNameSearch" label="File Name" width="200">
<cfinput type="button" name="searchBTN" value="search" id="Search">
<cfformgroup type="panel" label="Results">
<cfgrid name = "searchGrid" rowheaders="false" height="120" width="700"
align="top">
<cfgridcolumn name="fileNumber" header="File Number" width="100">
<cfgridcolumn name="fileName" header="File Name">
</cfgrid>
</cfformgroup>
<!---end of fourth tab--->
</cfform>
dpinder123 Guest
-
CFGrid in Flash Form
I'm trying to display my data in a flash form in 2 rows, The first row to display the currenty month follow by the day 1-31. The second row is to... -
Cfgrid to display search results
I'm using Cfform format = flash. I have 2 search fields, and a button. When a user enters their search query, and hit submit, I want to populate my... -
cfgrid-flash- search
I would like to have 3 possible search fields that on submit it will search the database and display the results in the cfgrid in flash format. Is... -
flash form cfgrid
Hi, I'm using a flash form with a cfgrid. I can insert a grid by doing GridData.insertRow(mygrid); , but I want to insert specific data in that... -
Search and display in same form
Anon wrote: Not a particularly unusual feature in a comprehensive application. If there are only a few data fields, you could use the data... -
ptoretti #2
Re: Display search results from Flash Form to CFGrid
I think this will do what you want.
<cfgrid name = "searchGrid" query="searchOrders" rowheaders="false" height="120" width="700" align="top">
ptoretti Guest
-
dpinder123 #3
Re: Display search results from Flash Form to CFGrid
tried that, i get this error:
Attribute validation error for tag CFGrid.
The value of the attribute Query, which is currently "searchOrders", is
invalid.
The error occurred in C:\Inetpub\wwwroot\intranet\untitled2.cfm: line 25
23 :
24 : <cfformgroup type="panel" label="Results">
25 : <cfgrid name = "searchGrid" rowheaders="false" query="searchOrders"
height="120" width="700" align="top">
26 : <cfgridcolumn name="fileNumber" header="File Number" width="100">
27 : <cfgridcolumn name="fileName" header="File Name">
dpinder123 Guest
-
PaulH #4
Re: Display search results from Flash Form to CFGrid
if this is all the code, build an empty query to stuff into the cfgrid when you
first enter the form or put the cfgrid into the "searchBTN" logic. you're
simply trying to display a query that doesn't (yet) exist.
PaulH Guest
-
dpinder123 #5
Re: Display search results from Flash Form to CFGrid
I thought that's what I was doing:
When searchBTN is clicked, the query is executed. I've used this method with an Insert form.....am I missing something when it comes to searching?
dpinder123 Guest
-
PaulH #6
Re: Display search results from Flash Form to CFGrid
the cfif block that does the update also creates the cfquery that you use in your cfgrid (as ptoretti suggested). first time into the form that query doesn't exist.
PaulH Guest
-
dpinder123 #7
Re: Display search results from Flash Form to CFGrid
Ok, color me stupid, but, if I'm understanding you correctly, this should work
by my nesting everything in the if block......right? Well, I did that and now,
the page wont display the flash form.
Note that this problem doesnt happen when I'm using a regular form, just a
flash form.
<!--- Search: search for order --->
<cfif IsDefined ("FORM.searchBTN")>
<!---search QUERY--->
<cfquery name="searchOrders" datasource="User">
SELECT
fileNumber,
fileName
FROM dbo.mortgageLog
WHERE fileName LIKE '%#FORM.fileNameSearch#%'
ORDER BY fileNumber
</cfquery>
<!---end of Search--->
<cfform action="untitled2.cfm" format="flash">
<cfinput type="text" name="fileNameSearch" label="File Name" width="200">
<cfinput type="button" name="searchBTN" value="search" id="Search">
<cfformgroup type="panel" label="Results">
<cfgrid name = "searchGrid" rowheaders="false" height="120" width="700"
align="top">
<cfgridcolumn name="fileNumber" header="File Number" width="100">
<cfgridcolumn name="fileName" header="File Name">
</cfgrid>
</cfformgroup>
<!---end of fourth tab--->
</cfform>
</cfif>
dpinder123 Guest
-
ptoretti #8
Re: Display search results from Flash Form to CFGrid
Don't nest the whole form. If you do that, you'll never see it! Just nest the
<CFGRID>. I'd do it with 2 if's so that you can keep your query visually
outside of the form. Of course, this is minimally less efficient, but to my
mind it is clearer.
<!--- Search: search for order --->
<cfif IsDefined ("FORM.searchBTN")>
<!---search QUERY--->
<cfquery name="searchOrders" datasource="User">
SELECT
fileNumber,
fileName
FROM dbo.mortgageLog
WHERE fileName LIKE '%#FORM.fileNameSearch#%'
ORDER BY fileNumber
</cfquery>
<!---end of Search--->
</cfif>
<cfform action="untitled2.cfm" format="flash">
<cfinput type="text" name="fileNameSearch" label="File Name" width="200">
<cfinput type="button" name="searchBTN" value="search" id="Search">
<cfformgroup type="panel" label="Results">
<cfif IsDefined ("FORM.searchBTN")>
<cfgrid name = "searchGrid" rowheaders="false" height="120" width="700"
align="top">
<cfgridcolumn name="fileNumber" header="File Number" width="100">
<cfgridcolumn name="fileName" header="File Name">
</cfgrid>
</cfif>
</cfformgroup>
<!---end of fourth tab--->
</cfform>
</cfif>
ptoretti Guest
-
PaulH #9
Re: Display search results from Flash Form to CFGrid
or simply build a dummy query to fill in when you first enter the form...
PaulH Guest
-
dpinder123 #10
Re: Display search results from Flash Form to CFGrid
a dummy query? do you mean populating the grid with say "ID" but not displaying it when the page loads?
I dont understand how that would help me out.......
dpinder123 Guest
-
dpinder123 #11
Re: Display search results from Flash Form to CFGrid
Tried it, it just sits there.....
I thought it would work though.....makes sense......
dpinder123 Guest
-
dpinder123 #12
Re: Display search results from Flash Form to CFGrid
Could you explain that to me please? The empty query that is....
dpinder123 Guest
-
ptoretti #13
Re: Display search results from Flash Form to CFGrid
<CFSET temp = QueryAddRow(searchOrders, 1)>
ptoretti Guest
-
PaulH #14
Re: Display search results from Flash Form to CFGrid
i actually had somethng like this in mind. but i expect you're leaving
something out of all this. what's the logic flow for this? are you experiencing
this the first time into the page? are you submitting the form? are you trying
some flash remoting?
<cfparam name="searchOrders" type="query"
default="#queryNew('fileName,fileNumber')#">
PaulH Guest
-
dpinder123 #15
Re: Display search results from Flash Form to CFGrid
Nothing out of the ordinary (at least, I didnt think so):
User inputs a file name to search
Click submit
The form submits to itself
The results are displayed in a flash grid
dpinder123 Guest
-
PaulH #16
Re: Display search results from Flash Form to CFGrid
then you need a dummy query or some logic to handle the fact that there is no query the first time into the form.
PaulH Guest
-
dpinder123 #17
Re: Display search results from Flash Form to CFGrid
I added the empty query code at the top. The search results still arent
popuating into the grid.
I am losing my mind! :confused;
<cfparam name="searchOrders" type="query"
default="#queryNew('fileNumber,fileName')#">
<!--- Search: search for order --->
<cfif IsDefined ("FORM.searchBTN")>
<!---search QUERY--->
<cfquery name="searchOrders" datasource="User">
SELECT
fileNumber,
fileName
FROM dbo.mortgageLog
WHERE fileName LIKE '%#FORM.fileNameSearch#%'
ORDER BY fileNumber
</cfquery>
<!---end of Search--->
</cfif>
<cfform action="untitled2.cfm" format="flash">
<cfinput type="text" name="fileNameSearch" label="File Name" width="200">
<cfinput type="submit" name="searchBTN" value="search" >
<cfformgroup type="panel" label="Results">
<cfif IsDefined ("FORM.searchBTN")>
<cfgrid name = "searchGrid" rowheaders="false" height="120" width="700"
align="top">
<cfgridcolumn name="fileNumber" header="File Number" width="100">
<cfgridcolumn name="fileName" header="File Name">
</cfgrid>
</cfif>
</cfformgroup>
</cfform>
dpinder123 Guest
-
ptoretti #18
Re: Display search results from Flash Form to CFGrid
You left off the query name from the <cfgrid>
ptoretti Guest
-
-
dpinder123 #20
Re: Display search results from Flash Form to CFGrid
Thanks Paul, I appreciate it!
dpinder123 Guest



Reply With Quote

