Yes, all my values were null, and for some reason one of the values passed
showed more null values than what should have been there. So I changed all the
variable names used in cfgrid tag. Now I don't get any error messages, but I
don't get anything at all. Its just an empty grid. I ran the query in mysql
directly with the values passed from the form, and I get 388 rows returned. I
ran the page with query attribute in cfgrid instead of bind attribute and I get
the right result (except that my header is all screwed up, but I will deal with
it later.). But I don't get any result back with bind attribute, and no errors
in the logs or in the AJAX debug window. I don't even see the query execution
in regular cfdebug output either (but i guess thats because of the way bind
calls my query).
I have attached my code for both the query function and the display function.
Please take a look and tell what is it that I am doing wrong. I don't see
anything wrong.
-------------------------------------------
code for query
============================
<cffunction name="get2" access="remote" returntype="struct" hint="Query
database based on user input">
<cfargument name="lib_id" type="numeric" default="0" required="false">
<cfargument name="e_val" type="numeric" default="0.009999"
required="false">
<cfargument name="b_db" type="string" default=""
required="false">
<cfargument name="seq_name" type="string" default="" required="false">
<cfargument name="seq_desc" type="string" default=""
required="false">
<cfargument name="organism" type="string" default=""
required="false">
<cfargument name="page" type="numeric" required="yes">
<cfargument name="pageSize" type="numeric" required="yes">
<cfargument name="gridsortcolumn" type="string" required="no"
default="">
<cfargument name="gridsortdir" type="string" required="no" default="">
<cfset dbLen = listLen(b_db)>
<cfset orCount = 0>
<cfquery name="q" datasource="#application.dsn#">
SELECT distinct
s.sequenceName,
s.sequenceId,
s.sequenceLen,
b.blastDb,
h.hitDef,
h.hitAccession,
h.hitIdentification,
hs.hspEvalue,
(hs.hspPositive/hs.hspAlignLen)*100 as
'perPositive',
(hs.hspIdentity/hs.hspAlignLen)*100 as
'perIdentity',
hs.hspAlignLen,
hs.hspBitScore
FROM library l
inner join
sequenceInfo s on l.libraryId =
s.libraryId
inner join
blast b on s.sequenceId = b.sequenceId
inner join
hit h on b.blastId = h.blastId
inner join
hsp hs on h.hitId = hs.hitId
WHERE hs.hspEvalue <= #e_val#
and b.orf = 0
and s.deleted = 0
and hs.tophitFlag = 1
<cfif libraryId>
and l.libraryId = #lib_id#
</cfif>
<cfif blastDb.length()>
and (
<cfloop index="idx" list="#b_db#">
<cfset orCount = orCount + 1>
b.blastDb = <cfqueryparam
cfsqltype="cf_sql_varchar" value="#idx#">
<cfif orCount lt dbLen>or</cfif>
</cfloop>
)
</cfif>
<cfif seq_desc.length()>
and h.hitDef like '%#seq_desc#%'
</cfif>
<cfif seq_name.length()>
and s.sequenceName like '%#seq_name#%'
</cfif>
<cfif ARGUMENTS.gridsortcolumn NEQ ""
and ARGUMENTS.gridsortdir NEQ "">
ORDER BY #ARGUMENTS.gridsortcolumn#
#ARGUMENTS.gridsortdir#
</cfif>
</cfquery>
<cfreturn QueryConvertForGrid(q,
ARGUMENTS.page,
ARGUMENTS.pageSize)>
</cffunction>
============================================
code for display function..
====================================
<cffunction name="displaySearchResult" returntype="string" hint="Display Basic
search result">
<cfargument name="lib_id" type="numeric" default="0"
required="false">
<cfargument name="e_val" type="numeric" default="0.009999"
required="false">
<cfargument name="b_db" type="string" default=""
required="false">
<cfargument name="seq_name" type="string" default=""
required="false">
<cfargument name="seq_desc" type="string" default=""
required="false">
<cfargument name="organism" type="string" default=""
required="false">
<cfoutput>
<div class="main_body">
<cfform>
<cfgrid format="html"
width="1024"
pageSize="35"
name="sResult"
colheaderbold="yes"
bind="cfc:search.get2({lib_id},
{e_val},
{b_db},
{seq_name},
{seq_desc},
(organism},
{cfgridpage},
{cfgridpagesize},
{cfgridsortcolumn},
{cfgridsortdirection})"
height="500" striperows="yes"
striperowcolor="##EEEEE6">
<cfgridcolumn name="sequenceName" header="Seq. Name">
<cfgridcolumn name="sequenceId" header="Seq. Id">
<cfgridcolumn name="sequenceLen" header="Seq. Len">
<cfgridcolumn name="blastDb" header="Blast DB">
<cfgridcolumn name="hitDef" header="Hit Def">
<cfgridcolumn name="hitAccession" header="Hit
Accession">
<cfgridcolumn name="hitIdentification" header="Hit
Identity">
<cfgridcolumn name="hspEvalue" header="Evalue">
<cfgridcolumn name="perPositive" header="Positive">
<cfgridcolumn name="perIdentity" header="Identity">
<cfgridcolumn
name="hspAlignLen" header="Match Len">
<cfgridcolumn name="hspBitScore" header="Bit Score">
</cfgrid>
</cfform>
</div>
</cfoutput>
<cfreturn "">
</cffunction>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Get the answers you are looking for on the ColdFusion Labs
Forum direct from active programmers and developers.
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:287098
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4