14.9: Chapter Summary
- Page ID
- 43221
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)
- The easiest way to get started is to download the Seaside One-Click Experience from http://seaside.st
- Turn the server on and off by evaluating
ZnZincServerAdaptor startOn: 8080
andZnZincServerAdaptor stop
. Toggle Halos
to directly view application source code, run-time objects, CSS and HTML.- Remove the root decoration class
WAToolDecoration
in the application configuration, to disable the toolbar - Send
WAAdmin applicationDefaults removeParent: WADevelopmentConfiguration instance
, to disable toolbar for new Components - Seaside web applications are composed of components, each of which is an instance of a subclass of
WAComponent
. - Only a root component may be registered as an application. It should implement
canBeRoot
on the class side. Alternatively it may register itself as an application in its class-sideinitialize
method by sendingWAAdmin register: self asApplicationAt: application path
. If you overridedescription
it is possible to return a descriptive application name that will be displayed in the configuration editor. - To backtrack state, a component must implement the
states
method to answer an array of objects whose state will be restored if the user clicks the browser’s Back button. - A component renders itself by implementing
renderContentOn:
. The argument to this method is an HTML rendering canvas (usually calledhtml
). - A component can render a subcomponent by sending
self render: subcomponent
. - HTML is generated programmatically by sending messages to brushes. A brush is obtained by sending a message, such as
paragraph
ordiv
, to the HTML canvas. - If you send a cascade of messages to a brush that includes the message
with:
, thenwith:
should be the last message sent. Thewith:
message sets the contents and renders the result. - Actions should appear only in callbacks. You should not change the state of the application while you are rendering it.
- You can bind various form widgets and anchors to instance variables with accessors by sending the message
on: instance variable of:
object
to the brush. - You can define the CSS for a component hierarchy by defining the method
style
, which should return a string containing the style sheet. (For deployed applications, it is more usual to refer to a style sheet located at a static URL.) - Control flows can be programmed by sending
x call: y
, in which case componentx
will be replaced byy
untily
answers by sendinganswer:
with a result in a callback. The receiver ofcall:
is usuallyself
, but may in general be any visible component. - A control flow can also be specified as a task — a instance of a subclass of
WATask
. It should implement the methodgo
, which shouldcall:
a series of components in a workflow. - Use
WAComponents
’s convenience methodsrequest:
,inform:
,confirm:
andchooseFrom:caption:
for basic interactions. - To prevent the user from using the browser’s Back button to access a previous execution state of the web application, you can declare portions of the workflow to be a transaction by enclosing them in an
isolate:
block.