Display search results from Flash Form to CFGrid

Ask a Question related to Coldfusion Flash Integration, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. 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...
    4. 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...
    5. 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...
  3. #2

    Default 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

  4. #3

    Default 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

  5. #4

    Default 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

  6. #5

    Default 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

  7. #6

    Default 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

  8. #7

    Default 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

  9. #8

    Default 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

  10. #9

    Default 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

  11. #10

    Default 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

  12. #11

    Default 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

  13. #12

    Default Re: Display search results from Flash Form to CFGrid

    Could you explain that to me please? The empty query that is....
    dpinder123 Guest

  14. #13

    Default Re: Display search results from Flash Form to CFGrid

    <CFSET temp = QueryAddRow(searchOrders, 1)>
    ptoretti Guest

  15. #14

    Default 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

  16. #15

    Default 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

  17. #16

    Default 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

  18. #17

    Default 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

  19. #18

    Default Re: Display search results from Flash Form to CFGrid

    You left off the query name from the <cfgrid>
    ptoretti Guest

  20. #19

    Default Re: Display search results from Flash Form to CFGrid

    THANK YOU!


    dpinder123 Guest

  21. #20

    Default Re: Display search results from Flash Form to CFGrid

    Thanks Paul, I appreciate it!
    dpinder123 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139