Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CFGRID not displaying data from query

New Here ,
Sep 21, 2010 Sep 21, 2010

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.

2.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 01, 2010 Oct 01, 2010

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 01, 2010 Oct 01, 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..

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 01, 2010 Oct 01, 2010

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

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 02, 2010 Oct 02, 2010
LATEST
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}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources