tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mind Bridge" <mindbridge...@yahoo.com>
Subject RE: problem: how to avoid inconsistencies when a user open alinkin anew window
Date Thu, 05 Jun 2003 14:53:49 GMT
Hi Marilen,

I am judging about the issue from your description earlier:

<marilen>
Take this case: I have a dynamic category, products hierarchy. I then
visit a page showing the categories and select one category in a page
(shift-click) and another in other page (shift-click). Both pages will
show the products for the category received as parameter. Can this be a
persistent page property. As far as I know both pages share the save
httpSession managed by a cookie. Assume then each page will have a
number of contained components for instance a table. This will contain a
direct link for sort. What happens it I store the category as a
persistent page property, load page1, load page2 and the click to sort
page1. I guess page1 will now show the sorted items in page2.

the sequence is as follows:

- load page1 in a new page with a parameter C1, store C1 in session
- load page2 in a new page with a parameter C2, store C2 in session
- click on page1 directLink
- render page1 using C2 from session ?!
</marilen>


Basically, the predicament that I see is the following:

- page1 and page2 would use the same session
- both page1 and page2 actually use the same Tapestry page with the same
components to essentially display different data
- since both the session and page/components are the same, update of the
persistent properties in page1 would reflect on page2 and the opposite. How
can this be avoided?

My earlier email was describing the general case.
If you are only worried about the state of the table and nothing else, you
have a way out, albeit not a terribly elegant one (it is along the lines of
what Bill sent):

You would need to encode in the URL the following information:
	- the ID of the data query that is used for extracting the data that is to
be displayed
	- the table state (page & sorting)
Normally this is kept in the session, but in your case this is obviously not
possible since it is shared.

The above means that _all_ links on the page that refer to itself,
especially the table-related ones must encode that information.

To do that with Table, you would need to
- use Direct or External services to encode that information
- modify TablePages and the table columns that you use to generate link
using the above and encode the necessary information
- use NullTableStateManager and recreate the table model completely each
time based on the extra information passed in the URL

This is not terribly easy, but is definitely doable.

This is very much similar to running your application stateless (since you
cannot use the session). As I pointed out earlier, this is (unfortunately) a
tricky issue (see the discussion a few weeks back). Note that in your case
you cannot even use cookies, since they are usually shared between different
instances of the same browser as well -- the only escape is keeping the data
in the URL.

There are, of course, simpler approaches than the full blown one, such as
having a "URL state"  (kept by the engine, I guess) that is passed from URL
to URL. But this has not been discussed in detail, since there has not been
a need for it until now.

-mb



-----Original Message-----
From: Marilen Corciovei [mailto:len@nemesisit.rdsnet.ro]
Sent: Thursday, June 05, 2003 5:16 PM
To: Tapestry development
Cc: rael@zopyra.com
Subject: Re: problem: how to avoid inconsistencies when a user open
alinkin anew window


What about the sorting links in the top. Are they not added by the table
component? and they are directLink's :)

Len

On Thu, 2003-06-05 at 17:07, Bill Lear wrote:
> On , June 5, 2003 at 17:00:46 (+0300) Marilen Corciovei writes:
> >What if the directLink is in a tapestry component like table. Should I
> >modify the table component if I want to do that? And all other
> >components which might or might not be my own.
>
> Not sure I understand.  Don't you decide which links get put into the
> table?
>
>
> Bill
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
--
Marilen Corciovei <len@nemesisit.rdsnet.ro>


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


Mime
View raw message