Uploaded by JamesGFoster on Feb 16, 2010
In Chapter 6 of "Learning Web Development with Seaside" we look at how Seaside addresses the common web application challenge of storing application state. We start by launching our Seaside One Click Experience and refactoring our #'renderContentOn:' method so that the change time links are in a separate method.
We then add another anchor to report which flight was selected. Clicking on the anchor evaluates a callback that displays the selected flight using Seaside's #'inform:' method.
When we run the application we can view various flights, clicking the "Later" link till we get to a desired flight. We select a flight for August 26 and see that the flight for August 26 was selected. If we use the "Later" link to move to a flight on the 28th, and then use the browser's back button to move to a flight on the 27th, clicking the "Book flight" link ends up selecting a flight on the 28th because that was the last page rendered by the server (the server doesn't know that we clicked the browser's back button).
We can observe the same effect by using two tabs (or windows) in the browser. We view the September 1 flight in one tab and then switch back to the August 28 flight in another tab. Clicking the "Book flight" link again gives us the wrong flight because the server has saved the most recent state which came from the other tab.
Seaside provides a simple way of addressing this common web development problem. We can identify which objects have state that is associated with the page being displayed. When an action takes place on that page, the objects are restored to their original state.
Now we return to the application, click "Later" a few times so that a flight on the 5th is displayed. Click the back button to return to a flight on the 3rd, and click the "Book flight" link. We see that now we correctly get the flight from the 3rd. Likewise, if we use a second tab we can view a flight for the 6th in one tab and still select a flight for the 3rd in the other tab.
This demonstrates the ability Seaside provides for easily associating domain states with specific pages rendered to the client. We can now save our Seaside code.
For more information go to seaside.gemstone.com/tutorial.
-
0 likes, 0 dislikes
3:03Introduction to tODEby JamesGFoster228 views
2:24What is a Domain Model?by soapark770 views
2:29Smalltalk IDE as XULRunner remote XUL applicati...by xkriva801,515 views
1:03Process Server Marylandby DueProcessUSA1,100 views
7:30Daniel Glazman Mozilla FirefoxAddOn XULRunner M...by jocognito95 views
9:32Mac mini Server (2009) SSD Upgrade Install Vide...by OSX4115,898 views
3:49Demartek LSI CacheCade Performance Evaluation i...by Demartek1,750 views
3:45Your Server Hates Youby deathnosecomedy29,129 views
7:08Supporting User Loginby JamesGFoster295 views
1:56Using Monticello for Source Codeby JamesGFoster400 views
4:54Seaside and Ruby on Railsby jarober3,570 views
6:38ASP NET Using session variablesby MyWorkHome3,836 views
3:03Introduction to tODEby JamesGFoster610 views
8:26Germán Leiva demonstrates Namespaces in Pharoby JamesGFoster440 views
2:46UCView Digital Signage Serverby ucview2,373 views
8:41How to configure & use State Server session man...by dnfvideo2,557 views
8:48session state in asp.net (for more cooltuts.com)by leardotnet12348,574 views
7:59Home Server Guide - Part 1 TLER, DIY SSD - exoi...by cbutters6,031 views
7:17Server Sign Up!!!!!by MinecraftFinest3,476 views
9:29Daniel Glazman Mozilla FirefoxAddOn XULRunner M...by jocognito208 views
- Loading more suggestions...
Link to this comment:
All Comments (0)