eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'Model::ModelUpdateLockedQuery':

Home

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

Class: ModelUpdateLockedQuery (private in Model

This class is only visible from within Model.

Inheritance:

   Object
   |
   +--GenericException
      |
      +--Notification
         |
         +--Query
            |
            +--Model::ModelUpdateLockedQuery

Package:
stx:libview2
Category:
Interface-Support-Models
Owner:
Model

Description:


this query can answer true (ie. ''isLocked'') for a particular model,
while inside a updating block.

This is used for temporal blocking models to be changed
(eg. to prevent cyclic updates).

A particular application of this is found in input-field + tree selection
combinations, where entering a new value into the field changes the treeselection,
and also tree selection changes the input field's value.
Concrete: take a look at the XMLInspector's xpath field, which triggers a tree
selection change, but the selection change should not backfire on the field in this
case, whereas a regular tree-selection will change the field.

Notice:
    do NOT place the query into the general value: method of Model.
    This is too expensive to be done every time.
    Thus, the related models need to know about the interlocking and
    must do this individually.

see example


[instance variables:]

[class variables:]

example

|vh1 vh2| vh1 := ValueHolder new. vh1 onChangeEvaluate:[ (vh2 isLocked) ifFalse:[ vh2 value: #newValue ]. ]. vh2 := ValueHolder new. vh2 value:#oldValue. vh2 withUpdatesLockedDo:[ vh1 value:123. ]. because of the lock, the old value should still be there'. self assert:(vh2 value == #oldValue)

Class protocol:

handling
o  answer: aBoolean for: aModel do: aBlock
evaluate aBlock, answering aBoolean if asked for the locking status of aModel

queries
o  isLocked: aModel
asking for the locking status of aModel


Instance protocol:

defaults
o  defaultResumeValue



ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 21 Dec 2024 17:07:58 GMT