Render functions
A renderFunction runs in the browser, not in 4D. In an event, set vt_ClassName to the literal string renderFunction and vt_FunctionName to one of the names below; the parameters go in vo_Param.
{ "vt_ClassName": "renderFunction", "vt_FunctionName": "showBloc",
"vo_Param": { "vt_BlocName": "<uuid of the block>" } }
There are 51 of them.
Reading the tables
- block: a block of the page, picked with the panel's block selector (
getBlocsNameCollection). When only some types are accepted, they are shown in square brackets.
- list: a value picked from a list supplied by the method named.
- filter: a parameter of type
objectFilter.
- required: the parameter must be filled in.
Show and hide
| Function | Parameters |
showBloc | vt_BlocName (block, required) |
hideBloc | vt_BlocName (block, required) |
toggleDisplay | vt_BlocName (block [wrapper, accordion], required)
vb_ToggleDisplay (boolean) |
showOnlyOneBlockInWrapper | vt_WrapperName (block, required)
vt_BlockName (block, required) |
hideBlockAccordingFieldValue | vt_BlockName (block)
vt_Comparison (list, BSPK_GET_LIST_COMPARISON_WF)
vt_Values (text) |
removeBlock | vt_getBlocToRemove (block) |
unloadBlock | vt_BlockName (block, required) |
openAccordion | vt_BlockName (block [accordion], required) |
closeAccordion | vt_BlockName (block [accordion], required) |
showModal | vt_BlockName (block [modal], required) |
closeModal | vt_BlockName (block [modal], required) |
Enable and disable
| Function | Parameters |
enableBlock | vt_BlockName (block, required) |
disableBlock | vt_BlockName (block, required) |
disableIfEmpty | filter
vt_BlockName (block [fieldText, fieldSelect, button]) |
actionAccordingNumberLine | filter
vt_BlockName (block, required)
vt_Action (list, BSPK_GET_LIST_RENDER_ACTION_WF, required) |
actionBlock | vt_BlockName (block, required)
vt_Selector (text)
vt_ActionName (text) |
removeRequiredIfNotEmpty | selector (text) |
Listbox
| Function | Parameters |
reloadListbox | vt_BlocName (block, required) |
listboxSearch | vt_BlockName (block [wrapper, accordion], required) |
unselectInListbox | vt_BlocName (block [listbox], required) |
removeFilters | vt_BlocName (block [wrapper, accordion], required) |
setInputWithSelectedRow | filter
vt_BlockName (block, required)
functionName |
copyColumn | filter
vt_ColumnNameToCopy (text) |
labelAccordingNumberLine | filter
vt_BlockName (block, required)
vt_LabelKey (text, required)
vt_LabelSelector (text) |
Inline editing popups
| Function | Parameters |
popupInputText, popupInputNumeric, popupInputDate, popupInputTime, popupInputMail, popupInputTel, popupInputPassword, popupInputTextarea | filter
className (text)
functionName (text)
vt_getBlocInfo (block)
vb_Required (boolean)
vb_MultiLang (boolean)
vt_DefaultValue (text) |
popupSelect | vt_Message (text) filter
vb_LoadInRender (boolean)
vt_ValuesClass (text)
vt_ValuesFunction (text)
className (text)
functionName (text)
vb_Required (boolean)
vb_TomSelect (boolean)
vb_Combobox (boolean)
vb_Multiple (boolean) |
popupMenu | vt_Message (text) filter
vb_LoadInRender (boolean)
vt_ValuesClass (text)
vt_ValuesFunction (text)
className (text)
functionName (text)
vt_getBlocInfo (block) |
Values and fields
| Function | Parameters |
setValue | vt_BlockName (block, required) |
emptyValueField | vt_BlockName (block [fieldText, fieldSelect]) |
toggleBoolean | (none) |
loadAttribute | vt_BlockName (block, required)
vt_Selector (text)
vt_AttributeName (text)
vt_Value (text) |
updateSlider | vt_BlockName (block) |
showPicker | vt_BlockName (block, required) |
triggerClick | vt_BlockName (block, required) |
Styling
| Function | Parameters |
addCssClasses | vt_BlockName (block)
vt_ClassesToAdd |
removeCssClasses | vt_BlockName (block)
vt_ClassesToRemove (text) |
Messages
| Function | Parameters |
alertMessage | vt_Message (text) |
confirmMessage | vt_Message (text)
vb_Bypass (boolean)
className (text)
functionName (text) |
openAlert | vt_AlertType (list)
vt_AlertTitle (text)
vt_AlertMessage (text) |
Navigation
| Function | Parameters |
link | vt_MenuUuid (URL)
vb_TargetBlank (boolean) |
goPreviousPage | (none) |
removeUrlParameters | (none) |
Device
| Function | Parameters |
activateQrScanner | vt_BlocName (block [qrCodeScanner], required) |
Other
| Function | Parameters |
otherRenderFunctions | vt_RenderFunction (text) |
Pitfalls
Fill block parameters with the panel's block picker. It writes the expected value; a value typed by hand, through the API or in a file, is the first thing to suspect when showBloc or hideBloc seems to do nothing.
reloadListbox is client-side. The server-side equivalent, called from a 4D function through the WebFormController, is displayListbox. Calling one where the other is expected does nothing at all.
Popup callbacks use className / functionName in vo_Param — without the vt_ prefix, unlike everything else. And the callback must return vo_Line for the cell to refresh without reloading the whole listbox.