Extend "Call form" for Subforms

Hi,

we are using subforms a lot and often nested.
Some commands can only be called, if a form is completely initialized or like in the case of 4D Write Pro, if the command is called in the context of the form in which the 4D Write Pro Area is located.

Currently we need to know the path of object names (subforms) in order to get the call form in the right context.
Having this path we currently call
“Call form(current form window;“myMethod”;$collectionOfObjectNames;$Param1;…)”
and inside the method
if($1.length>0)
execute method in subform($1.shift();current method name;*;$Param1;…)
else
//Do the job
end if

This approach works, but

  • you need to know the nesting and this requires that you have to pass the names through every nesting step of subforms
  • it’s slow and cumbersome

The feature request:

  • New command: “Current form ref” (or extend “Current form window” with (*)) for getting an id to be used for calls of “call form”
  • Extend the command “Call form” to accept the “formId” and forward the call directly to the subform context.

This would simplify componentized development using forms in 4D extremely.

Best regards
Arnd Graf

Hi Arnd,
I’m interested… Is it the same kind of code than here?

Hi Arnaud,

the difference is that your code is for introspection as fare as I understand it and goes from top to bottom.
The focus of my request is to simply the use of subforms with commands that have timing issues (form needs to initialized) or context issues.

One good example is the use of the 4D Write Pro widget.
It does not work correctly, if the form in which the write pro area + widget is part of a subform.
It uses e.g. for showing the range of a bookmark “call form” to call the “wp select” on the level of the write pro area.

Regards
Arnd