Skip to content

Commit

Permalink
bf subform
Browse files Browse the repository at this point in the history
  • Loading branch information
vdelachaux committed Aug 13, 2024
1 parent 471e506 commit bca97dd
Showing 1 changed file with 36 additions and 4 deletions.
40 changes: 36 additions & 4 deletions UI/Project/Sources/Classes/subform.4dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Class extends scrollable

property form : cs:C1710.form

property parent : Object
Expand Down Expand Up @@ -35,6 +34,14 @@ Class constructor($name : Text; $events : Object; $super : Object; $form : Objec
This:C1470.isSubform:=True:C214

// MARK:Delegates 📦
var $detailForm : Text:=String:C10(This:C1470.detailForm)

If (Length:C16($detailForm)>0)

$form:=$form || Try(JSON Parse:C1218(File:C1566("/SOURCES/Forms/"+$detailForm+"/form.4DForm").getText()))

End if

This:C1470.form:=cs:C1710.form.new(This:C1470; $form)

// === === === === === === === === === === === === === === === === === === === === === === === === === ===
Expand All @@ -54,6 +61,10 @@ Function set data($data)
// Force an update to take account of changes
This:C1470.refresh()

Function execute($formula : 4D:C1709.Function)

This:C1470._execute($formula)

// MARK:-[Timer]
// === === === === === === === === === === === === === === === === === === === === === === === === === ===
/// Launch the timer in the sub-form.
Expand Down Expand Up @@ -111,17 +122,37 @@ Function getParentDimensions() : cs:C1710.dim

// === === === === === === === === === === === === === === === === === === === === === === === === === ===
/// Returns the names of the forms associated with the subform.
Function getSubforms()
Function getSubforms() : Object

var $detail; $list : Text
var $ptr : Pointer

OBJECT GET SUBFORM:C1139(*; This:C1470.name; $ptr; $detail; $list)

This:C1470.forms:={\
return {\
detail: $detail; \
list: $list}

// <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <==
Function get detailForm() : Text

var $detail; $list : Text
var $ptr : Pointer

OBJECT GET SUBFORM:C1139(*; This:C1470.name; $ptr; $detail; $list)

return $detail

// <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <==
Function get listForm() : Text

var $detail; $list : Text
var $ptr : Pointer

OBJECT GET SUBFORM:C1139(*; This:C1470.name; $ptr; $detail; $list)

return $list

// === === === === === === === === === === === === === === === === === === === === === === === === === ===
/// Sets the names of the forms associated with the subform.
Function setSubform($detail : Text; $list : Text; $table : Pointer) : cs:C1710.subform
Expand Down Expand Up @@ -217,4 +248,5 @@ Function _execute($formula : 4D:C1709.Function)
Function _getWidget($widget : Text) : Text

// Deal with the name of the form object or the name of an instance
return This:C1470.form[$widget].name || $widget
return This:C1470.form[$widget].name || $widget

0 comments on commit bca97dd

Please sign in to comment.