Dynamic Web Development with Seaside

6.3.3Rendering a Counter

Now we define the instance method renderContentOn: to display the counter as a heading. Seaside will call such a method when it needs to display a component in the web browser. In the following method we just say that we want to display the value of the variable count using a heading HTML tag.

WebCounter>>renderContentOn: html
html heading: count

As you see, in Seaside you do not directly write HTML but rather you use a higher-level interface that models HTML. This helps you avoid making HTML mistakes. We will go into much more detail on this subject later in the book.

Copyright © 19 March 2024 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.