Skip to main content

Event Reference

Complete list of all available widgetEvent types in the Buildocs UI Engine system.

Event Constants​

When implementing your runEvent handler, you'll receive one of these event types in the widgetEvent field. All event names are uppercase.

Form Events​

Event ConstantValueDescription
OnInitONINITForm initialization - triggered when form loads
OnSaveONSAVEForm save - triggered when form save is requested
OnCancelONCANCELForm cancel - triggered when user cancels form
OnRefreshONREFRESHForm refresh - triggered when form needs to refresh
OnPrintONPRINTPrint request - triggered when user initiates print
OnPrintReturnContentsONPRINTRETURNCONTENTSReturn printable content from backend

Widget Events​

Event ConstantValueDescription
OnClickONCLICKButton click - triggered when button is clicked
OnChangeONCHANGEField change - triggered when field value changes
OnDeleteONDELETEDelete action - triggered when delete is requested
OnDownloadONDOWNLOADDownload action - triggered when download is requested

Datatable Events - Data Loading​

Event ConstantValueDescription
OnTableLoadDataONTABLELOADDATALoad table data - triggered when table needs data
OnTableEditLoadDataONTABLEEDITLOADDATALoad editable table data - for inline editing mode

Datatable Events - Row Actions​

Event ConstantValueDescription
OnTableRunActionEventONTABLERUNACTIONEVENTRow action (edit, delete, etc.) - triggered by row action buttons
OnTableEditRunActionEventONTABLEEDITRUNACTIONEVENTEditable row action - for inline editing operations
OnTableSelectRowEventONTABLESELECTROWEVENTRow selection - triggered when row is selected
OnRowCheckboxONROWCHECKBOXCheckbox click - triggered when row checkbox is clicked

Datatable Events - Batch Operations​

Event ConstantValueDescription
OnTableRunBatchActionEventONTABLERUNBATCHACTIONEVENTBatch action - triggered when operating on multiple rows

Datatable Events - Record Creation​

Event ConstantValueDescription
OnTableCreateRecordEventONTABLECREATERECORDEVENTCreate record - triggered when "Add New" is clicked in table
OnLoadNewRecordTemplatesONLOADNEWRECORDTEMPLATESLoad templates - provide template options for new records

Folder/Hierarchy Events​

Event ConstantValueDescription
OnFoldersLoadDataONFOLDERSLOADDATALoad folder tree data - for hierarchical navigation
OnFolderCreateRecordEventONFOLDERCREATERECORDEVENTCreate folder - triggered when "New Folder" is clicked
OnFolderEditRecordEventONFOLDEREDITRECORDEVENTEdit folder - triggered when folder is edited
OnFolderShareRecordEventONFOLDERSHARERECORDEVENTShare folder - triggered when folder sharing is requested

File Upload Events​

Event ConstantValueDescription
OnFileUploadONFILEUPLOADFile upload - triggered when files are uploaded
OnFileUploadCreateDocumentEventONFILEUPLOADCREATEDOCUMENTFile upload create document - for datatable file uploads

Signature/Workflow Events​

Event ConstantValueDescription
OnStartSignProcessONSTARTSIGNPROCESSStart signing - triggered when signature process starts
OnFinishSignProcessONFINISHSIGNPROCESSFinish signing - triggered when signature process completes

Advanced Events​

Event ConstantValueDescription
OnDirectRunFormEventONDIRECTRUNFORMEVENTDirect form event - for custom direct event handling
OnGetCustomResponseONGETCUSTOMRESPONSECustom response - return custom response structure

Usage in Code​

C# / .NET​

You can create a constants class in your project:

EventHandlerEvents.cs
public class EventHandlerEvents
{
// Form Events
public const string OnCancel = "ONCANCEL";
public const string OnDelete = "ONDELETE";
public const string OnDownload = "ONDOWNLOAD";
public const string OnChange = "ONCHANGE";
public const string OnClick = "ONCLICK";
public const string OnInit = "ONINIT";
public const string OnRefresh = "ONREFRESH";
public const string OnSave = "ONSAVE";

// Datatable Events
public const string OnTableRunActionEvent = "ONTABLERUNACTIONEVENT";
public const string OnTableRunBatchActionEvent = "ONTABLERUNBATCHACTIONEVENT";
public const string OnTableEditRunActionEvent = "ONTABLEEDITRUNACTIONEVENT";
public const string OnTableLoadData = "ONTABLELOADDATA";
public const string OnTableEditLoadData = "ONTABLEEDITLOADDATA";
public const string OnTableCreateRecordEvent = "ONTABLECREATERECORDEVENT";
public const string OnTableSelectRowEvent = "ONTABLESELECTROWEVENT";

// Folder Events
public const string OnFolderCreateRecordEvent = "ONFOLDERCREATERECORDEVENT";
public const string OnFolderEditRecordEvent = "ONFOLDEREDITRECORDEVENT";
public const string OnFolderShareRecordEvent = "ONFOLDERSHARERECORDEVENT";
public const string OnFoldersLoadData = "ONFOLDERSLOADDATA";

// File Upload Events
public const string OnFileUpload = "ONFILEUPLOAD";
public const string OnFileUploadCreateDocumentEvent = "ONFILEUPLOADCREATEDOCUMENT";

// Print Events
public const string OnPrint = "ONPRINT";
public const string OnPrintReturnContents = "ONPRINTRETURNCONTENTS";

// Checkbox Events
public const string OnRowCheckbox = "ONROWCHECKBOX";

// Signature Events
public const string OnStartSignProcess = "ONSTARTSIGNPROCESS";
public const string OnFinishSignProcess = "ONFINISHSIGNPROCESS";

// Template Events
public const string OnLoadNewRecordTemplates = "ONLOADNEWRECORDTEMPLATES";

// Advanced Events
public const string OnDirectRunFormEvent = "ONDIRECTRUNFORMEVENT";
public const string OnGetCustomResponse = "ONGETCUSTOMRESPONSE";
}

