title: Tapestry5: Page with structure like page-loop-customComponent-form does not work
body: <p>I have the following situation: 
  I have Page which activated in some context (for example "/page/ctx1")
  I have component DayJournalItem which inserted in page via t:loop</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div t:type="Loop" t:source="journalDays" t:value="journalDay"
      t:encoder="dayEncoder"&gt;&lt;t:DayJournalItem day="journalDay"
      cacheContainer="cacheContainer" /&gt;&lt;/div&gt;
  </code></pre>
  
  <p>And DayJournalItem have another loop with other component ActivityJournalItem which has form</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"&gt;
  &lt;t:zone t:id="dayAjaxZone" update="show"&gt;
      &lt;div class="dayHeader"&gt;${dayHeader}&lt;/div&gt;   &lt;div class="dayBody"&gt;
      &lt;div t:type="Loop" t:source="activities" t:value="activity"&gt;&lt;t:ActivityJournalItem
          activity="activity" cacheContainer="cacheContainer" /&gt;&lt;/div&gt;
      &lt;/div&gt;
  &lt;/t:zone&gt;&lt;/div&gt;
  </code></pre>
  
  <p>ActivityJournalItem component</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"&gt;
  &lt;t:zone t:id="activityAjaxZone" update="show"&gt;
      &lt;t:if test="${editingActivity}"&gt;
          &lt;div class="activityEditFormBody"&gt;
          &lt;form t:type="form" t:id="activityForm" t:zone="activityAjaxZone"&gt;
  ....
          &lt;input t:id="Save" t:type="Submit" value="Save" /&gt;
          &lt;input t:id="Cancel" t:type="Submit" value="Cancel" /&gt;
          &lt;/form&gt;
          &lt;/div&gt;
      &lt;/t:if&gt;
      &lt;t:if test="${!editingActivity}"&gt;
          &lt;div&gt;viewing activity: ${activity.id}&lt;/div&gt;
      &lt;/t:if&gt;
  &lt;/t:zone&gt;&lt;/div&gt;
  </code></pre>
  
  <p>The problem is - when I'm pressing submit button NullPointerException appearing. All fields in my custom component are null. It seems that Tapestry is unable to restore context correctly. You can look at screenshoot here: <a href="http://my.jetscreenshot.com/2672/20100807-tbfe-235kb.jpg" rel="nofollow noreferrer">http://my.jetscreenshot.com/2672/20100807-tbfe-235kb.jpg</a></p>
  
  <p>I think I missing some parameters in form, loop or somewhere. And cant figure out what is wrong.  By the way, I tried to use encoders, but Tapestry dont event call for them - it seems that they work only inside form. But I have form inside loop. 
  So any help is greatly appreciated. </p>
  
  <p>p.s. If you need more details you can look at full source code (at google code): <a href="http://code.google.com/p/tasks-journal/source/checkout" rel="nofollow noreferrer">http://code.google.com/p/tasks-journal/source/checkout</a></p>
  
  <p><strong>UPD</strong>: I found that I can pass t:context to form and in onPrepareForSubmit phase I can restore fields manually (via pretty dirty work-around). Well, no NPE now, but: 1. This is ugly; 2. This is do not leads to form rerender. No Exceptions and no rerender as expected. I inspected HTTP response there is only empty brackets = "{}"</p>
  
  <p><strong>UPD2</strong>: I still playing with bad workaround. I figured out that if I in onSuccess will "return this;" then rerender will occur. But (!) it always rerender first form (or zone?) on the page. <a href="http://my.jetscreenshot.com/2672/20100808-thdx-190kb.jpg" rel="nofollow noreferrer">http://my.jetscreenshot.com/2672/20100808-thdx-190kb.jpg</a></p>