| Allegro CL version 6.2 Object described on page has changed in 6.2 |
Arguments: grid-row grid-column row-number column-number 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. The row-number and column-number arguments define which replication of replicated rows or columns is being addressed (see section-count).
Typically write-cell-value 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) row-number column-number 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.
The row-number and column-number arguments are new to version 6.2. Applications that define methods on this generic function must add the new parameters to the method defintions. And any application calls to this generic function must pass the new arguments (just pass zeros to retain the old behavior). See the new example on the Examples tab of the Navigator dialog called Grid-widget: a basic replicated editable-text column to see how to write a write-cell-value method that uses these handy new arguments.
See also read-cell-value and the description
of the grid-widget
.
Copyright (c) 1998-2002, Franz Inc. Oakland, CA., USA. All rights reserved.
Documentation for Allegro CL version 6.2. The object described on this page has been modified in the 6.2 release; see the Release Notes.
Created 2002.2.26.
| Allegro CL version 6.2 Object described on page has changed in 6.2 |