How to Assign Value to Parent form from Child Form (3 Merged) [message #545513] |
Wed, 29 February 2012 23:07 |
mvmkandan
Messages: 68 Registered: May 2010 Location: Trivendrum
|
Member |
|
|
Hi,
I have two forms, FormPARN, FormCHLD
One Text item is there in FormPARN, near to that Text item, Button is there.While clicking Button FormCHLD will be opened. Inside the FormCHLD, i will do some calculation and i need to store the result in FormPARN's Text Item.
How can i do it?
Thanks
Veera
|
|
|
|
Re: How to Assign Value to Parent form from Child Form (3 Merged) [message #545531 is a reply to message #545523] |
Thu, 01 March 2012 01:09 |
mvmkandan
Messages: 68 Registered: May 2010 Location: Trivendrum
|
Member |
|
|
First I will check with Global variable.
I have wrote coding in child form FORMCHLD as follows
-- the Trigger WHEN_BUTTON_PRESSED of EXIT Button
:global.TestVar1 := :Header.Text_Item1;
--:Header is the data block in Child Form
------
--in the Parent Form FORMPRNT
Call_form('FORMCHLD');
Message(:GLOBAL.Testvar1);
The output of the :Global.Testvar1 comes as 'NOTEXT'
Please find the mistake i made.
Thanks
Veera
|
|
|
|
|
|
Re: How to Assign Value to Parent form from Child Form (3 Merged) [message #545757 is a reply to message #545569] |
Fri, 02 March 2012 05:36 |
mvmkandan
Messages: 68 Registered: May 2010 Location: Trivendrum
|
Member |
|
|
Hi mughals_king,
Again it displays the value of the global variable '<NOTEXT>' only
I tried to trace as follows
-- the Trigger WHEN_BUTTON_PRESSED of EXIT Button
:global.TestVar1 := :Header.Text_Item1; --ex good morning
messsage(:GLOBAL.Testvar1); --message#2
--:Header is the data block in Child Form
------
--in the Parent Form FORMPRNT
:GLOBAL.Testvar1 := 'hi how are you';
messsage(:GLOBAL.Testvar1); --message#1
Call_form('FORMCHLD');
Message(:GLOBAL.Testvar1); --message#3
message#1 shows 'hi how are you'
message#2 shows 'good morning'
message#3 shows '<no text>'
Thanks
Veera
[Updated on: Fri, 02 March 2012 05:58] Report message to a moderator
|
|
|
|
|
|
Re: How to Assign Value to Parent form from Child Form (3 Merged) [message #546043 is a reply to message #545965] |
Sun, 04 March 2012 22:09 |
mvmkandan
Messages: 68 Registered: May 2010 Location: Trivendrum
|
Member |
|
|
Hi mughal,
in forms1 when-new-form-instance
:no:=:global.no;
and in forms2---passing parameter value from forms2 to forms1 from forms2 to forms1
when-button-pressed
:global.no:=:no;
open_form('c:\forms1.fmx');
in your code, its working fine. But if i change the global variable inside form2, it will not effect in form1.
Veera
|
|
|