Data and ORDA
Listbox - DataClass Connection
A BWEB listbox connects directly to a 4D DataClass via htmlProperties.vt_TableName.
{"htmlProperties": {"vt_TableName": "SUPPLIER", "vt_DisplayListboxType": "fill", "vc_FieldDisplay": [{"vt_FieldName": "name", "vb_DisplayField": true}, {"vt_FieldName": "email", "vb_DisplayField": true}]}}
The initial query can be customized via vt_FirstRequest (ORDA query or JSON collection).
Custom DataClass Functions
Functions callable from BWEB are declared in DataClass classes with the pattern:
Function myFunction( : Object)-> : cs.bspkComponent.WebFormController
// contains: vt_FieldValue (field values), triggerObject, etc.
var : cs.bspkComponent.WebFormController
:=cs.bspkComponent.WebFormController.new()
// ... business logic ...
.reloadBlock("myListbox")
.sendAlert("success"; "Operation successful")
return
Formulas
Listbox columns support formulas in vt_FieldFormula:
| Formula | Result |
|---|---|
| This.isPublished?"Published":"Draft" | Conditional text |
| This.firstName+" "+This.lastName | Concatenation |
| String(This.createdOn;"dd/MM/yyyy") | Date formatting |
REST API
BWEB exposes REST endpoints for interactions:
| Route | Description |
|---|---|
| /bweb/call-action | Server function call (button, form) |
| /bweb/get-block | Block reload |
| /bweb/upload | File upload |

