2

How to pass a value through an Ajax function in Play 2.0?

For the url @routes.Content.editExam()?examid="+tid I get:

not enough arguments for method editExam: (examid: Long)play.api.mvc.Call. Unspecified value parameter examid.
2
  • Play can bind you request into objects if you specified the object. So if you have a 'strange' error you should post the Controller, the Ajax call and the specific route for us to help you. All I can see from your question is : routes is contructed wrongly (with the + sign.) and you did not specified enough params or the wrong data type!
    – adis
    Oct 19, 2012 at 7:06
  • as @adis mentions, you have to provide more details about what you are doing. If you do not show you at least some of the code that is generating this, we can't help.
    – Mortimer
    Mar 22, 2013 at 12:49

1 Answer 1

0

Play generates the reverse routes to require query parameters as method arguments. In this case probably all you need to do is pass your variable to it. You don't need to construct query param strings.

The solution is:

@routes.Content.editExam(tid)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.