[Seaside] simulating user actions in code

Avi Bryant avi at beta4.com
Wed Feb 25 06:36:37 CET 2004


On Feb 24, 2004, at 7:15 PM, radoslav hodnicak wrote:

> i need to display a page that would behave the same as if the user 
> clicked
> all the way to it - the user will get an email with URL that should 
> open
> the application initialized to predefined state.
>
> i talked to avi earlier about this and his advice was
> "to trigger the same methods the user would but catch the
> RenderNotification so that the intermediate pages don't get shown".
>
> i have getting the necessary info from URL etc finished, i just can't
> figure out how to do the triggering because the page i want to display 
> is
> two or three #call:s deep from the root component and a call won't 
> return
> (without user interaction) thus i can't trigger another one...

Well, I think you'd have to do something like this:

[homePage callPage1]
   on: WARenderNotification
   do: [[page1 := homePage delegate.
          page1 callPage2]
             on: WARenderNotification
             do: [page2 := page1 delegate.
                     page2 callPage3.
                     "page three will be shown to the user"]]

Does that work?



More information about the Seaside mailing list