Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2008-10-30
5
Medium Priority
?
321 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

The most up-to-date version of this article is on my Blog https://iconoun.com/blog/
This article discusses how to implement server side field validation and display customized error messages to the client.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

705 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