Ok I simplified my use-case and decided to try and call the javascript
function from a button instead of on dom-loaded (parhaps something there is
messing with it). Moreover I discovered that I mistakinly assumed that I
needed to include the t:zone as parameter to the url. Moreover I changed the
ajax-get to a post so it is exactly in line with the request performed
through the actionlink. 

so : 
new Ajax.Request('/thepage.refreshzone?t:zone=zone1;t:ac=/id-1-66590/', {
method:'get' });
gets: 
new Ajax.Request('/thepage.refreshzone?:ac=/id-1-66590/', { method:'post'
});

now the method onActionFromRefreshZone is correctly called but the returned
component (a subclass of AbstractTab) is not rendered. The strange thing is
that as far as I can tell the callstack is exactly the same as when called
with an actionlink (in which case the component is rendered) 
For instance, in both cases abstractTab.setupRender() is called, etc. 

public AbstractTab onActionFromRefreshZone() {
  nrOfReqs ++;
  if (!request.isXHR()) {
        return null;
  }
        
  return curTab;
}

Anyone have any clue why this might be happening? 


britske wrote:
> 
> Hi, 
> 
> I've created a zone which get's a couple of updates from various external
> websites. The zone initally (on page load) contains some local info, but
> needs to be dynamically extends with the sources extracted from these
> websites. I want to call a server-side method (onActionFromRefreshZone)
> which updates this zone (and starts fetching the info from the external
> websites) on the dom-loaded event. 
> 
> The zone is in place and I checked that it works with an actionlink: 
>  # update 
> 
> However as said I want to call the method onActionFromRefreshZone  on
> dom-loaded. 
> I already have the javascript method in place which is called on this
> event.However I have no clue how to call the method in a Asynchrnous way.
> I tried including the url of the above actionlink as such: 
> 
> function functionWhichIsCalledOnDomLoaded(){
>       new Ajax.Request('/thepage.refreshzone?t:zone=zone1;t:ac=/id-1-66590/', 
> {
> method:'get' });
> }
> 
> but this doens't work. 
> Somehow I'm thinking this isn't the correct way anyhow and that there
> should be a more elegant way / more T5-way to call a server-side method
> asynchronously. 
> 
> Thanks, 
> Geert-Jan
> 

-- 
View this message in context: 
http://n2.nabble.com/T5%3A-how-to-update-zone-on-dom-load-tp1584917p1585109.html
Sent from the Tapestry Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to