[2.1-RC2-java] Problem with form types after migrating from 2.0.4

336 views
Skip to first unread message

Jørgen Borgesen

unread,
Jan 21, 2013, 10:26:23 AM1/21/13
to play-fr...@googlegroups.com

I have updated my controllers with to use play.data.Form.form() method instead of Controller.form(). When I try to run my application I get errors like:

error: method render in class create_user cannot be applied to given types;

return ok(create_user.render("", Form.form(CreateUserInfo.class), creator.get())); 

required: String, play.api.data.Form, User found: String, play.data.Form, User

It looks like the my templates expect to get play.api.data.Form instead of play.data.Form. Is there suppost to be any implicit conversion or should I update my templates to use play.data.Form?

If I'm using play.data.Form in my templates I am missing out on some of the features of play.api.data.Form, like the ability to request parameters through the apply method ( ex: createUserForm("username") )

Guillaume Bort

unread,
Jan 21, 2013, 10:29:55 AM1/21/13
to play-fr...@googlegroups.com
Have you migrated you Build.scala file?

It should now use play.Project instead of PlayProject, and add at least javaCore as dependency.


--
 
 



--
Guillaume Bort, http://guillaume.bort.fr

Jørgen Borgesen

unread,
Jan 22, 2013, 3:40:12 AM1/22/13
to play-fr...@googlegroups.com
Thank you! I forgot to add javaCore as a dependency.
Reply all
Reply to author
Forward
0 new messages