The counter is the most basic example of a Seaside web application. It allows to increment and decrement a number by hitting a link.
This application can be written with a few lines of code. It is implemented in the class
WACounter, a subclass of
The first method is used to initialize the component with the default state, in this case we set the counter to
count := 0
The second method is used to generate the output. It also assigns the actions to the anchors (links) that update the current value.
html heading: count.
callback: [ count := count + 1 ];
callback: [ count := count - 1 ];