[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tapestry-user
Subject:    Re: [T4] AJAX: reender whole page or just send back the markup of
From:       Pai911 <javamagician () gmail ! com>
Date:       2008-01-11 4:02:14
Message-ID: 14749380.post () talk ! nabble ! com
[Download RAW message or body]


Hi!
I don't think that Tapestry will render the whole page when a listener is in
invoked Asynchronously.

When you intend to define a link or form for Async invocation, remember to
set the async attribute as "true"

for example:
#DIV TO DISPLAY CURRENT TIME#
&lt;span jwcid="timeBar@Insert" value="ognl:currentTime"/>


#LINK TO UPDATE CURRENT TIME PROPERTY#
&lt;a jwcid="@DirectLink" listener="listener:updateTime" async="true"
updateComponents="timeBar">
What time is it? 

#CORRESPONDING JAVA CODE#

public abstract Date getCurrentTime();

public abstract void setCurrentTime(Date time);

public void updateTime(){
    this.setCurrentTime(new Date());
}

I think Tapestry Ajax basically updates client side page by "component".

If you want to manipulate it by DOM element, you have to use EventListener
annotation 
with the "target" to specify the DOM element you want to update

Please correct me if there is anything wrong

Regards,

John

hbf wrote:
> 
> Dear all,
> 
> I have a very basic question about AJAX in Tapestry 4.1.3: IIUC, the  
> "updateComponents"
> attribute provided by Tapestry components works by rendering the  
> *whole* page,
> extracting the relevant components (via their ids) and sending them  
> back to the client.
> I find this very elegant and it makes the pages easy to maintain.
> 
> For very complex pages, however, the above approach can result in  
> some overhead.
> I'd therefore like to just call a function that returns the  
> replacement div (and
> does not render the whole page).
> 
> Is there a simple example that shows how to do this?
> 
> For instance: Given a div and a link, clicking the link will replace  
> the div via AJAX
> without reloading the page.
> 
> Thanks,
> Kaspar
> 
> P.S. I have started reading about EventListeners but am not sure  
> whether this is
> exactly what I need.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: \
http://www.nabble.com/-T4--AJAX%3A-reender-whole-page-or-just-send-back-the-markup-of-the-div-tp14747399p14749380.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic