eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'TriggerValue':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: TriggerValue


Inheritance:

   Object
   |
   +--Model
      |
      +--ValueModel
         |
         +--ValueHolder
            |
            +--TriggerValue

Package:
stx:libview2
Category:
Interface-Support-Models
Version:
rev: 1.13 date: 2021/03/16 12:38:48
user: stefan
file: TriggerValue.st directory: libview2
module: stx stc-classLibrary: libview2

Description:


a triggerValue sends updates on every store of a value, even if the same
value is stored again.
It can be used as a triggerChannel of a bufferedValueHolder.

(however, in this specific use, you can also use normal ValueHolder,
 and set it value to nil before setting it to the actual trigger value)

copyright

COPYRIGHT (c) 1995 by Claus Gittinger All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

Instance protocol:

accessing
o  value: anObject
redefined to send change notifications on every store,
even if the same value is stored again.


Examples:


        |trigger|

        trigger := TriggerValue new.
        trigger onChangeEvaluate:[ Transcript showCR:'hello' ].
        trigger value:true.
        Delay waitForSeconds:1.
        trigger value:true
buffered editing with a TriggerValue
        |firstName lastName trigger dialog|

        firstName :=  'foo' asValue.
        lastName := 'bar' asValue.
        trigger := TriggerValue new.

        dialog := Dialog new.
        (dialog addTextLabel:'Name:') layout:#left.
        (dialog addInputFieldOn:(BufferedValueHolder
                                    subject:firstName
                                    triggerChannel:trigger)) immediateAccept:true.
        dialog addVerticalSpace.
        (dialog addTextLabel:'Address:') layout:#left.
        (dialog addInputFieldOn:(BufferedValueHolder
                                    subject:lastName
                                    triggerChannel:trigger)) immediateAccept:true.

        dialog addAbortButton; 
               addButton:(Button new 
                                label:'undo'; 
                                action:[trigger value:false]);
               addOkButton.

        dialog okAction:[trigger value:true].
        dialog open.

        Transcript show:firstName value; show:' '; showCR:lastName value


ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Thu, 03 Oct 2024 16:35:50 GMT