title: Encoder with <t:loop> component in Tapestry
body: <p>I have one Page which is displaying details of some Client. I am using <code>t:loop</code> to display some data. In <code>t:loop</code> I am just passing <code>source</code> and <code>value</code>. So far so good, my page is working fine. But when I try to submit the Page it suddenly give me the Exception.</p>
  
  <blockquote>
    <p>“Could not find a coercion from type java.lang.String to type
    [addressUsageValue] Available coercions:……….”</p>
  </blockquote>
  
  <p>Below is the sample code</p>
  
  <pre><code>&lt;t:loop source="addressUsageInfo" value="addressUsageValue"&gt;
                    &lt;tr&gt;
                                &lt;td&gt;${addressUsageValue?.usage}&lt;/td&gt;
                                &lt;td&gt;${addressUsageValue?.address}&lt;/td&gt;
                                &lt;td&gt;${addressUsageValue?.postCode}&lt;/td&gt;
                                &lt;td&gt;${addressUsageValue?.city}&lt;/td&gt;
                                &lt;td&gt;${addressUsageValue?.country}&lt;/td&gt;
                    &lt;/tr&gt;
  &lt;/t:loop&gt;
  </code></pre>
  
  <p>I did some goggling and find below references.</p>
  
  <p><a href="http://tapestry.apache.org/5.3.3/apidocs/org/apache/tapestry5/corelib/components/Loop.html" rel="noreferrer">http://tapestry.apache.org/5.3.3/apidocs/org/apache/tapestry5/corelib/components/Loop.html</a>
  <a href="https://issues.apache.org/jira/browse/TAP5-609" rel="noreferrer">https://issues.apache.org/jira/browse/TAP5-609</a></p>
  
  <p>So I have created encoder for Loop. Below is the sample code. In below <code>toClient()</code> method I have randomly returned any value and in <code>toValue()</code> method I am returning null.</p>
  
  <pre><code>private final ValueEncoder&lt;DtoAddressUsageInfo&gt; addressUssageEncoder = 
      new ValueEncoder&lt;DtoAddressUsageInfo&gt;() {
  
      public String toClient(DtoAddressUsageInfo value) {
            return String.valueOf(value.getUsage());
      }
  
      public DtoAddressUsageInfo toValue(String clientValue) {
            return null;
      }
  
  };
  </code></pre>
  
  <p>Now my code is working fine and I am able to submit the form.</p>
  
  <p>Here my doubt comes</p>
  
  <p><strong>First – I am not able to understand why encoder is required when using loop?? And if it is required to submit the form then why it is not Mandatory parameter??</strong>  </p>
  
  <p><strong>Second – I have just implemented the Encoder without any logic. I am not able to understand where toValue() and toClient() method is used and what is the purpose?</strong>  </p>
  
  <p><strong>Third – when I submit the Page why form required Encoder??</strong>  </p>