write-cell-value

Generic Function

Package: common-graphics

Arguments: grid-row grid-column value

This generic function may be called to write a value that the user has interactively entered into the grid cell defined by the row and column arguments back into an application's master data. Typically it is called by a cell-click method or a cell-key-down method that has interpreted a new cell value from the end user's mouse or keyboard gesture. If the grid column uses one of the built-in grid-column classes such as editable-text-column-mixin, then the cell-click or cell-key-down method that is supplied with the built-in column class will call write-cell-value internally. Otherwise an application may supply custom cell-click or cell-key-down methods that call write-cell-value. The default write-cell-value method (shown below) assumes that the common grid paradigm is being used where each grid row represents a data object (such as an employee) and each grid column represents an attribute of those objects (such as an employee's department).

;; default write-cell-value method
(defmethod write-cell-value ((row grid-row)(column grid-column) value)
  (let ((data-object (data-object row)))
    (and data-object
         (funcall (fdefinition (data-writer column))
                  value data-object))))

The default method may be used for cells that fit this paradigm if the application has therefore supplied data-object methods for the grid rows and data-reader methods for the grid columns. For grids that do not fit the object-rows-and-attribute-columns paradigm, the application could either supply a write-cell-value method that writes grid data to the application in a custom way, or else not use write-cell-value at all in its cell-click and cell-key-down methods.

See also read-cell-value and the description of the grid-widget.

Common Graphics and IDE documentation is described in About Common Graphics and IDE documentation in cgide.htm.

The documentation is described in introduction.htm and the index is in index.htm.

Copyright (c) 1998-2000, Franz Inc. Berkeley, CA., USA. All rights reserved.

Created 2000.10.5.