Purpose
Creates an object of class bVirtualFieldColumn.
Class
Type
Method
Syntax
bVirtualFieldColumn{
<oOwner>,
<oServer>,
<uExpression> | <uAccess>,
<symFieldMode>,
[<uArgument2>],
[<uArgument3>],
[<uArgument4>],
[<uArgument5>]
} Æ oVirtualFieldColumn
Arguments
<oOwner> | The owner of the column. This is the bBrowser in which the column is to be used. |
Data Type: | Object |
<oServer> | The server, with which the column is to be linked. The server is used to determined the column values. |
Data Type: | Object |
<uExpression> | An expression, with which the column is to be linked. If the expression is specified as string, this is converted automatically into a _Codeblock statement. The transformation is made by the instruction |
&("{|Server, Arg2, Arg3, Arg4, Arg5| "+uExpression+"}")
The arguments Arg2 to Arg5 can be specified by the arguments uArgument2 to uArgument5 (see further below). In combination with the server, the expression is used for determining the column values.
Data Type: | String | _Codeblock | Codeblock |
<uAccess> | Access in the server, with which the column is to be linked. The name of the access can be specified either as string or as symbol. In combination with the server, the access is used for determining the column values. |
Data Type: | String | Symbol |
<symFieldMode> | The mode that indicates whether in the third argument an expression or an access are specified. The following values are supported: |
Value |
Description |
#Expression |
The third argument is an expression, specified either as string or as _Codeblock statement. |
#Access |
The third argument is an access in the server, specified either as string or as symbol. |
Data Type: | Symbol |
uArgument2 .. 5 | The arguments that are to be passed to an expression (<symFieldMode> = # Expression) as arguments. |
Data Type: | Usual |
Return Value
oVirtualFieldColumn | The created object of the class bVirtualFieldColumn. |
Data Type: | bVirtualFieldColumn |
Description
bVirtualFieldColumn:Init() creates a new object of class bVirtualFieldColumn and initializes it.
Samples
In the following sample a virtual data column is created for editing order quantities.
LOCAL odbsCUSTOMER AS DBServer
LOCAL oBrowser AS bBrowser
LOCAL oColumn AS bVirtualFieldColumn
LOCAL oHyperLabel AS HyperLabel
// Create DBServer
odbsCUSTOMER := DBServer{"CUSTOMER"}
// Create browser
oBrowser := bBrowser{oOwner,;
1000,;
Point{0, 0},;
Dimension{300, 250}}
oBrowser:AutoCaptionHeight := TRUE
oBrowser:Editable := TRUE
// Set DBServer in browser and show the browser.
// -> The browser creates 2 data columns for the fields
// FIRSTNAME und LASTNAME automatically.
oBrowser:Use(odbsCUSTOMER, {#FIRSTNAME, #LASTNAME})
oBrowser:Show()
// Create virtual data column for editing order quantity
oColumn := bVirtualFieldColumn{oBrowser,;
odbsCUSTOMER,;
{|oServer| 0},;
#Expression}
oHyperLabel := HyperLabel{#Orders, "bBrowser"+CRLF+"Orders"}
oColumn:FieldSpec := FieldSpec{oHyperLabel, "N", 3, 0}
oColumn:CaptionView := bViewStyle{ , , BALIGN_CENTER}
oColumn:SuspendEmptyValues := TRUE
oColumn:CalculateWidth()
oBrowser:AddColumn(oColumn)
oBrowser:OpenColumn(oColumn, 1)
See Also
Page url: http://www.YOURSERVER.com/index.html?bvirtualfieldcolumn_init.htm