How to assign a value to a bBrowser VirtualColumn field?
Posted: Fri Oct 09, 2020 4:22 pm
In a VO bBrowser I have a VirtualColumn, defined in the browser as follows:
oVirtualColumn := bVirtualFieldColumn {SELF:odcbBrowser, oDB, {|oServer| 0}, #EXPRESSION}
oVirtualColumn:FieldSpec := FieldSpec {HyperLabel {#SPLITCOLUMN, "Split"}, "N", 8, 0}
oVirtualColumn:CaptionView := bViewStyle { , , BALIGN_CENTER}
oVirtualColumn:SuspendEmptyValues := FALSE
oVirtualColumn:PropertyPut(#EmptyValueCondition, {|x| x=NIL})bBrowser update
oVirtualColumn:Width := 40
SELF:odcbBrowser:AddColumn(oVirtualColumn)
SELF:odcbBrowser:OpenColumn(oVirtualColumn)
oVirtualColumn:Editable := TRUE
In a CellEdit method I arrange that the user can enter values straight from the bBrowser (while the other, DBF bound, fields can not be edited directly).
This works fine. But now I had the request to assign a value to a selection of bBrowser rows programmatically and I found that I couldn't figure out how that should be done.
A normal fieldput doesn't work, and :
oColumn:=SELF:oDCbBrowser:GetColumn(#SPLITCOLUMN)
auFieldData:=oColumn:DataList
won't work either because auFieldData collects only manually changed values so I can not insert the value in one of the underlying arrays.
Does anyone have a solution for this?
Dick
oVirtualColumn := bVirtualFieldColumn {SELF:odcbBrowser, oDB, {|oServer| 0}, #EXPRESSION}
oVirtualColumn:FieldSpec := FieldSpec {HyperLabel {#SPLITCOLUMN, "Split"}, "N", 8, 0}
oVirtualColumn:CaptionView := bViewStyle { , , BALIGN_CENTER}
oVirtualColumn:SuspendEmptyValues := FALSE
oVirtualColumn:PropertyPut(#EmptyValueCondition, {|x| x=NIL})bBrowser update
oVirtualColumn:Width := 40
SELF:odcbBrowser:AddColumn(oVirtualColumn)
SELF:odcbBrowser:OpenColumn(oVirtualColumn)
oVirtualColumn:Editable := TRUE
In a CellEdit method I arrange that the user can enter values straight from the bBrowser (while the other, DBF bound, fields can not be edited directly).
This works fine. But now I had the request to assign a value to a selection of bBrowser rows programmatically and I found that I couldn't figure out how that should be done.
A normal fieldput doesn't work, and :
oColumn:=SELF:oDCbBrowser:GetColumn(#SPLITCOLUMN)
auFieldData:=oColumn:DataList
won't work either because auFieldData collects only manually changed values so I can not insert the value in one of the underlying arrays.
Does anyone have a solution for this?
Dick