Dynamic Web Development with Seaside

11.7A Look at Built-In Dialogs

Now it’s time to look at the source code for the WAComponent>>inform: method from the WAComponent class. Do not type this code, it is already part of Seaside. The definition of the method inform: of the class WAComponent is the following one.

WAComponent>>inform: aString
"Display a dialog with aString to the user until he clicks the ok button."

^ self wait: [ :cc | self inform: aString onAnswer: cc ]

The method inform: sends the message wait: to raise a newly created WAFormDialog component, exactly the same way as call: does.

How do you find related methods? Looking through WAComponent reveals:

  • WAComponent>>inform: displays a dialog with a message to the user until he clicks the button.
  • WAComponent>>confirm: displays a message and Yes and No buttons. Returns true if user selected Yes, false otherwise.
  • WAComponent>>request:, WAComponent>>request:default:, WAComponent>>request:label:, and WAComponent>>request:label:default: display a message, an optional label and an input box. The string entered into the input box is returned. If the default: argument is specified it is used for the initial contents of the input box.
  • WAComponent>>chooseFrom:, WAComponent>>chooseFrom:caption:, WAComponent>>chooseFrom:default:, and WAComponent>>chooseFrom:default:caption: display a drop-down list with different choices to let the user choose from. A default selection and a title can be given. The methods answer the selected item.

Copyright © 20 April 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.