[VAS] Heterogeneous column in AbtContainerDetailsView fix



Problem:
When using more than one kind of data in the cells of a column in the
container details view, only the first cell in the column is displayed
correctly. Subsequent cells in the column are displayed as errors.

Solution:
The reason is that a converter is only calculated once per column. This
is correct behavior if a column's attributeName or its converter is
explicitly set.

However, if no attributeName or converter is explicitly set for a
column, VAS must derive a converter based on the contents of each cell
in the column when it is displayed.

The changes affect one method:
AbtContainerDetailsColumn>>cellValue:clientData:callData:

--Solveig Viste
Instantiations VA Smalltalk Support


--- cut here ---
!AbtContainerDetailsColumn privateMethods !

cellValue: aTableColumn clientData: clientData callData:
anEwCellValueCallbackData

| item aConverter attrName attrValue |

item := anEwCellValueCallbackData item.
item == nil
ifTrue: [
anEwCellValueCallbackData value: ''.
^self
].
attrName := self attributeName.
attrName size > 0
ifTrue: [
attrValue := item
valueOfAttributeNamed: attrName
ifAbsent: [ (self getMRIString: MsgBaseInvalidAttribute) replace:
attrName ].
anEwCellValueCallbackData value: attrValue.
]
ifFalse: [
attrValue := item. "use #self"
].

cellValueHandlers == nil
ifFalse: [ self callHandlers: cellValueHandlers with:
anEwCellValueCallbackData].
"With the AbtBufferedCollection, an intermediate nil value is
possible"
anEwCellValueCallbackData value == nil
ifTrue: [
anEwCellValueCallbackData value: ''.
^self.
].

( ((aConverter := self converter) == nil) or: [ self
isDerivedConverter ] ) "PQ68418. See senders of #isDerivedConverter"
ifTrue: [
"If the cell contains no converter, derive one.
If the cell contains a previously derived converter,
derive the converter again based on the value of the cell since
it may not match the type of data in the cell.."

aConverter := attrValue class untitledConverterClass = AbtConverter
ifTrue: [ nil ]
ifFalse: [ attrValue class untitledConverterClass new ].
self primConverter: aConverter.
self isDerivedConverter: aConverter notNil.
].

aConverter notNil
ifTrue: [
aConverter abtInitializeEditPolicyItems: self.
aConverter abtInitializeEwCellValueCallbackData:
anEwCellValueCallbackData
]
! !
--- cut here ---

.



Relevant Pages