Skip to main content
Participant
September 21, 2010
Question

CFGRID not displaying data from query

  • September 21, 2010
  • 3 replies
  • 2365 views

Hello,

I have a very simple query, which is being used to populate cfgrid. The headers and paging display, the grid behaves as if it's laoding data, but never does. I've run the query in the background and it returns 4 rows.The CFC calling the query simpy takes in the parameters and returns the query.

The code is as follows:

<cfgrid bind="cfc:#request.ictcomponent_path#.getSystemMessages({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection},'#session.dsn#', '#variables.userId#','#variables.service_id#','#adminAccess#')" selectcolor="##0066CB" selectonload="false" striperows="yes" striperowcolor="##efefef" pagesize="#pagesize#" colHeaderBold="no" selectmode="row" format="html" name="boxes" autowidth="no" rowheaders="no">
               <cfgridcolumn name="id" header="ID" display="no" width="0">
                        <cfgridcolumn name="title" header="Title" width="125">
                        <cfgridcolumn name="message" header="Message" width="200">
                        <cfgridcolumn name="valid_from" header="Valid From" width="120">
                        <cfgridcolumn name="valid_to" header="Valid To" width="120">
                        <cfgridcolumn name="SEND_TO_ALL_USERS" header="Recipients" width="90">
                        <cfif adminAccess EQ "True"><cfgridcolumn name="removed_date" header="Removed Date" width="125"></cfif>                  

</cfgrid>

There seems to be a javascript error on the page, which says Exception thrown but not caught, could this be the cause of the problem?

Thanks.

    This topic has been closed for replies.

    3 replies

    BKBK
    Community Expert
    Community Expert
    October 2, 2010
    bind="cfc:#request.ictcomponent_path#.getSystemMessages({cfgridpage}, {cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection},'#session.ds n#', '#variables.userId#','#variables.service_id#','#adminAccess#')"

    You may not pass strings in a bind like that. You have to fool Coldfusion a little.

    My favourite way is to pass variables as hidden form fields. First, store the values as follows:

    <!--- variables to be passed when invoking cfc --->
    <cfinput name="session_dsn"  value="#session.dsn#"               type="hidden">
    <cfinput name="userId"               value="#variables.userId#"        type="hidden">
    <cfinput name="service_id"        value="#variables.service_id#" type="hidden">
    <cfinput name="adminAccess" value="#adminAccess#"            type="hidden">

    Then replace your list

    '#session.dsn#', '#variables.userId#','#variables.service_id#','#adminAccess#'

    with the list

    {session_dsn}, {userId}, {service_id}, {adminAccess}

    October 1, 2010

    It might be happening if you have a application.cfc file.

    From livedocs:

    Do not implement the onRequest method in any  Application.cfc file that affects .cfc files that implement web  services, process Flash Remoting or event gateway requests; ColdFusion  will not execute the requests if you implement this method.

    I hope this helps..

    Inspiring
    October 1, 2010

    This was "fixed" in CF9 with the onCfcRequest() event handler. CFC requests run fire that one instead of onRequest().

    --

    Adam

    Inspiring
    October 1, 2010

    Try appending ?cfdebug=1 or &cfdebug=1 to the end of the URL and hopefully it will give you more information.