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:

FormulaResult
This.isPublished?"Published":"Draft"Conditional text
This.firstName+" "+This.lastNameConcatenation
String(This.createdOn;"dd/MM/yyyy")Date formatting

REST API

BWEB exposes REST endpoints for interactions:

RouteDescription
/bweb/call-actionServer function call (button, form)
/bweb/get-blockBlock reload
/bweb/uploadFile upload