Yes, I think your approach is good. But unfortunatelly, if I do this the table row events (the clicks on commandLink links stored in the table) are not fired because the table is not populated at that time (apply request values) and in the end I have to use other methods to simulate the row clicks.

I think the issue is that there seems to be no way to tell if is this is a real postback (to the same page) or a postback to navigate somewhere else. Shale reports isPostBack=true in both cases.


Craig McClanahan <[EMAIL PROTECTED]> wrote:


On 3/10/06, Costa Basil <[EMAIL PROTECTED]> wrote:
Let me give you an example. Let's say I have a table with rows (populated from the database) and I have on each row a commandLink to delete that row. On the same page I have another commandLink to navigate to another page. If I delete the row the table has to be populated as early as possible for the deleteRow event to be fired. However, if I navigate to another page I don't want to query that table from the database which would happen even if I set immediate to true for the commandLink that navigates the other page. Of course I have the option of using a hidden link to delete the row but ...

That's a pretty common use case, and here's how I would approach it ... populate the table in the prerender() method of the view that contains the table.

This works because, if you actually do navigate to a different page, the prerender() method of *that* page will be called instead of the prerender() method of *th is* page.  Thus, you will never waste the time to perform the query (or whatever) to populate the table unless it is actually necessary.

Craig

Costa Basil < [EMAIL PROTECTED]> wrote:
I use shale and I was wondering if there is there an easy way to know in a backing bean on the postback that the user actually pressed a commandLink that navigates to another page than the one the backing bean is for. I want to avoid unecessary database calls.


Thanks

Enrich your life at Yahoo! Canada Finance


Have a question? Yahoo! Canada Answers. Go to Yahoo! Canada Answers



Make free worldwide PC-to-PC calls. Try the new Yahoo! Canada Messenger with Voice

Reply via email to