Solved

the pagesize argument passed to the myposts function is not of type Coldfusion Ajax

Posted on 2008-10-30
5
311 Views
Last Modified: 2014-05-22
Hai experts

I'm getting this error

the pagesize argument passed to the myposts function is not of type
numeric

following my code

--employer.cfc--

<cffunction name="myposts"
 hint="My Posts" returntype="any" access="remote">
 <cfargument name="mysession" type="string" required="yes">
 <cfargument name="page" type="numeric" required="yes" default="1">
 <cfargument name="pageSize" type="numeric" required="yes" default="40">
 <cfargument name="gridsortcolumn" type="string" required="no" default="">
 <cfargument name="gridsortdirection" type="string" required="no" default="">
 <cfset var myposts="">


 <cfquery name="myposts" datasource="nizar">
select a.job_id,a.job_name,b.job_category_name,c.country_name,
a.job_role,a.job_requirements
from job_posts a,job_category b,countries c
where a.JOB_CATEGORY_ID=b.JOB_CATEGORY_ID
and a.COUNTRY_ID=c.COUNTRY_ID
and a.user_id='#arguments.mysession#'
order by created_date desc
 </cfquery>
 
<cfreturn QueryConvertForGrid(myposts,arguments.page,arguments.pageSize)>
 
 </cffunction>
 
--employer_posts.cfm--

<cfinvoke
 component="Employers.employer"
 method="myposts"
 returnvariable="myposts">
      <cfinvokeargument name="mysession" value="#session.user_id#"/>
</cfinvoke>

  <cfform>
  <cfgrid name="getlist" format="html" bind="cfc:Employers.employer.myposts({cfgridpage}, {cfgridpagesize}, {cfgridsortcolumn}, {cfgridsortdirection})">
  <cfgridcolumn name="job_id" header="Job ID" width="100"/>
  <cfgridcolumn name="Job_name" header="Job Name" width="100"/>
  <cfgridcolumn name="job_category_name" header="Job Category" width="100"/>
  <cfgridcolumn name="country_name" header="Country" width="100"/>


  </cfgrid>
  </cfform>
       
       


0
Comment
Question by:faizershez
  • 2
5 Comments
 
LVL 27

Accepted Solution

by:
azadisaryev earned 500 total points
ID: 22840018
your myposts function requires 3 arguments: mySession, page & pageSize (they are set with required="yes" attribute, so you MUST pass these arguments to the function). but in your <cfinvoke> you are passing only ONE argument to it.

DEFAULT attribute of <cfargument> tag has no effect when an argument is set as required

but the bigger question is: why do you need that <cfinvoke> there at all???
0
 
LVL 1

Expert Comment

by:coderWil
ID: 22843098
Your CFINVOKE is passing a the pagesort value to the pagesize value.

since 3 of your function arguments are required, you need to pass them 'in the order they are declared' to the function.

Hope this helps.
0
 
LVL 27

Assisted Solution

by:azadisaryev
azadisaryev earned 500 total points
ID: 22843170
change your cfgrid's bind attribute to:

bind="cfc:Employers.employer.myposts(session.user_id, {cfgridpage}, {cfgridpagesize}, {cfgridsortcolumn}, {cfgridsortdirection})"

and get rid of your <cfinvoke>
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi, I will be creating today a basic tutorial on how we can create a Mail Custom Function and use it where ever we want. The main advantage about creating a custom function is that we can accommodate a range of arguments to pass to the Function and …
jQuery is a JavaScript library that greatly simplifies JavaScript programming. AJAX is an acronym formed from "Asynchronous JavaScript and XML."  AJAX refers to any communication between client and server, when the human client does not observe a…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question