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 maFonction($vo_POST : Object)->$vo_WebResponse : cs.bspkComponent.WebFormController
  // $vo_POST contains: vt_FieldValue (field values), triggerObject, etc.
  var $wfc : cs.bspkComponent.WebFormController
  $wfc:=cs.bspkComponent.WebFormController.new($vo_POST)
  // ... business logic ...
  $wfc.reloadBlock("maListbox")
  $wfc.sendAlert("success"; "Operation successful")
  return $wfc

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