Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2008-10-30
5
Medium Priority
?
323 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 2000 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 2000 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

971 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