Dynamic Web Development with Seaside

3.6.7Adding Behavior

We want to be able to increment and decrement the counter, which requires two methods.

In the System Browser, select Protocol | New to add a method category for methods to update the value of count. Call the category updating. Then add these two methods:

WebCounter>>increase 
self count: count + 1
WebCounter>>decrease 
self count: count - 1

These use the count: accessor method that was generated when the class was first created.

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.