Home » Developer & Programmer » Forms » How to Assign Value to Parent form from Child Form (3 Merged) (Oracle 10g forms)
How to Assign Value to Parent form from Child Form (3 Merged) [message #545513] Wed, 29 February 2012 23:07 Go to next message
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 #545523 is a reply to message #545513] Thu, 01 March 2012 00:40 Go to previous messageGo to next message
Littlefoot
Messages: 21813
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Pass its value to another form through a parameter (a better solution) or a global variable (not that good solution; global variables' datatype is CHARACTER, you need to be careful and clear its value once you don't need it (otherwise it can still be used throughout the same session)).
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 Go to previous messageGo to next message
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 #545551 is a reply to message #545531] Thu, 01 March 2012 03:16 Go to previous messageGo to next message
cookiemonster
Messages: 13925
Registered: September 2008
Location: Rainy Manchester
Senior Member
It actually displays the word NOTEXT?
That would be a value in the child form that you assigned to the global then.

[Updated on: Thu, 01 March 2012 04:07]

Report message to a moderator

Re: How to Assign Value to Parent form from Child Form (3 Merged) [message #545567 is a reply to message #545551] Thu, 01 March 2012 03:54 Go to previous messageGo to next message
mughals_king
Messages: 392
Registered: January 2012
Location: pakistan
Senior Member
here is a little example for passing parameters from FormPARN, FormCHLD with fmb file
  • Attachment: forms1.fmb
    (Size: 40.00KB, Downloaded 1169 times)
Re: How to Assign Value to Parent form from Child Form (3 Merged) [message #545569 is a reply to message #545567] Thu, 01 March 2012 03:54 Go to previous messageGo to next message
mughals_king
Messages: 392
Registered: January 2012
Location: pakistan
Senior Member
2nd fmb file
  • Attachment: forms2.fmb
    (Size: 40.00KB, Downloaded 1182 times)
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 Go to previous messageGo to next message
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 #545761 is a reply to message #545757] Fri, 02 March 2012 05:56 Go to previous messageGo to next message
mughals_king
Messages: 392
Registered: January 2012
Location: pakistan
Senior Member
how its possible its working fine with me i have already tested

i made this test form specially for u and tested it here first

[Updated on: Fri, 02 March 2012 05:58]

Report message to a moderator

icon4.gif  Re: How to Assign Value to Parent form from Child Form (3 Merged) [message #545764 is a reply to message #545761] Fri, 02 March 2012 06:06 Go to previous messageGo to next message
mvmkandan
Messages: 68
Registered: May 2010
Location: Trivendrum
Member

Message#3 shows 'hi how are you' only

'good morning' is not displayed

thanks
veera

[Updated on: Fri, 02 March 2012 06:38]

Report message to a moderator

Re: How to Assign Value to Parent form from Child Form (3 Merged) [message #545965 is a reply to message #545764] Sat, 03 March 2012 16:45 Go to previous messageGo to next message
mughals_king
Messages: 392
Registered: January 2012
Location: pakistan
Senior Member
have u solved your problem


Example----Simple---


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');




Try hope it will work for u










[Updated on: Sat, 03 March 2012 17:00]

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 Go to previous message
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
Previous Topic: Generating sequence in Oracle forms
Next Topic: Hotel Reservation Form
Goto Forum:
  


Current Time: Fri Jul 05 23:14:04 CDT 2024