Dynamic Web Development with Seaside

3.6.3Define a Component

A Seaside component is defined by a subclass of WAComponent class. Accordingly, to create a component, you create the corresponding class. To create the new class, with your package selected in the top-left pane of the System Browser, pick Class | New Class.... Again, the package and name space are correctly filled in already, as shown in Figure 23. For a class name, again enter WebCounter. Change the superclass to WAComponent in Seaside. You can search for it in several ways in the tool, and when selected it will show as Seaside.WAComponent. As is the case with the original WACounter example, we need the one instance variable count, so enter that.

Create a class

Leave the three checkboxes selected, and click OK to create the class. Because the check boxes were all checked, an initialize method for the class and two accessor methods for counter are also created. So, we have a start on the component.

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.