Note that there are some explanatory texts on larger screens.

plurals
  1. POPlay form binding difficulties - How do I modify a request after getting it in the backend?
    text
    copied!<p>I'm currently trying to connect an Extjs form to a Play! Scala backend. </p> <p>I have no problem receiving the request, but</p> <p><code>FormName.bindFromRequest.get</code> returns to me <code>None</code> .</p> <p>I'm able to find the data generated via submitting from Extjs in the POST request in <code>request.request.body.data</code> (the first request object is generated by SocialSecure's controller), whereas normally the data bound to the form would be found in <code>request.request.body.data.elems</code></p> <p>I think Extjs's eschewal of using <code>&lt;form&gt;</code> in their inserted HTML is what causes me this problem, but I'd still like to take advantage of Extjs's nice form verification UI. </p> <p><strong>Does Play! or Scala have any resources for modifying a request after the server has received it?</strong> <br><br></p> <h1>More info</h1> <p>This is the method my <code>/requestAudit</code> cuurently points to after a POST request:</p> <pre><code>def requestAudit = SecuredAction(WithProvider("google")) { // SecureSocial syntax implicit request =&gt; { // let's call this line 0' println(request.request.body.asFormUrlEncoded) // let's call this line 1' println(request.body.asText) // let's call this line 2' newAuditForm.bindFromRequest.fold( errors =&gt; BadRequest(views.html.error(newAuditForm)) success =&gt; { /*insert the object into my db*/ } ) } } </code></pre> <p><br></p> <h2>Ext.js request</h2> <p>When I'm debugging in Eclipse with an Ext.js form, the Variables window shows: (click for closeup) <a href="https://imgur.com/F1A9p7u" rel="nofollow noreferrer"><img src="https://i.imgur.com/F1A9p7u.png" title="Hosted by imgur.com" /></a> where the form values are located in <code>request.body.data.key1</code>, <code>request.body.data.key2</code>, etc <br><br></p> <h2>Bootstrap form request</h2> <p>On the other hand, the request for Bootstrap has the values stored in <code>request.body.data.elems</code> <a href="https://imgur.com/ilXiMQ5" rel="nofollow noreferrer"><img src="https://i.imgur.com/ilXiMQ5.png" title="Hosted by imgur.com" /></a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload