Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated sentence about client-side persistence strategy.

...

Let's take a typical master/detail relationship using the concept of a product catalog page. In this example, the ProductListing page is a list of products, and the ProductDetails page must display the details for a specific product.

...

In this pattern, the ProductListing page uses action events and a persistent field on the ProductDetails page.

...

  • It requires a session (to store the productId field between requests).
  • It may fail if the ProductDetails page is accessed before a valid product id is set.
  • The URL does not indicate the identity of the product; if the user bookmarks the URL and comes back later, they will trigger the previous case (no valid product id).

We can improve the previous example without changing the ProductListing page, using a passivation and activation context to avoid the session and make the links more bookmarkable.

...

At some point, persistent values make more sense. In the near future, there will be a client-side persistence strategy that will encode persistent data, such as the product id field, into query parameters (and hidden form fields) automaticallyTapestry has several persistence strategies available, including one that stores data in URL query parameters. See Persistent Page Data for details.