Hi Chris,

Since your Subform Widget will be set to Object type, you can try this approach.

Create the object method for you subform widget with the following code:

If (Form event=On Load)
    OBJECT Get pointer(Object current)->:=New object("subformName";OBJECT Get 
name(Object current))
End if

Basically you are create a new property to your Form-data of the Subform Widget 
named "subformName". Once the form is loaded, you can find out the name of your 
subform container from the context of your subform execution simply by calling:

    Form.subformName

HTH,
Add




On 7/8/19, 10:46 AM, "4D_Tech on behalf of Chris Belanger via 4D_Tech" 
<[email protected] on behalf of [email protected]> wrote:

    I am trying to create my own widgets. Widgets are subforms.

    In the parent form, I want the  INSTANCE bound variable to be an object.
    Inside the FORM METHOD of the widget (i.e. subform) I need to be able to 
find out the OBJECT NAME of the Parent INSTANCE of this widget.
    But I cannot find any command that will actually retrieve this information 
from within the widget’s form method when the INSTANCE is of type Object.

    In the subform’s method:
    OBJECT Get pointer(Object with focus) = nil
    OBJECT Get pointer(Object current) = nil
    OBJECT Get name(subform) = “”
    OBJECT Get pointer(Object subform container) = nil

    ————

    *** So how does the subform’s form method find out the name of its INSTANCE 
in the parent form? ***

    This is ridiculous if it cannot just because the bound variable is an 
object…

    Please, someone, put me out of my misery by sharing the secret. I cannot 
see why the widget’s method cannot find out ‘who it belongs to’.

    — Chris
    **********************************************************************
    4D Internet Users Group (4D iNUG)
    Archive:  http://lists.4d.com/archives.html
    Options: https://lists.4d.com/mailman/options/4d_tech
    Unsub:  mailto:[email protected]
    **********************************************************************

**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to