thanks for your answer Chung, I tried it but when i add a row I got this
error :

No object of type
org.apache.tapestry5.services.javascript.JavaScriptSupport is available
from the Environment.


2014-08-07 10:08 GMT+02:00 Chung Khanh Duy <chungkhanhduy1...@gmail.com>:

> Hi,
>
> You could not call updating zone in onAddRow or onRemove(). This is my way
> to do that:
>
> 1. Declare one action link in tml file:
>
> <t:actionlink t:id="updateZoneLink"
> t:clientId="updateZoneLink"
> t:zone="zoneTitle"
>  style="display:none"/>
> 2. in Java code, we callback a javascript function
>
> onRemoveRow....() {
> ....
>  javascriptSupport.addScript("callUpdateZone()");
>
> }
>
> Object onActionFromUpdateZoneLink() {
>  // update your zone
> return request.isXHR() ? zoneTitle.getBody() : null;
> }
>
> 3. In your js file, you have to define callUPdateZone() method:
>
> this.callUpdateZone = function() {
> // send ajax to update zone
> var $link = $("a[clientid*='updateZoneLink']");
>  var href = $link.attr('href');
> if (href.indexOf('?') != -1) {
> href = href.substr(0, href.indexOf('?'));
>  }
> Tapestry.findZoneManager($link[0]).updateFromURL(href);
> }
>
> Hopefully it can help. Notice I used javascript Jquery. You can use
> prototype to find your DOM element.
>
> Thanks,
> Duy.
>

Reply via email to