1
votes

I am new to the Play Framework and am passing values from a controller to a view. When I compile in activator (in the Command line), I receive this error:

[error] C:\WebDev\git\PlayAuthenticate\app\controllers\Application.java:633: met
hod render in class views.html.profile.profile cannot be applied to given types;
[error]   required: play.data.Form<controllers.Application.ProfileRegister>,java
.util.List<models.Service>
[error]   found: play.data.Form<controllers.Application.ProfileRegister>
[error]   reason: actual and formal argument lists differ in length
[error] profile.render

Here is my function in the controller:

public Result addProfile() {
    List<Service> services = Service.find.all();
    return ok(profile.render(form(ProfileRegister.class), services));
}

Here is the first line in the view.html.profile.profile:

@(profileForm: Form[Application.ProfileRegister], servicesList: java.util.List[Service])

I am not sure what I am missing. When I remove the second parameter -- the List object -- it compiles.

I found a few posts, but it did not fix my problem:

Play Framework 2.2.1 - Compilation error: "method render in class index cannot be applied to given types;"

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

Thanks for the help!

1

1 Answers

0
votes

It looks like Eclipse did not like the space between the parameters. I removed the space and the project compiled.