This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com

Home

 
4D v20 R7
OBJECT Get subform container value

OBJECT Get subform container value 


 

OBJECT Get subform container value -> Function result 
Parameter Type   Description
Function result  Mixed in Current value of the subform container data source

The OBJECT Get subform container value command returns the current value of the data source bound with the subform container displayed in the parent form.

This command can only be used in the context of a form used as a subform. In any other context, it returns Undefined.

  • If the data source is an expression, the command returns the current value of the expression, evaluated since the last form event cycle. 
  • If the data source is an array, the command returns the array index (integer).

For more information on bound variables and form/subform interaction, see Managing the bound variable on developer.4d.com.

Example  

Given a main form and a subform that both have an Input form object: 

Inside the main form, the Input object and the Subform object are bound to the Form.numeric expression of type Numeric.

The main form's Input object and the subform's Input object both have the On Data Change property set via the Property list.

The subform's Form Method contains the following code: 

 If(Form event code=On bound variable change)
    Form.displayNumeric:=OBJECT Get subform container value
 End if

 

And inside the subform, the Input text's object method contains the following code: 

 

As a result, at runtime, updating the value of the main form's Input object also updates the value of the subform's Input object, and vice versa.



See also 

Form
OBJECT Get pointer
OBJECT SET SUBFORM CONTAINER VALUE

 
PROPERTIES 

Product: 4D
Theme: Objects (Forms)
Number: 1785

 
PAGE CONTENTS 
 
HISTORY 

Created: 4D v19 R5

 
ARTICLE USAGE

4D Language Reference ( 4D v20 R7)