title: Play 2.0.1 custom field constructor... Extra parameters?
body: <p>I am new to the play framework and want to write my own twitter bootstrap field constructor, which includes the usage of the bootstrap <a href="http://twitter.github.com/bootstrap/base-css.html#icons">icon-classes</a>. To make this dynamic I need to pass the icon-class via extra parameter. Is that even possible? I tried the following and some other variations:</p>
  
  <p><strong>index.scala.html</strong></p>
  
  <pre><code>@(loginForm: Form[Login])
  
  @import helper._
  @implicitFieldConstructor = @{ FieldConstructor(twitterBootstrapInput.render) } 
  @main("Akquise") {
  
  &lt;div class="container row"&gt;
      &lt;div class="span4 offset5"&gt;
          @form(routes.Application.login(), args = 'class -&gt; "well"){
              &lt;h3&gt;Anmeldung&lt;/h3&gt;
              &lt;fieldset&gt;
              @inputText(loginForm("username"), '_label -&gt; "Nutzername", '_iconcls -&gt; "icon-user")
              @inputPassword(loginForm("password"), '_label -&gt; "Passwort", '_iconcls -&gt; "icon-key")
              &lt;/fieldset&gt;
  
              &lt;button type="submit" class="btn btn-primary"&gt;Login&lt;/button&gt;            
          }
      &lt;/div&gt;
  &lt;/div&gt;
  
  }
  </code></pre>
  
  <p><strong>twitterBootstrapInput.scala.html</strong></p>
  
  <pre><code>@(elements: helper.FieldElements)
  
  @************************************************** 
  * Generate input according twitter bootsrap rules *
  **************************************************@
  &lt;label for="@elements.id"&gt;@elements.label&lt;/label&gt;
  &lt;div class="input-prepend"&gt;
      &lt;span class="add-on" style="margin-right:-5px;"&gt;
          &lt;i class="@elements.iconcls icon-size"&gt;&lt;/i&gt;
      &lt;/span&gt;
      @elements.input
  &lt;/div&gt;
  </code></pre>
  
  <p>With these parameters the compiler throws this error:</p>
  
  <p><code>value iconcls is not a member of views.html.helper.FieldElements</code></p>
  
  <p>How can I pass other arguments if that doesn't work?</p>