Hao Chen <chenhao_70 <at> hotmail.com> writes:

> I am confused by the request process sequence of Tapestry. It 
> seems that action listeners are invoked when the components are 
> rendered.  Why?  JSF has clear request processing lifecyle.  
> Is there any good doc on Tapestry?

Try the user guide or 
http://www2.cpttm.org.mo/cyberlab/softdev/tapestry/index.html

> I have a list page. In the page class, I load the list data in the 
> pageBeginRender event. On the page, I have an ActionLink on each 
> item to delete the item.  The problem is that:  Tapestry fires 
> beginRender event --> my list data loads --> Tapestry renders each 
> item --> AactionLink event triggered --> item is deleted from DB --> 
> full page rendered.  But since the full list data is already loaded 
> first, the deleted item is still shown on the page.

The above process is the rewind process. It looks like normal
rendering but actual no html code is output. Only after this
rewind process, the real render process will begin. Then your
pageBeingRender() method will be called again, so loading the
list there will work.

However, ActionLink is pretty much useless. You should consider
using DirectLink instead.

> So, my questions are:
>   -- What is the best time to load list data?

In pageBeginRender().

>   -- Why are action listeners invoked during rendering instead of 
> before rendering?

So that the components are restored to the same state
as before (if nothing else has changed).

>   -- How does tapestry identify which component to invoke action 
> on? By some id? 

Yes.

> What happens if the list changes when the action is invoked 
> (like some item was deleted by another person)?

Then you will get a StaleLinkException. That's why you should
use a ListEdit component instead of a Foreach.


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

Reply via email to