Skip to main content
Inspiring
September 28, 2013
Question

refresh cfquery

  • September 28, 2013
  • 1 reply
  • 1265 views

I have followign code to have my dropdown list, it seems that it does not refresh the list until re start the application.

I have a create new button beside the list to let user create new records if it does not exsit.

The create new record works, but the list does not refresh until next time to restart application.

I would like to know is it possible to refresh cfquery on the select control when user add new record.

Your help and information is great appreciated,

Regards,

Iccsi,

<select name="Mylst" id="Mylst" >

   <cfoutput query="MySP">

         <option value="#MySP.MyID#"

          <cfif (isDefined("form.MyID") AND form.MyID EQ MySP.MyID) 

>selected="selected"</cfif>>#MySP.MyName#</option>

       

       </cfoutput>

      

  </select>

    This topic has been closed for replies.

    1 reply

    Participating Frequently
    September 28, 2013

    It sounds like your have caching turned on in your query.  Can you please post your query code for the query "MySP"? You can either re-trigger the query to refresh it after you modify/create a record in that table or remove the caching setting from the query.

    iccsiAuthor
    Inspiring
    September 28, 2013

    <cfstoredproc procedure="Mystoredprocedure" datasource="mydb">

    <cfprocresult name="MySP" resultset="1">

    </cfstoredproc>

    I use MS SQL stored procedure and cfstoredproc for my select list data source.

    does caching setting at server side or client side?

    I think that I need refresh drop down list query,

    Thanks again for helping,

    Regards,

    Iccsi,

    Participating Frequently
    September 28, 2013

    If there is no query caching turned on then maybe the issue is your page flow.  Unless you have caching turn on the database server somehow via the stored procedure?