How to pass values from one form to another form? [message #204703] |
Tue, 21 November 2006 16:45 |
smulukutla
Messages: 45 Registered: May 2006
|
Member |
|
|
We have a form which has two List items, one has month and second list has Branches. When we press the button in this form, it should call another form and it has same two list items and the data from form one should automatically pop up in the second form list items.
Please let me know how to achieve this.
I tried by passing parameter from calling form(form 1) to called from(form 2). Still, the data is not automatically populating in second form.
Thanks.
|
|
|
|
Re: How to pass values from one form to another form? [message #204711 is a reply to message #204703] |
Tue, 21 November 2006 18:04 |
smulukutla
Messages: 45 Registered: May 2006
|
Member |
|
|
In the calling from for the List Item in the when_button_pressed trigger, I wrote the query:
DECLARE
pl_id PARAMLIST;
pl_name VARCHAR2(10) := 'My_list';
BEGIN
pl_id := GET_PARAMETER_LIST(pl_name);
IF ID_NULL(pl_id) THEN
message('Created Parameterlist '||pl_name);
pl_id := CREATE_PARAMETER_LIST(:MONTH);
ELSE
DESTROY_PARAMETER_LIST(pl_name); --'GPMBRANCH.MONTH');
pl_id := CREATE_PARAMETER_LIST(:MONTH);
END IF;
message('Mesage'||:MONTH);
call_form('/export/home/mulukut/md.fmx',no_hide,do_replace,no_query_only,pl_id);
end;
In the called form, I have defined a parameter pl_id and In the when_new_form_instance I wrote the query:
:GPMBRANCH.MONTH := PARAMETER.pl_id;
Please let me know, what else I need to do?
Please help me if you have any query.
Thanks,
Sailaja.
|
|
|
|
|
|
Re: How to pass values from one form to another form? [message #205174 is a reply to message #204703] |
Thu, 23 November 2006 13:57 |
smulukutla
Messages: 45 Registered: May 2006
|
Member |
|
|
In the Calling form I have a poplist(MONTHLIST) and it has list of values from January to December. I have button in ths calling form, If I select January from the list and press the button,
it will take to the called form. In the called form, again I have the same poplist which has the same month list, but it should show the January in the list.
How to acheive this?
Please tell me if you have any code?
Once again thank you so much.
|
|
|
|
|
Re: How to pass values from one form to another form? [message #205448 is a reply to message #204703] |
Fri, 24 November 2006 23:12 |
smulukutla
Messages: 45 Registered: May 2006
|
Member |
|
|
Hi David,
Let me explain you in detail with my problem:
I have a calling form and it has a poplist for month.
And also I have a button in the calling form.
When I press the button, it will call another form and it has also the poplist for month.
When I select July from calling form and press the button,
it will take to called form and has to display July in the poplist.
So far, with my coding, it is not displaying in the poplist list directly. The July is displayed in the Dropdown list.
How to achieve this? Also, I tried setting up the initial value, no use.
My code in the calling form W_N_I_I trigger is:
DECLARE
group_id RecordGroup;
list_id Item := Find_Item('GPMBRANCH.MONTHLIST');
status NUMBER;
rg_name varchar2(40) := 'recgroup';
BEGIN
clear_list(list_id);
group_id := Find_Group(rg_name);
IF NOT id_null(group_id) then
Delete_Group(group_id);
End if;
group_id := Create_Group_From_Query(rg_name, 'SELECT MONTH, MONTH FROM GPMBRANCH');
status := Populate_Group(rg_name);
Populate_List(list_id, group_id);
END;
And also, in the Calling form, W_B_P trigger:
DECLARE
pl_id PARAMLIST;
pl_name VARCHAR2(10) := :GPMBRANCH.MONTHLIST;
BEGIN
pl_id := GET_PARAMETER_LIST(pl_name);
IF NOT ID_NULL(pl_id) THEN
DESTROY_PARAMETER_LIST(pl_name); --'GPMBRANCH.MONTH');
END IF;
pl_id := CREATE_PARAMETER_LIST(pl_name);
ADD_PARAMETER(pl_id, 'xx', TEXT_PARAMETER, :GPMBRANCH.MONTHLIST); --:MONTH, TEXT_PARAMETER, :GPMBRANCH.MONTH);
call_form('/export/home/mulukut/m2.fmx',no_hide,do_replace,no_query_only,pl_id);
message('Created Parameter'||pl_name);
end;
In the called form W_N_I_I I wrote:
DECLARE
group_id RecordGroup;
list_id Item := Find_Item('GPMBRANCH.MONTHLIST1');
status NUMBER;
rg_name varchar2(40) := :PARAMETER.xx;
BEGIN
clear_list(list_id);
group_id := Find_Group(rg_name);
IF NOT id_null(group_id) then
Delete_Group(group_id);
End if;
group_id := Create_Group_From_Query(rg_name, 'SELECT distinct :PARAMETER.xx, :PARAMETER.xx FROM dual' );
status := Populate_Group(rg_name);
Populate_List(list_id, group_id);
message('status'||status);
END;
Thanks,
Sailaja,
[Updated on: Sun, 26 November 2006 21:54] by Moderator Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|