tracker issue : CF-3040959

select a category, or use search below
(searches all categories and all time range)
Title:

Bug 82143:Using cfgridsortcolumn and cfgridsortdirection in the ORDER BY SQL statement will cause the HTML CFGRID to not display query results

| View in Tracker

Status/Resolution/Reason: Closed/Won't Fix/

Reporter/Name(from Bugbase): Ron Lebfrom / Ron Lebfrom (Ronsweb)

Created: 02/18/2010

Components: AJAX, UI Components

Versions: 9.0

Failure Type: Unspecified

Found In Build/Fixed In Build: 0000 /

Priority/Frequency: Normal / Unknown

Locale/System: English / Platforms All

Vote Count: 0

Problem:

Using  cfgridsortcolumn and cfgridsortdirection in the ORDER BY SQL statement will cause the HTML CFGRID to not display query results.  the following will break the CFGRID:            <cfif arguments.cfgridsortcolumn is not "" or arguments.cfgridsortdirection is not "">                   order by #arguments.cfgridsortcolumn# #arguments.cfgridsortdirection#            </cfif>          <cfquery datasource="CMS" name="qallusers">            SELECT  userID, firstname,lastname, disable, group_ID, email, username            FROM    login            <cfif arguments.filtercriteria is not "" and variables.filterGroupID eq 0>            WHERE   LastName LIKE <cfqueryparam value="#arguments.filtercriteria#%" cfsqltype="CF_SQL_VARCHAR">                        <cfelseif arguments.filtercriteria is not "" and variables.filterGroupID neq 0>            WHERE   LastName LIKE <cfqueryparam value="#arguments.filtercriteria#%" cfsqltype="CF_SQL_VARCHAR">              AND   group_ID = <cfqueryparam value="#variables.filterGroupID#" cfsqltype="CF_SQL_NUMERIC">           <cfelseif arguments.filtercriteria is  "" and variables.filterGroupID neq 0>            WHERE    group_ID = <cfqueryparam value="#variables.filterGroupID#" cfsqltype="CF_SQL_NUMERIC">                      </cfif>                        <cfif arguments.cfgridsortcolumn is not "" or arguments.cfgridsortdirection is not "">                   order by #arguments.cfgridsortcolumn# #arguments.cfgridsortdirection#            </cfif>           </cfquery>  Here is another person having the same problem.http://www.coldfusionjedi.com/forums/messages.cfm?threadid=A300803D-04CE-FC3D-3C8AA9F90ACA76B8
Method:

Grid:--------------------------------------------------------------<cfset args = structNew()><cfset args.name = "WebAuthorGrid"> <cfset args.format = "html"> <cfset args.width = 360> <cfset args.height = 340><!--- <cfset args.query = "qAllusersRET"> ---><cfset args.stripeRows = true><cfset args.bold = true><cfset args.textColor = "##000000">      <cfset args.textColor = "##000000">      <cfset args.selectColor = "##00ccff"><cfset args.selectmode = "row"><cfset args.pagesize = 13>  <cfform name="userdisplay">     <cfoutput><input type="hidden" name="site_ID" value="#URL.site_ID#" / ></cfoutput>   <div style="float:left;width:360px;">    <div style="background-image:url(http://www.lbcc.edu/images/headbackground.jpg); width:100%;height:30px;"><div style="float:right;"><span class="textyellow">Web Author Lastname&nbsp;<cfinput type="text" name="filtercriteria" onKeyUp="GetUser();" typeahead="no" showautosuggestloadingicon="false" ></span> </div></div>    <div>              <cfgrid attributeCollection="#args#" onchange="AddWebAuthor();" bind="cfc:CMS.cmsadmin.components.usermanagement.qAllWebauthors({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection},{filtercriteria})">    <cfgridcolumn name="userID" display="false">          <cfgridcolumn name="firstname" header="First Name">          <cfgridcolumn name="lastname" header="Last Name">          <cfgridcolumn name="email" header="Email" headeralign="left" dataalign="left" width="157" bold="no" italic="no" select="no" display="yes" headerbold="no" headeritalic="no">         </cfgrid>    </div>    <div>  </cfform>  CFC:------------------------------------------------------  <cffunction access="Remote" name="qAllWebauthors" returntype="any" output="false">      <cfargument name="cfgridpage" required="no">      <cfargument name="cfgridpagesize" required="no">      <cfargument name="cfgridsortcolumn" required="yes"  default="">      <cfargument name="cfgridsortdirection" required="yes"  default="">            <cfargument name="filtercriteria" required="no" default="">        <cfquery datasource="CMS" name="qallusers">            SELECT  userID, firstname,lastname, disable, group_ID, email, username            FROM    login            <cfif arguments.filtercriteria is not "">            WHERE   LastName LIKE <cfqueryparam value="#arguments.filtercriteria#%" cfsqltype="CF_SQL_VARCHAR">                        </cfif>                    <cfif arguments.cfgridsortcolumn is not "" or arguments.cfgridsortdirection is not "">                   order by #arguments.cfgridsortcolumn# #arguments.cfgridsortdirection#            </cfif>                </cfquery>                <cfreturn QueryConvertForGrid(qallusers, cfgridpage, cfgridpagesize)> </cffunction>  
Result:

Using  cfgridsortcolumn and cfgridsortdirection in the ORDER BY SQL statement will cause the HTML CFGRID to not display query results.  the following will break the CFGRID:            <cfif arguments.cfgridsortcolumn is not "" or arguments.cfgridsortdirection is not "">                   order by #arguments.cfgridsortcolumn# #arguments.cfgridsortdirection#            </cfif>          <cfquery datasource="CMS" name="qallusers">            SELECT  userID, firstname,lastname, disable, group_ID, email, username            FROM    login            <cfif arguments.filtercriteria is not "" and variables.filterGroupID eq 0>            WHERE   LastName LIKE <cfqueryparam value="#arguments.filtercriteria#%" cfsqltype="CF_SQL_VARCHAR">                        <cfelseif arguments.filtercriteria is not "" and variables.filterGroupID neq 0>            WHERE   LastName LIKE <cfqueryparam value="#arguments.filtercriteria#%" cfsqltype="CF_SQL_VARCHAR">              AND   group_ID = <cfqueryparam value="#variables.filterGroupID#" cfsqltype="CF_SQL_NUMERIC">           <cfelseif arguments.filtercriteria is  "" and variables.filterGroupID neq 0>            WHERE    group_ID = <cfqueryparam value="#variables.filterGroupID#" cfsqltype="CF_SQL_NUMERIC">                      </cfif>                        <cfif arguments.cfgridsortcolumn is not "" or arguments.cfgridsortdirection is not "">                   order by #arguments.cfgridsortcolumn# #arguments.cfgridsortdirection#            </cfif>           </cfquery>

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3040959

External Customer Info:
External Company:  
External Customer Name: Ron Lebfrom
External Customer Email: 133907D4446362FF99201549
External Test Config: 02/18/2010

Attachments:

Comments: