Dynamic Web Development with Seaside

Buy PDF Buy Print

11.1Displaying a Component Modally

Seaside components have the ability to specify that another component should be rendered (usually temporarily) in their place. This mechanism is triggered by the message call:. During callback processing, a component may send the message call: with another component as an argument. The component passed as an argument in this way can be referred to as the delegate. The call: method has two effects:

  1. In subsequent rendering cycles, the delegate will be displayed in place of the original component. This continues until the delegate sends the message WAComponent>>answer to itself.
  2. The current execution state of the calling method is suspended and does not return a value yet. Instead, Seaside renders the web page in the browser (showing the delegate in place of the original component).

The delegate may be a complex component with its own control flow and state. If the delegate component later sends the message answer, then execution of the (currently suspended) calling method is resumed at the site of the call:. We will explain this mechanism in detail after an example.

From the point of view of a component, it calls another component and that component will (eventually) answer.

Add a Note

Copyright © 16 September 2014 Stéphane Ducasse, Lukas Renggli, C. David Shaffer, Rick Zaccone
This book is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 license.

This book is published using Seaside, Magritte and the Pier book publishing engine.