Strange behaviour master-detail form
Hi,
So after much fiddling around I got my Master-Detail (MD) form working. Currently both the master and detail panels are visible at the same time one above the other. This works alright. When I enter new data in Master and press "commit" button, the data in master pane stays visible. When I press "add new row" in Detail panel, the value of PK is displayed in FK of Detail pane. All very well.
What I want to do now is to put master and detail in JtabbedPane format. Now this causes a problem, when I press "commit" in Master pane, the data in master pane just vanishes and when I press "add new row" in Detail panel, the value in PK of Master doesn't appear in FK of Detail panel.
Why so?
I have done the following steps
1. Create a new JClient Form. Actually I don't need a form but master-detail can not be created in JClient Panel.
2. Modified the master pane code by adding
public PanelExperimentViewMD1() //made public by Mahendra
//Added by Mahendra
JUMetaObjectManager.setBaseErrorHandler(new JUErrorHandlerDialog());
JUApplication app = JUMetaObjectManager.createApplicationObject("MAGEMLexport.ExperimentModule", null, new JUEnvInfoProvider());
panelBinding.setApplication(app);
panelBinding.executeIfNeeded();
try{
jbInit();
catch (Exception ex)
ex.printStackTrace();
3. Modify Detail panel code by adding the same line as above.
4. Created a JTabbedPane and added the above two panes to it using addTab method.
That's all. What I did do or didn't do to make this work just like the JClient Form I created earlier in which both panels are together?
Regards,
Mahendra
PS- If there is any other effective way of separating M-D panels, please let me know.
Hi,
All of you must be wondering why I want to disable navigation buttons.
Here is the full problem, may be there is a better solution.
I have a Person entity and a Description entity with 1..1 cardinality. Now Description can not exist without a Person but a Person can without a Description. So I used a Master-Detail view-link. However, I want to prevent user from entering more than one description into the Detail panel. To achieve this, I removed +, - buttons and navigation buttons in master and detail panel. The master panel opens in INSERT mode so I don't need +,- buttons in master panel and hence I don't need navifation buton either.
Hope this helps in defining my problem.
Mahendra
Similar Messages
-
Very strange behaviour master-detail-detail please help
Very strange behaviour master-detail-detail please help
Hello,
I have a parent-child-grandchild report which show's some really strange behaviour.
The data template has 3 queries Q1, Q2 and Q3.
Q2 is bound to Q1 using a bind variable
Q3 is bound to Q2 using another bind variable
For a certain record in Q1 the output should be
2 records in Q2
and 1 record in Q3 for each record in Q2
Q1 record
Q2 record A
Q3 record AA
Q2 record B
Q3 record BC
The results conforms to the expected output.
For another record in Q1 the output should be
2 records in Q2
and 2 records in Q3 for each record in Q2
Q1 record
Q2 record A
Q3 record AA
Q3 record AB
Q2 record B
Q3 record BC
Q3 record BD
In stead of the expected output, the result shows
Q1 record
Q2 record A
Q3 record AA
Q3 record AB
Q2 record B
Q3 record AB
For another record in Q1 the output should be
5 records in Q2
and 2 records in Q3 for each record in Q2
Q1 record
Q2 record A
Q3 record AA
Q3 record AB
Q2 record B
Q3 record BC
Q3 record BD
Q2 record C
Q3 record CE
Q3 record CF
Q2 record D
Q3 record DG
Q3 record DH
Q2 record E
Q3 record EI
Q3 record EJ
In stead of the expected output, the result shows
Q1 record
Q2 record A
Q3 record AA
Q3 record AB
Q2 record B
Q3 record BC
Q3 record BD
Q2 record C
Q3 record CE
Q3 record CF
Q2 record D
Q3 record DG
Q3 record DH
Q2 record E
Q3 record DH
So for the last record of Q2 I don't get the appropriate records from Q3 when there are multiple records to be shown, but only the last record which belongs to the previous Q2
What is going on?
Please help me out...
Kind regards,
Jan-MarcelHi Tim,
Thanks for your reply. Below you will find the datatemplate on the scott/tiger schema.
Please help me out.
Kind regards,
Jan-Marcel
<dataTemplate name="scott" description="Template scott" dataSourceRef="otcy001" version="1.1">
<parameters>
<parameter name="p_deptno" dataType="number"/>
</parameters>
<dataQuery>
<sqlStatement name="Q1">
<![CDATA[
select empno mgr_empno
, ename mgr_name
, job mgr_job
, hiredate mgr_hiredate
, sal mgr_sal
, comm mgr_comm
from emp
where deptno = nvl(:p_deptno, deptno)
and mgr is null
]]>
</sqlStatement>
<sqlStatement name="Q2">
<![CDATA[
select empno mgr2_empno
, ename mgr2_name
, job mgr2_job
, hiredate mgr2_hiredate
, sal mgr2_sal
, comm mgr2_comm
, mgr mgr2_mgr
from emp
where mgr = :mgr_empno
]]>
</sqlStatement>
<sqlStatement name="Q3">
<![CDATA[
select empno emp_no
, ename emp_name
, job emp_job
, hiredate emp_hiredate
, sal emp_sal
, comm emp_comm
, mgr emp_mgr
from emp
where mgr = :mgr2_empno
]]>
</sqlStatement>
</dataQuery>
<dataStructure>
<group name="G_mgr1" source="Q1">
<element name="q1_mgr_empno" value="mgr_empno"/>
<element name="q1_mgr_name" value="mgr_name"/>
<element name="q1_mgr_job" value="mgr_job"/>
<element name="q1_mgr_hiredate" value="mgr_hiredate"/>
<element name="q1_mgr_sal" value="mgr_sal"/>
<element name="q1_mgr_comm" value="mgr_comm"/>
<group name="G_mgr2" source="Q2">
<element name="q2_mgr_empno" value="mgr2_empno"/>
<element name="q2_mgr_name" value="mgr2_name"/>
<element name="q2_mgr_job" value="mgr2_job"/>
<element name="q2_mgr_hiredate" value="mgr2_hiredate"/>
<element name="q2_mgr_sal" value="mgr2_sal"/>
<element name="q2_mgr_comm" value="mgr2_comm"/>
<element name="q2_mgr2_mgr" value="mgr2_mgr"/>
<group name="G_emp" source="Q3">
<element name="q3_emp_empno" value="emp_empno"/>
<element name="q3_emp_name" value="emp_name"/>
<element name="q3_emp_job" value="emp_job"/>
<element name="q3_emp_hiredate" value="emp_hiredate"/>
<element name="q3_emp_sal" value="emp_sal"/>
<element name="q3_emp_comm" value="emp_comm"/>
<element name="q3_emp_mgr" value="emp_mgr"/>
</group>
</group>
</group>
</dataStructure>
</dataTemplate> -
Is this a bug? master rowid value lost when saving on a master/detail form
master/detail forms seem to lose the rowid after saving, if the unique identifier is set to ROWID
to reproduce the problem:
1) create a master detail form on DEPT/EMP
-- choose 'Managed by Database (ROWID)' on the 'Define Primary Key' page.
-- do not include master row navigation (but i don't think this matters)
-- choose 'Edit detail as tabular form on same page' on the 'Choose Layout' page
-- include the master report
2) on the master/detail page, change the conditional branch that returns to the master report page
-- the normal condition for this branch is request in SAVE,DELETE,CREATE
-- change it to request in DELETE,CREATE
3) run the form and save a change
-- saves fine, session shows the ROWID value is still set
4) save a second change
-- change does not save, form reverts to Create mode
this problem does not occur when using the primary key columns instead of rowid
see http://apex.oracle.com/pls/apex/f?p=60813:7 for the ROWID version
see http://apex.oracle.com/pls/apex/f?p=60813:11 for the PK column versionHi Saverio,
Bug *13563808* has been logged to track the reported issue, and a fix will be made available in a future release. Just to clarify, this issue is only arising when the APEX-generated Master-Detail is modified post-generation, so for users who have not modified their Master-Details using ROWID to manage their DML processes, they should not experience this issue.
In relation to my workaround, my suggestion works in my test environment, which I verified before posting the initial suggestion. Please note that the 'Reset Page' process is, by default, conditional on the "Delete" button being pressed. If you have made further modifications to your Master-Detail page, then this might explain why you're seeing different behaviour to me. You might using the "Debug" option on the Developer Toolbar useful. Viewing the debug information should help you to decipher what's going on/wrong on your page. If you still can't resolve the issue, then the safest option might be to revert the page back to it's original state, meaning the user navigates back to the Report page upon submitting changes to the Master-Detail Form page.
Regards,
Hilary -
Custom Master Detail form not working In EBS
Custom Master Detail form not working In EBS
Hi all,
I have two custom tables -- 1) XXX_DIE_Headers
2) XXX_DIE_LINES
I developed a Master Detail form based on above tables. XXX_DIE_Headers is the Master Block (Single record) & XXX_DIE_LINES is the detail block ( Multi line block ).
Yes, I used Appstand,Template.fmb for developing this form. The Master block has three fields out of which Two are required fields and i have given initial value for them.
As i deployed it in APPS(EBS),everything about it is working fine (insert,delete,master-detail behaviour) except querying.
When i press F-11 , It pops up a message "Do you want to save changes you have made" Choice - yes,no,cancel.
I don't want this message to pop up.
The scenario is :- I open the form.( without entering ) Press F11 . The message Pops up.
Please give me suggession on how to work it around so as form directly goes to query mode ,without popping the message.
regards
raviIt seems that you are changing a database value in your form, do you have any changes in WHEN-NEW-FORM-INSTANCE???
what the form is trying to tell you that you have changed something, do you want to save it?
I suggest you debug your form and see what's happening step by step.
Tony -
Can't add new detail record in Master Detail form
Hi ,
I've created a simple database application from scratch by initially selecting a Master Detail page. This generated a report page (for the parent ) and a form page (for the child ). On using the form to add a new child record the following error was generated:
Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-01400: cannot insert NULL into ("STUDENT1"."DELEGATE"."DELEGATE_ID"), insert into "STUDENT1"."DELEGATE" ( "DELEGATE_ID", "CLIENT_ID", "SURNAME", "INITIALS", "SEX", "SPECIAL_NEEDS") values ( :b1, :b2, :b3, :b4, :b5, :b6)
Error Unable to process update.
The 'child' field listed in the error message is automatically hidden on the form and I had presumed that on generating this form using the wizard that I would have had an opportunity to link the delegate_id field to a trigger or a sequence as seems to happen when creating a database application scratch using other page types. I'm new to Apex so I'd be grateful if anyone could let me know as to why this default behaviour occurs,
regards,
Kevin.I tried it for Apex 4.0.2 (my version) and 4.1 (on apex.oracle.com) and I am asked for master and detail PK generation in both versions.
What are your steps exactly in the wizard? Like this?
Create page -> Form -> Master Detail Form
Now you see a whole list of sub steps including "Primary Key Source".
Oh I see "Create Application wizard." in your post. Start with an empty application (blank page) and use the Create Page wizard instead. Maybe that's the difference.
Edited by: InoL on Nov 18, 2011 9:27 AM -
Master-detail form problem after upgrading to 4.1
Hello,
I have running Apex 4.0.2 instance on 11g2 database.
After upgrading to Apex 4.1 I have a problem with all Master-detail forms.
I'm able to open the one but detail region shows error 'failed to parse SQL query:
ORA-00923: FROM keyword not found where expected'.
All forms work correctly on 4.0.2 version.
If I migrate that 'SQL Query (updateable report)' region to 'Interactive report',
the form works fine on 4.1
What could be a problem?
Thanks
SasaHi Patrick,
I tried to make test application (the one master-detail page).
But when I copy the page from my application to test application, copied page in test
application works fine and because of that I didn't import test application to apex.oracle.com
Strange thing is that the column in detail table FAK_ID in the page of original application has
defined default value (P108_ID) but in the copied page in test application that column doesn't have
defined default value!?
I don't know if it's expected behavior...
Anywav, even if I set default value of FAK_ID column in test application, application works as expected.
I tried upgrade to 4.1 Apex version for three time but unfortunately I always got the same error in the master-detail page.
BR
Sasa -
Unable to View records in a master-detail form
In a master-detail form, I am not able to view records of the master/detail table
by accepting the values of the PK of the header table items.
Please tell me the exact steps, so that I can view the detail table records based on the header table PK items.
Thanks.Yes I wrote the LOV code in a different procedure. Now, the view is showing correctly. But I am now trying to update the viewed records.
The steps I am following in View Option is as below:
go_block('header');
clear_block(no_validate);
execute_query;
proc_lov;
go_block('item');
execute_query;
I am unable to commit the changes made in the blocks
The reason it is showing is : UNABLE TO update.....I saw the display_error.
The system is trying to update the PK part also..Why....Though PK party is clearly defined in the table as well as property palette. Pl. explain how to go about it. Uregent help is required once again. -
To attach a RTF template(Report for printing ) in the master detail form
I have an application in which I have 3 master detail forms of which one of the form is a gate pass form . Now this gate pass form has a report region as the detail.
All that i need help is to print the Gate Pass with few fields as information in the gate pass form , where an image or picture of the visitor is also a filed .
Now I have created an RTF Template which is the Gate pass layout with the pic.
So ultimately I have the application for the gate pass form and the RTF template ready with me .. Fixing this template with the application with a BUTTON called PRINT is the challenge am facing !
SELECT XVH.GPDATE
, TO_CHAR(XVH.VISITORTIMEIN, 'HH:MI') VISITORTIMEIN --, (XVH.VISITORTIMEIN )
, (TO_CHAR(XVH.VISITORTIMEOUT, 'HH:MI'))VISITORTIMEOUT
, XVH.VISITOR_NAME --, = XVH.PERSON_ID
, XVH.COMAPANY_NAME
, XVH.PURPOSE_OF_VISIT
, (SELECT A.FULL_NAME
FROM PER_ALL_PEOPLE_F A
WHERE A.PERSON_ID = XVH.PERSON_ID
AND SYSDATE BETWEEN A.EFFECTIVE_START_DATE AND A.EFFECTIVE_END_DATE) To_meet
, XVH.VISITOR_PHONE
,APPS.GETBASE64 (XVH.VISITOR_PHOTO)
FROM xxcdot.XXBCT_VGPF_HEADER XVH
WHERE XVH.GP_HEADER_ID = :P_HEADER_ID
This is the query for the template ..
Please help me with this. I am very new to apex and learning it with help of online tutPars I need another Help
I am working with a master detail form where in the form region i have a Radio group . Lets say the Radio group is
o Returnable
o Non Returnable
o Other
so when i select Non returnable I want a particular column called
Line Status to get Disabled .
I have done that by a dynamic action - using jquery statement (.Disable) .
Defining the element attributes as Disable .
Now the problem is that ,, Line status is getting disabled on the selection of Non returnable radio button. but unless and until i dont press the Add row button it does not work ,, else i will have to switch over between the radio buttons to get this action done !! -
Adding button to report to link to master detail form
I want to add a button to a report to direct me to a blank master detail form to insert a new record. I have used the following code in the additional PL/SQL code section:
htp.formopen('PORTAL30.wwa_app_module.new_instance?p_moduleid=1271601405');
htp.formsubmit('p_request','Create New');
htp.formClose;
When I click this I get 'Page Not Found'.
But if I hit refresh I am directed to the correct form with the same url.
Any ideas on what the issue is?
Thanks.Hi,
Check this sample code.
tables:sscrfields. "Fields on selection screens
selection-screen function key 1.
selection-screen function key 2.
Initialization.
sscrfields-functxt_01 = 'Report'.
sscrfields-functxt_02 = 'Exit'.
at selection-screen.
if sscrfields-ucomm = 'FC01'.
perform f_alv_sub.
elseif sscrfields-ucomm = 'FC02'.
endif.
Hope it helps. -
Search on Master Detail form/report
Hi,
I noticed that when I created a new application in Apex 4.01 basing the intial page on a Master Detail form/report, I was able to add a search item to the initial page. When I go to add another page with a different Master detail form/report, I did not have any option for adding a search item to the report page. Seems like an oversight?
I would appreciate any hints as to how to add same search item to my 2nd Master/Detail form/report.
Thanks,
PatMe too facing the some problem can some one pls help
-
Parameter on Master Detail Form
How do I set a bind variable in a Master Detail Form?
I suspect that he may have the same question I do. Namely, if I have four tables (employees, projects, tasks, and project_assignments) how do I create a master detail form where I can specify the project and the employee via LOVs? The project_assignments table contains foreign keys for employee, project, and task, as well as additional fields relating to the task status.
Currently, I have it set up so that the employee name can be selected and the project is hard coded to the current project.
Is there an easy way to populate the detail records based on two LOVs in the master form?
Thanks in advance,
Fritz -
Requerying on Master Detail form
Hi,
Does anyone know how to set up PL/SQL code to automatically requery on a master detail form after insert/update? For example, if I insert a record on the master part of the form, I would like that record to automatically show up after the insert/update. Also, if I insert a record on the detail part of the form, I would like that record to automatically show up after an insert/update.
Thanks,
MartinHi Krishnamurthy,
Thank you very much for the code. The code for the most part acts like I want it to except when I initally insert a master record. In my case, I have the form set up so you have to insert a master record before you can insert any detail records. Therefore, after the user clicks save, that master record needs to come up. The code you gave me only brings up the current master record if you are inserting detail records (which is great, that is what I want it to do). I have modified the code you gave me so when a user is just inserting the master record, the master record automaticaly comes up rather than the first record in the table. However my code makes the form run slow (about 13 seconds to save). Do you know of another way that I can make the form act like I want it to. Below is my code.
Thanks again,
Martin
declare
l_msg varchar2(255);
l_key_value number(10);
l_key_value2 number(10);
v_get_id number(9);
v_check_detail number(9);
CURSOR GET_ID IS
SELECT MAX(A.PCH_ID)
FROM PORTAL30.PCHEADER A;
CURSOR CHECK_DETAILS IS
SELECT DISTINCT B.PCD_ID
FROM PORTAL30.PCDETAILS B WHERE B.PCD_PHC_ID = v_get_id;
begin
/*get the key field value from the Master Detail form to requery the details since the form will be cleared out after update */
l_key_value := p_session.get_value_as_NUMBER(
p_block_name => 'MASTER_BLOCK',
p_attribute_name => 'A_PCH_ID',
p_index => 1
doSave;--- This is the default handler
OPEN get_id;
FETCH get_id into v_get_id;
CLOSE get_id;
OPEN check_details;
FETCH check_details into v_check_detail;
IF check_details%NOTFOUND
THEN
CLOSE check_details;
/*get the key field value from the Master Detail form to requery the details since the form will
be cleared out after update */
l_key_value2 := v_get_id;
/*get the message which is going to be displayed after update */
l_msg := p_session.get_value_as_varchar2(
p_block_name => 'MASTER_BLOCK',
p_attribute_name => '_STATUS');
/*now set the key field value in the Master Detail */
p_session.set_shadow_value(p_block_name => 'MASTER_BLOCK',
p_attribute_name => 'A_PCH_ID',
p_value => l_key_value2,
p_language => PORTAL30.wwctx_api.get_nls_language);
WWV_MASTER_GENSYS_1(p_block_name => null,
p_object_name => null,
p_instance => null,
p_event_type => null,
p_user_args => null,
p_session => p_session);
/*put the message(like 'Updated one master record' ) back in the screen */
p_session.set_value(p_block_name => 'MASTER_BLOCK',
p_attribute_name => '_STATUS',
p_value => l_msg);
p_session.set_value
(p_block_name => 'MASTER_BLOCK'
,p_attribute_name => '_MASTER_ACTION'
,p_value => 'NONE');
p_session.save_session();
ELSE
CLOSE check_details;
/*get the message which is going to be displayed after update*/
l_msg := p_session.get_value_as_varchar2(
p_block_name => 'MASTER_BLOCK',
p_attribute_name => '_STATUS');
/*now set the key field value in the Master Detail*/
p_session.set_shadow_value(p_block_name => 'MASTER_BLOCK',
p_attribute_name => 'A_PCH_ID',
p_value => l_key_value,
p_language => PORTAL30.wwctx_api.get_nls_language);
WWV_MASTER_GENSYS_1(p_block_name => null,
p_object_name => null,
p_instance => null,
p_event_type => null,
p_user_args => null,
p_session => p_session);
/*put the message(like 'Updated one master record' ) back in the screen*/
p_session.set_value(p_block_name => 'MASTER_BLOCK',
p_attribute_name => '_STATUS',
p_value => l_msg);
p_session.save_session();
END IF;
END; -
Master Detail Form - unable to add detail row
Dear,
I have a test application that runs for years on apex.oracle.com.
Since 3rd of june 2010 I am unable to add rows on a detail form.
Any ideas?
Help is welcome!
Kind regards
Lorenz4.0 Conversion Issue
Lorenz stated I can create the orderheader, but unable to create orderlines.Simply nothing happens, when I click the add row button.>
I share the same issue as Lorenz, on a Master/Detail form, I am able to create my Master row and but nothing happens when attempting to create detail rows. I was able to switch my application to theme 13 (Traditional Blue) from 2 (Blue and Tan) and was then able to create and add details rows.
My dilemma. When switching to theme 13 and others, none appear to support Two Level Tabs in the same manner as Theme 2. Essentially the applications look and feel is not going to go over well with my user base of 3+ years.
Is there another standard theme that will support Two Level Tabs like Theme 2 and allow the addition of detail rows on a Master/Detail form?
Is this a reported 4.0 conversion issue?
Jeff -
Master Detail Form - How 2 update a field in the Detail form using a query?
Hello,
I have a master detail form with, each master record having a fixed(6) number of detail records. One of the fields in the detail record is the PART_DESCRIPTION field. I am trying to update this field by querying Table_X. TABLE_X is in the format of (desciption id, description). Description id runs from 1 to 6.
When the form displays, the PART_DESCRIPTION field for the 6 detail records needs to be automatically populated with the six values of description stored in Table_X. How can this be done?
Tried using session storage objects, but made no headway.
Would greatly appreciate pointers on how to go about doing this.
Thanks.
DevIf you are on a Portal Version lesser than 3.0.9.8.3, then please try the following to populate
the PART_DESCRIPTION field.
Steps:-
1> Edit the form and go to the Additional PL/SQl section and put the following code in the
"...after displaying the page area" :-
declare
type t_vc_arr is table of varchar2(4000) index by binary_integer;
l_arr_desc t_vc_arr;
l_form_name varchar2(200);
l_form_state varchar2(500);
begin
l_form_name := p_session.get_module().get_name();
l_form_state := p_session.get_value_as_varchar2(
p_block_name => 'MASTER_BLOCK',
p_attribute_name => '_FORM_STATE'
if l_form_state = 'QUERY_AND_SAVE' then
select description
bulk collect into l_arr_desc
from <schema>.table_x;
htp.p('
<script>
var descArr = new Array();
var Fidx = 1;
var formObj = document.WWVM'||p_session.get_id()||';
var fieldName = "'||l_form_name||'.DETAIL_BLOCK.PART_DESCRIPTION.0";
for i in 1..l_arr_desc.count loop
htp.p('descArr['||to_char(i-1)||']="'||l_arr_desc(i)||'";');
end loop;
htp.p('
for (var i=0; i < formObj.length; i++){
if (formObj.elements.name == fieldName+Fidx){
formObj.elements[i].value = descArr[Fidx-1];
++Fidx;
htp.p('</script>');
end if;
end; -
How to create Insert & Update on master-detail form JPA/EJB 3.0
Is there any demonstration or tips how to Insert record on master-details form for JPA/EJB 3.0 with ADF binding?
I have master-detail forms (dept-emp). I drag the dept->operations->create method to JSF page. But when I click create button, only dept form is clear and ready for insert. But emp form is not clear. How can I add create method for this?
Can you give some example how to pass the right object to the persist or merge method so that it can save both the two objects (master-detail tables)
Thanks
Edited by: user560557 on Oct 9, 2009 8:58 AM
Maybe you are looking for
-
I came here to post because it seems my question wasn't posting when simply clicking on "ask this question".
-
Top level navigation appearing below the content area
Hi , I have modified the standard look and feel of the portal . We have our own masthead now and a custom footer as well . The problem is the top level navigation is appearing below the content area . I presume that there is a possibility of arrang
-
Is there a function I can call to get the Logical System of a source document?
-
How to set default new tab behaviour
I dare say I could have found the answer to this by trawling the web as it seems to be a problem that has been going on since the invention of tabbed browsing in firefox version 2. I just thought i'd go to the trouble of registering and re iterating
-
Updating Photoshop elements 10
When I go to Control Panel programs-Uninstall, there is no "Inspiration Browser, only Photoshop Elements 10 program