You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by John <jo...@quivinco.com> on 2013/02/20 11:51:58 UTC

ajaxformloop doesn't refresh after remove

I have a problem that I am using the ajaxformloop component to manage some table rows and when the remove row method returns after taking the row out of the persisted collection. Even when I add ajaxResponseRdenerer.addRender(timetableZone) that doesn't seem to trigger a re render. So my row doesn't disapear. Interestingly the jQuery example doesn't even include the addRender method, it just removes the item from the backing collection and somehow the containing zone is updated internally.

Is it possible that there is an inner zone an that this doesn't work within my outer zone?


    @OnEvent(value = EventConstants.REMOVE_ROW, component = "overrides")
    void onRemoveRowFromOverrides(TimetableOverride override) {
        overrides.remove(override); // NB remove returns true
    }

<t:zone t:id="timetableZone" id ="timetableZone">
...
<table>
  <tr t:type="ajaxformloop" t:id="overrides" t:source="overrides" encoder="overrideEncoder" t:value="override">
                          <tx:DateField t:id="startTime" t:value="override.startTime" format="literal:dd MMM yyyy HH:mm" time="true"
                                      t:mixins="jquery/tooltip" title="${message:hint.starttime}" />
                          <tx:DateField t:id="endTime" t:value="override.endTime" format="literal:dd MMM yyyy HH:mm" time="true"
                                      t:mixins="jquery/tooltip" title="${message:hint.endtime}" />
      &nbsp;<t:removerowlink t:zone="timetableZone">remove</t:removerowlink>
                    <br/>
   </tr>
</table>

Re: ajaxformloop doesn't refresh after remove

Posted by John <jo...@quivinco.com>.
ah, the jumpstart example works fine, although if you click in the component while a remove is animating it crashes?
  ----- Original Message ----- 
  From: John 
  To: users@tapestry.apache.org 
  Sent: Wednesday, February 20, 2013 10:51 AM
  Subject: ajaxformloop doesn't refresh after remove


  I have a problem that I am using the ajaxformloop component to manage some table rows and when the remove row method returns after taking the row out of the persisted collection. Even when I add ajaxResponseRdenerer.addRender(timetableZone) that doesn't seem to trigger a re render. So my row doesn't disapear. Interestingly the jQuery example doesn't even include the addRender method, it just removes the item from the backing collection and somehow the containing zone is updated internally.

  Is it possible that there is an inner zone an that this doesn't work within my outer zone?


      @OnEvent(value = EventConstants.REMOVE_ROW, component = "overrides")
      void onRemoveRowFromOverrides(TimetableOverride override) {
          overrides.remove(override); // NB remove returns true
      }

  <t:zone t:id="timetableZone" id ="timetableZone">
  ...
  <table>
    <tr t:type="ajaxformloop" t:id="overrides" t:source="overrides" encoder="overrideEncoder" t:value="override">
                            <tx:DateField t:id="startTime" t:value="override.startTime" format="literal:dd MMM yyyy HH:mm" time="true"
                                        t:mixins="jquery/tooltip" title="${message:hint.starttime}" />
                            <tx:DateField t:id="endTime" t:value="override.endTime" format="literal:dd MMM yyyy HH:mm" time="true"
                                        t:mixins="jquery/tooltip" title="${message:hint.endtime}" />
        &nbsp;<t:removerowlink t:zone="timetableZone">remove</t:removerowlink>
                      <br/>
     </tr>
  </table>