Usage Example:

[HttpPost("runevent")]
public async Task<IActionResult> RunEvent([FromBody] JsonElement requestBody)
{
var widgetName = requestBody.GetProperty("widgetName").GetString()?.ToUpper();
var eventType = requestBody.GetProperty("widgetEvent").GetString()?.ToUpper();

// Use constants instead of magic strings
if (widgetName == "savebtn" && eventType == EventHandlerEvents.OnClick)
{
// Handle save button click
}
else if (eventType == EventHandlerEvents.OnTableLoadData)
{
// Handle table data loading
}
else if (eventType == EventHandlerEvents.OnFileUploadCreateDocumentEvent)
{
// Handle file upload
}

return Ok(response);
}

PHP​

Create a constants class:

EventHandlerEvents.php
<?php

class EventHandlerEvents
{
// Form Events
const OnCancel = 'ONCANCEL';
const OnDelete = 'ONDELETE';
const OnDownload = 'ONDOWNLOAD';
const OnChange = 'ONCHANGE';
const OnClick = 'ONCLICK';
const OnInit = 'ONINIT';
const OnRefresh = 'ONREFRESH';
const OnSave = 'ONSAVE';

// Datatable Events
const OnTableRunActionEvent = 'ONTABLERUNACTIONEVENT';
const OnTableRunBatchActionEvent = 'ONTABLERUNBATCHACTIONEVENT';
const OnTableEditRunActionEvent = 'ONTABLEEDITRUNACTIONEVENT';
const OnTableLoadData = 'ONTABLELOADDATA';
const OnTableEditLoadData = 'ONTABLEEDITLOADDATA';
const OnTableCreateRecordEvent = 'ONTABLECREATERECORDEVENT';
const OnTableSelectRowEvent = 'ONTABLESELECTROWEVENT';

// Folder Events
const OnFolderCreateRecordEvent = 'ONFOLDERCREATERECORDEVENT';
const OnFolderEditRecordEvent = 'ONFOLDEREDITRECORDEVENT';
const OnFolderShareRecordEvent = 'ONFOLDERSHARERECORDEVENT';
const OnFoldersLoadData = 'ONFOLDERSLOADDATA';

// File Upload Events
const OnFileUpload = 'ONFILEUPLOAD';
const OnFileUploadCreateDocumentEvent = 'ONFILEUPLOADCREATEDOCUMENT';

// Print Events
const OnPrint = 'ONPRINT';
const OnPrintReturnContents = 'ONPRINTRETURNCONTENTS';

// Checkbox Events
const OnRowCheckbox = 'ONROWCHECKBOX';

// Signature Events
const OnStartSignProcess = 'ONSTARTSIGNPROCESS';
const OnFinishSignProcess = 'ONFINISHSIGNPROCESS';

// Template Events
const OnLoadNewRecordTemplates = 'ONLOADNEWRECORDTEMPLATES';

// Advanced Events
const OnDirectRunFormEvent = 'ONDIRECTRUNFORMEVENT';
const OnGetCustomResponse = 'ONGETCUSTOMRESPONSE';
}

Usage Example:

public function runEvent(Request $request) {
$requestData = $request->json()->all();
$widgetName = strtoupper($requestData['widgetName'] ?? '');
$eventType = strtoupper($requestData['widgetEvent'] ?? '');

// Use constants instead of magic strings
if ($widgetName === 'savebtn' && $eventType === EventHandlerEvents::OnClick) {
// Handle save button click
}
elseif ($eventType === EventHandlerEvents::OnTableLoadData) {
// Handle table data loading
}
elseif ($eventType === EventHandlerEvents::OnFileUploadCreateDocumentEvent) {
// Handle file upload
}

return response()->json($response);
}

Event Categorization​

User Interaction Events​

Events triggered directly by user actions:

  • OnClick, OnChange, OnCancel, OnDelete, OnDownload

Data Loading Events​

Events that require loading data:

  • OnInit, OnTableLoadData, OnTableEditLoadData, OnFoldersLoadData

Data Modification Events​

Events that modify data:

  • OnSave, OnTableRunActionEvent, OnTableEditRunActionEvent, OnTableRunBatchActionEvent

File Operations​

Events related to file handling:

  • OnFileUpload, OnFileUploadCreateDocumentEvent, OnDownload

Workflow Events​

Events for business processes:

  • OnStartSignProcess, OnFinishSignProcess

Best Practices​

  1. Use Constants - Always use constants instead of hardcoded strings
  2. Case Insensitive - Convert event types to uppercase for comparison
  3. Event Grouping - Group related events in your handler for better organization
  4. Validation - Always validate that required data is present for each event type
  5. Error Handling - Implement proper error handling for each event type