In Play Framework 2.4 Java, I need to fill a form using the following code, but it does not work. The output value of usereditform.field("email").value() is null. Anyone know why?
SignupClz signupobj = new SignupClz();
signupobj.email="[email protected]";
signupobj.name="abcd";
signupobj.password = "eoijf";
Form<SignupClz> usereditform = Form.form(SignupClz.class).fill(signupobj);
System.out.println(usereditform.field("email").value());
This code is correct. Please look at other points - maybe you did not recognize "[email protected]" output in the console.
For example I have the similar code and it works:
EditForm rawEditForm = new EditForm();
rawEditForm.title = boxModel.title;
rawEditForm.body = boxModel.body;
rawEditForm.id = id;
Form<EditForm> editForm = Form.form(EditForm.class).fill(rawEditForm);
Logger.info("Title: " + editForm.field("title").value());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With