Roger Demetrescu schrieb: > Imagine an user opening you "Search product" in several tabs, allowing > him to do different searches in the product table. Each search result > presents the data in a paginate grid, allowing the user to click on a > row to present more detailed info about the product.
Right, using sessions can lead to problems in this scenario. As long as you go to the detail page for one record in one tab and come back to the grid again, everything is fine. But if you go to the detail page in both tabs in parallel, and then you go back, then you will see the wrong grid page for one of the tabs. > I have seen this in the past (not in my systems, of course :)). And it > was even worse, because the search criteria was always stored in the > same session variable, regardless the context. Example: storing > customer search params in the same variable that had product search > params. When the user wanted to return to the search of products (in > the other tab).... Kaboomm... :) The "recollect" decorator stores the parameters per request path, so at least things like this should not happen. >> Another way of remembering parameters (if you don't want to use >> cookies) is passing them around in hidden fields and urls. To make >> this easier, I have written another decorator called "pass_params". It >> modifies the output dictionary by adding hidden fields for the >> specified parameters in all forms that are passed to the template, and >> also passes a modified tg.url() function to the template that >> automatically adds the specified parameters as query parameters to all >> urls created with tg.url(). > > When I read the other thread, I was thinking something like what you > are describing here... Ok, I'll experiment a bit more with pass_params. Just noticed I need to make it add the parameters to any redirect, too. -- Christoph --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en -~----------~----~----~----~------~----~------~--~---
