play 2.2 java Form type mismatch between controller and template

359 views
Skip to first unread message

Vadim Gerassimov

unread,
Dec 27, 2013, 4:37:48 PM12/27/13
to play-fr...@googlegroups.com

Hello,

probably this question has been asked before (but I didn't find any answer that would help me).

The problem is following: in Java controller I should use play.data.Form like:

  public static Result loginForm() {
   
Form<LoginForm> form = Form.form(LoginForm.class);
   
return ok(loginForm.render(form));
 
}


And template is like:

@(f: Form[controllers.Application.LoginForm])
@import helper._

@main("Welcome to Play") {

   
@form(action = routes.Application.login()) {
       
@inputText(f("username"), 'id -> "username")
        <br>
        @inputPassword(f("password"))
        <button>GO!</button>
    }

}


The code is compiled and run via SBT but in my IDE (Intellij IDEA) I see reasonable compilation error:
'render(play.data.api.Form<controllers.Application.LoginForm>' in '' cannot be applied to play.data.Form<controllers.Application.LoginForm>

How to resolve given mismatch? The project was created using play idea command.

Any help would be appreciated.

Vadim

Vadim Gerassimov

unread,
Dec 27, 2013, 4:44:13 PM12/27/13
to play-fr...@googlegroups.com
I found the answer from this topic:

https://groups.google.com/forum/#!topic/play-framework/gNbIBtMy9r4

play idea (2.2.1) incorrectly configures src_managed sources.

Vadim

пятница, 27 декабря 2013 г., 23:37:48 UTC+2 пользователь Vadim Gerassimov написал:
Reply all
Reply to author
Forward
0 new messages