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

Data grid Issues

Explorer ,
Feb 18, 2010 Feb 18, 2010

Error Message is:  Only one of the attributes bind or query may be specified on a cfgrid of format HTML.

I am getting an error based off of this code:

cfc

-------------------------

<cfcomponent hint="Pulls and Manipulation" output="false">

<cfset dsn = "pmgps">

<cffunction name="getAllRecords" hint="Get All records for Display" returntype="Struct" access="remote" >
<!--- Arguments --->
  <cfargument name="page" type="numeric" required="yes" default="5">
        <cfargument name="pageSize" type="numeric" required="yes" default="5">
        <cfargument name="gridsortcolumn" type="string" required="no" default="">
        <cfargument name="gridsortdir" type="string" required="no" default="">
<!--- Arguments. --->
<!--- Local Variables.--->
  <cfset var getAllRecords="">
<!--- Local variables --->
       
  <cfquery name="getAllRecords" datasource="#dsn#" dbtype="ODBC">
   select *
   from  reporting.v_aarReports
   <cfif ARGUMENTS.gridsortcolumn NEQ ""
            and ARGUMENTS.gridsortdir NEQ "">
            ORDER BY #ARGUMENTS.gridsortcolumn# #ARGUMENTS.gridsortdir#
        </cfif>
  </cfquery>
  <cfreturn QueryConvertForGrid(getAllRecords, ARGUMENTS.page, ARGUMENTS.pageSize)>
</cffunction>
</cfcomponent>

-------------------------

cfm FILE

-------------------------

<!---Data Calls--->
<cfinvoke component="components.data" method="getAllRecords" returnvariable="getAllVar"/>
<cfparam name="postback" default="0" type="numeric">
<cfinclude template="../../style.css">
<!---Data Calls--->

<div align=center>
<cfform name="reportingGrid" preloader="false">
  <cfgrid name="getReport" query="getAllVar" pagesize="5"  striperows="true" format="html"
        bind="cfc:components.data.getAllRecords({cfgridpage},
                                                {cfgridpagesize},
                                                {cfgridsortcolumn},
                                                {cfgridsortdirection})">
   <cfgridcolumn name="item" header="Item Number">
   <cfgridcolumn name="assigned" header="Assigned">
   <cfgridcolumn name="dueDate" header="Due">
   <cfgridcolumn name="meetingDate" header="Meeting">
   <cfgridcolumn name="description" header="Description">
   <cfgridcolumn name="status" header="Status">
  </cfgrid>

</cfform>
</div>

-------------------------

547
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 ,
Feb 18, 2010 Feb 18, 2010

The error message is very clear as to what the problem is. Did you

read it? What does it say? What do you think it might mean?

--

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
Explorer ,
Feb 18, 2010 Feb 18, 2010

If I knew I would not have posted this. Whats up

with the derrogatory questioning from you anyway? Did I make a mistake posting here.

I will make sure to contact Adobe and see if thewre was something wrong with the question and hopefully learn from that. BUT in the mean time please do NOT pretend that you are a master teacher because your approch is not appreciated at all.

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 ,
Feb 18, 2010 Feb 18, 2010

Don't get stroppy with me: I'm trying to encourage you to investigate the issue yourself.  Using principles like reading error messages thoroughly and pausing to think what the error message might be saying is a good way to become more self-sufficient with troubleshooting your issues in future.  Like it or not, the problem you are currently having is well described in the error message.

What does this - the error message - say:

Only one of the attributes bind or query may be specified on a cfgrid of format HTML.

And what does this - your code - say:

<cfgrid name="getReport" query="getAllVar" pagesize="5"  striperows="true" format="html"
        bind="cfc:components.data.getAllRecords({cfgridpage},
                                                {cfgridpagesize},
                                                {cfgridsortcolumn},
                                                {cfgridsortdirection})">

The error message says you can have either BIND or QUERY, but not both.  In your code, you have both.  You cannot have both.  Does this make sense?

Have you read over the docs for <cfgrid>?

http://livedocs.adobe.com/coldfusion/8/htmldocs/Tags_g-h_03.html#3987012

There are some examples there...

--

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
Explorer ,
Feb 18, 2010 Feb 18, 2010

Sir,

I will assure you that I research and continue study on a regular basis. You are not my mother or employer so as far as your continued derogatory statement as to what I will or will not do is falling on VERY deaf ears. You might consider being a little more eloquent with your aggressive condescending responses.

Try a good book like Dale Carnegie’s "How to win friends and influence people"

It may be a very good resource for you to develop your social demur.

Have a great day!

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 ,
Feb 18, 2010 Feb 18, 2010

I think you should reread the posts on this thread and perhaps reconsider which of the two of us need an attitude adjustment, mate.

You're not going to get very far if you jump down the throat of anyone who tries to help you.

If you dispense with your defensive attitude for a moment, you'd realise my first post pointed you in the right direction to work it out for yourself.  Reading (and my implication, understanding ~) an error message, and considering what it might be trying to tell you is absolutely fundamentally key to troubleshooting on-screen errors.  You seem reasonably articulate so I presume you have a good understanding of English, so my feeling was that perhaps you hadn't really gone over the error message, because it is telling you exactly what your problem is, and in unambiguous terms.  Do you not agree with that assertion?  To suggesting you review the error message again is good advice.

My second post made another attempt at simplifying it even further for you (by pretty much spelling it out... highlighting the relevant bits even).

However instead of reading what was in front of you (hmmm... that sounds strangely familiar...), you decided to find an objectionable tone where there simply wasn't one.

Did you actually look at what I pointed out / suggested, and did you get your grid working?  If you didn't get it working, have you moved any further ahead with it, or are you still stuck in the same spot?  I think it would  be entirely reasonable of me to think "why am I bothering?" and go look for someone else's problem to look in to. But I guess I like a challenge, so I'll stick with you, if need be.

I'm sorry but I will never simply dish out answers to people's questions here because that doesn't really help in the long run.  I apply a sort of socratic-method-esque (to "big it up" a bit) to my approach: try to prompt the person to consider how they might solve the issue for themselves.  In that way they not only get the problem sorted, but they've had an exercise in problem solving, and hopefully learn a bit along the way.  It's the old give a man a fish / teach a man to fish scenario.

So... shall we start again...  what does the error message tell you?

--

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
Advocate ,
Feb 18, 2010 Feb 18, 2010
LATEST

Genos_Free: the thing about public user-to-user forums is that you will not get the answer you want, but you get the answer other people think you need.

So I suggest you try his suggestion and then mark Adam's second response as the correct answer.

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