Master/Detail form with modal edit

I have a master/detail form that I generated using the wizard that I want to change to have a modal Edit button; i.e. the behavior I want is that the form view is initially read-only and you then have to click an Edit button to make the form editable.
I figured out how to do this for the master row by making the edit button redirect back to the same page with the request set to 'EDIT' and then making all the page items read-only with a condition REQUEST <> 'EDIT'.
I cannot find a good way to do this for the detail rows, which are actually a report with editable columns. The problem is that the 'Tabular Form Element' section of the 'Column Attributes' page does not have a read-only condition.
The only work around I can come up with so far is to have a second read-only report region with the same SQL query and then display either the editable or non-editable report region conditionally depending on whether the request is EDIT. But this obviously not ideal (having same SQL in two places, etc.).
If anyone can think of a better way to do this, I'd be grateful.
HTML DB Team: Can you log the addition of a read-only condition attribute on editable report columns as an enhancement request?

Simply add the lookup table to the FROM clause and join its PK with the FK in the master table in your query. That's basic SQL, and you definitely must get a good grasp of SQL to do more than very basic work in APEX.
For a good example, please see http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10498/build_app.htm#BCEBJJGB
While you're at it, read and implement the tasks outlined in the 2 Day + Application Express Developer's Guide - http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10498/toc.htm. After that, read the "Oracle Application Express 3.0-- Building a Functional Application" OBE in http://www.oracle.com/technology/obe/apex/obe30/apexdev30.htm - great stuff.
Georger

Similar Messages

  • Master Detail Form with Report - Referring a column in another table

    I have master detail form with a report option. The master table has a column that also references a look up table.
    When the report is displayed the lookup column id is displayed. Rather I want to get the look-up value from a lookup table
    and display in the report.
    When I see the report region Query definition , it just has the columns to add/remove only from the master table.
    Could you pls help me with this regard.
    Eg :
    Dept Table
    dept_id
    dept_name
    location_id
    Employee Table
    employee_id
    employee_name
    dept_id
    location
    location_id_id
    location_name
    Master is Dept, Detail is dept and lookup table is location.

    Simply add the lookup table to the FROM clause and join its PK with the FK in the master table in your query. That's basic SQL, and you definitely must get a good grasp of SQL to do more than very basic work in APEX.
    For a good example, please see http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10498/build_app.htm#BCEBJJGB
    While you're at it, read and implement the tasks outlined in the 2 Day + Application Express Developer's Guide - http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10498/toc.htm. After that, read the "Oracle Application Express 3.0-- Building a Functional Application" OBE in http://www.oracle.com/technology/obe/apex/obe30/apexdev30.htm - great stuff.
    Georger

  • Master Detail Forms with 2 composite primary keys - Is there a workaround?

    Hello All,
    I have been searching for a workaround to the maximum 2 part primary key restriction on the multi-row updates, and master-detail forms, and am hoping that someone can help me. I am using HTMLDB v2.0.0.00.49 with IE 6 against a 9.2 DB.
    I successfully implemented the workaround of Fred Stoopendaal's (see Updata PK on HTML DB ) and it works fine for single page multi-record updateable forms, but alas I haven't been able to extend it to master detail forms (I think it is something to do with Oracle not allowing the "returning" clause on views).
    Here is what I tried:
    two tables, one with a 2 part composite primary key, which is the master table, and a detail table with 3 part composite primary key -
    --------- BEGIN SQL ---------
    create table master_table
    ( master_col1 number
    , master_col2 number
    , master_col3 varchar2(30)
    , constraint master_pk primary key (master_col1,master_col2));
    create table detail_table
    (detail_col1 number
    ,detail_col2 number
    ,detail_col3 number
    ,detail_col4 varchar2(30)
    , constraint detail_pk primary key(detail_col1,detail_col2,detail_col3)
    , constraint master_detail_fk foreign key (detail_col1,detail_col2) references master_table(master_col1,master_col2));
    create or replace view v_master_table as
    select rowid mata_rowid,mata.*
    from master_table mata;
    create or replace view v_detail_table as
    select rowid deta_rowid,
    (select rowid from master_table mata where mata.master_col1 = deta.detail_col1 and mata.master_col2 = deta.detail_col2) deta_mata_rowid
    , deta.*
    from detail_table deta;
    create or replace trigger mata_ins_upd_trg
    instead of insert or update on v_master_table
    referencing new as new old as old
    for each row
    begin
    if inserting then
    insert into master_table (master_col1, master_col2, master_col3)
    values (:new.master_col1, :new.master_col2, :new.master_col3);
    end if;
    if updating then
    update master_table
    set master_col1 = :new.master_col1,
    master_col2 = :new.master_col2,
    master_col3 = :new.master_col3
    where rowid = :old.mata_rowid;
    end if;
    end;
    create or replace trigger deta_ins_upd_trg
    instead of insert or update on v_detail_table
    referencing new as new old as old
    for each row
    begin
    if inserting then
    insert into detail_table ( detail_col1, detail_col2, detail_col3, detail_col4)
    values (:new.detail_col1, :new.detail_col2, :new.detail_col3, :new.detail_col4);
    end if;
    if updating then
    update detail_table
    set detail_col1 = :new.detail_col1,
    detail_col2 = :new.detail_col2,
    detail_col3 = :new.detail_col3,
    detail_col4 = :new.detail_col4
    where rowid = :old.deta_rowid;
    end if;
    end;
    --------- END SQL ---------
    Then I created a master-detail form in Apex on the two views, using the mata_rowid and deta_rowid as primary keys, and mata_rowid=deta_mata_rowid as the link. I realise that using a function to fetch the master rowid within the detail view query is costly, but it was my intention to modify the record fetch queries to use the real FK columns once things were up and running.
    It seems to generate the pages ok, and I can insert/update master table records, but as soon as I modify records in the detail table things go a bit haywire. I can't find any documentation on how the inbuilt MRU/MRD logic works, so can't figure out the issue.
    Can anyone out there tell me what the problem is with the logic above, or if they have come up with a neat solution to this annoying limitation. I know that many will say that I should modify the data model to use surrogate primary keys, but many of the uses for HTMLDB are new interfaces for old schemas, so a workaround that doesn't involve wholesale data model changes would be preferable.
    Thanks in advance,
    Mike Cretan

    Hi, this is likely not the most elegant way...but perhaps the simplest -- and I didn't have much time to play.
    I used Wizard to create two separate Master Detail forms, each with a separate detail table. Thus I ended up with four pages:
    Page "A" - "Selector" page for Master (Report), with Edit link driving to Detail-1
    Page "B" - Editable Master/Detail-1 page (HTML / Report)
    Page "C" - "Selector" page for Master (Report), with Edit link driving to Detail-2
    Page "D" - Editable Master/Detail-2 page (HTML / Report)
    Then I selected the primary key column TWICE on the Report on Page A. Modified the second instance of this column to navigate to Page D (passing primary key) exactly the way the original instance of this column navigates to Page B. Then I deleted Page C.
    Since you can have only one Tabular Entry form per page, this seemed the best way to drive two separate detail tables from a common interface.

  • Error "field required" in master-detail form with FORMS 10G!!

    I have a Master-Detail Form.
    When the cursor stay in detail block and i chage the master record with the mouse, clicking in scroll bar, i get error "field required".
    In Forms 6i, works fine!!

    Master block has more than one record displayed. When I click on any item in detail (except first one) and then click on different master record (return navigation to master block, but not current record) I have FRM-40202: Field must be entered on first item in detail block.
    I found that reason is this part of clear_all_master_details procedure (automatically created by Oracle Forms):
    IF :System.Cursor_Item <> startitm THEN
    Go_Item(startitm);
    Check_Package_Failure;
    END IF;
    Does any have same experience?
    Is it Oracle bug or I am missing something?

  • Populate row of master detail form with selection from LOV?

    Hi Guys,
    Total noobe, Hope you can help me out with a project I am working on in Oracle Apex 4.1 with 11g XE
    I am sure this is a simple enough issue but I just can’t see the solution.
    I have a table called ‘STOCK’ this contains all new parts and delivery details.
    ‘STOCK_ID’ NUMBER PK
    ‘DELIVERY DATE ‘ DATE
    ‘PART’ VARCHAR2
    ‘PART_SN’ VARCHAR2
    ‘PART_AN’ VARCHAR2
    ‘INSTALLED’ CHECKBOX
    I have a table that list all the current physical locations of hardware for example
    ID, Till number, store location etc…
    I have an table to list the devices and modification to the hardware in these store locations.
    Move Date, Device, Device Serial number, Device Asset Number, Comments
    I have a report & form that displays all the current physical locations of hardware and a master detail form linked to this to add devices and modifications to each store location.
    I have a LOV setup on the Devices column that is based on a simple select query
    SELECT PART from STOCK
    ORDER BY 1
    This provides me the list of parts in the stock table.
    What I need to figure out is how do I get the data from the ‘STOCK’ table when I select a part in the LOV to auto populate ‘DEVICE_SN’ ‘DEVICE_AN’ in my master detail tubular form. this information is contained in the 'PART_SN' & 'PART_AN' columns of the STOCK table.
    I also need to figure out how to identify the part because by default the LOV only displays one column and I have no idea which part I am selecting other than by name. i could use a popup LOV and scan a barcode into the search box and get the retuen value to display the part name in the field.
    I also would like to reduce the number of records displayed in the LOV by using the ‘INSTALLED’ checkbox i.e. if checked this part has been used and will not be available for selection. The ‘PART_SN’ field can be duplicated as we often get the same part back again as a replacement after repair but this should be valaditated against i.e if the parts is ticked as installed and not available for selection in the list it can be added again this could possibly be validated based on the ‘DELIVERY DATE‘?
    I hope this make some sense to you guys if you need any further details let me know.
    Cheers
    Darren

    Hi,
    I am from the Oracle Forms background too and I have been using Oracle Apex for a while. Oracle Forms is just like client-server application although it uses the Forms servlet to render its Web front-end. I think...if you're really trying to develop true-Web application, you should try to forget such features as "master with many details" in Oracle Forms. Loading all the details in a single page will cause overheads anyway. When you discover more about ajax and such third-party javascript libraries as jquery and mootools, you'll have a different mind of Web development.
    Thanks.
    Andy

  • Master - Detail Form with multiple children

    Hi,
    I have managed to create a Master - Detail form in APEX with 2 child tables. For evey parent it brings back the associated child records from the
    2 tables in 2 regions.
    I am having a problem with the Add Row buttons. I copied the button from region 1 ( child 1) to region 2 (child 2). Re-named them (AddRows2).
    When I hit hit Child2 Add Rows, it adds the row to Child 1 region. I suspect it's got something to do with the MRU Process, so I created another
    one called MRU2, based on button Addrows2/ Child table 2. Seems logical, but it still creates the new record in Region 1 ( Child 1).
    Any ideas or examples,
    Thx.

    Hi,
    I am from the Oracle Forms background too and I have been using Oracle Apex for a while. Oracle Forms is just like client-server application although it uses the Forms servlet to render its Web front-end. I think...if you're really trying to develop true-Web application, you should try to forget such features as "master with many details" in Oracle Forms. Loading all the details in a single page will cause overheads anyway. When you discover more about ajax and such third-party javascript libraries as jquery and mootools, you'll have a different mind of Web development.
    Thanks.
    Andy

  • Master-Detail Forms with read-only data in Master

    I have a Master-Detail form created in Portal in which the master has fields that have select access (this has corporate bio/demo data) with the detail section having full access (local data).
    When I go to create the form, it will not compile since it generate a DELETE code on master records.
    The view I have has a master corporate record with people in depts adding detail records.
    I am running Portal 3.0.9.

    Hi,
    This is a bug. The only workaround would be is to write your own custom event and write your own code to do all that is done in onsave.
    Thanks,
    Sharmila

  • Master-details tables with popup edit form : popup doesn't zynchronized

    In first, we don't use "Task Flow".
    We have 1 table master and 1 table details.
    Each of these tables shows an Edit button to open a popup formular.
    This formular is based on the same view object than the table below.
    The trouble is that :
    1. The user moves the current row on the table "Master".
    The table "Detail" refreshes automatically (partial trigger based on the table "Master").
    Click on the Edit Button, on table "Detail" shows the popup formular on current detail row.
    2. The user changes the current row on the table "Master".
    The table "Detail" refreshes automatically (partial trigger based on the table "Master").
    But, Click on the Edit Button, on table "Detail" shows the popup formular on the same previous detail row. The trouble is that the popup formular is not correctly refreshed.
    Failed Tries :
    We add a partial trigger on the detail popup formular, based on :
    a) an item from the Master Table
    b) the MasterTable
    c) the Detail Table
    Without success.
    screenshots:
    1) master table row 1 : [master : ok|http://img87.imageshack.us/img87/5699/sanstitrevs.jpg]
    2) master table row 3 : [master change row : ok|http://img14.imageshack.us/img14/6242/sanstitre2ef.jpg]
    3) detail table, row 1 : [slave row : ok|http://img8.imageshack.us/img8/9392/sanstitre3ay.jpg]
    4) detail table, other row : [slave other row : ko always first detail row data|http://img17.imageshack.us/content.php?page=done&l=img17/5923/sanstitre4bx.jpg&via=mupload]

    On the popup control, try switching the popup's contentDelivery property to lazyUncached.
    CM.

  • 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.
    Dev

    If 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 determine the ROWNUM in a Master Detail Form

    Hello,
    I am working in a Master Detail Form with Orders and Order Items Information; and I created a process that allows the users to select a Product ID on a tabular form, and the next column is populated automatically with the Product Description.
    To achieve that, I followed some instructions by Denes Kubicek (http://apex.oracle.com/pls/otn/f?p=31517:241), but my case is slightly different:
    <ul>I am using a wizard-created tabular form, instead of a manual tabular form; and </ul>
    <ul>Instead of using another page as a Popup to pass the parameter of the ROWNUM, I am using a plug-in called “Tabular Form Super LOV” which is a modified version of the SkillBuilders’ Super LOV that works on Tabular Forms. </ul>
    The Product ID is returned in the correct row by the plug-in; but in the case of the Product Description, it is always returned into the first row; and my problem is that I don't know how to determine the row where the user clicked to call the plug-in.
    I set up an example in apex.oracle.com in case someone would like to look at it:
    Workspace: ediazjorge
    Username: test
    Password: test
    App Name: Sample App
    App Number: 1550
    BTW, I am using Apex 4.1.1.00.23 and Oracle DB 10.3.2.
    Thanks in advance,
    Erick

    Hello VC,
    Thank you for your time and help.
    Unfortunately, it is still not working properly:
    1. When the Popup LOV opens, the first row of the tabular form is 0, the second row is 1, and so on. How can I assign the values starting with 1 and in the format *0001* ? (I am still a novice on Apex and new to JavaScript :-), sorry about that).
    --2. Also, when I close the Popup LOV, the value of P1_ROWNUM is ‘undefined’ again so I'm not sure if the Product Name column will be populated.--
    3. And finally, you are using the jQuery Selector uPopupLOVIcon, which is an attribute of the Cloudy Theme. In my real application (Apex 4.1.1.00.26), my element looks like: *<img src="/i/lov_16x16.gif" width="16" height="16" alt="Popup Lov" alt="List" style="vertical-align:middle;" align="middle" />*. What do you recommend me to use as a jQuery Selector?
    Again, I really appreciate your help and time. I think you solved the most difficult part.
    Thank you so much,
    Erick
    Update: I just found out that the problem with my comment 2 is because I didn’t delete the previous dynamic action that set the value to P1_ROWNUM.
    Edited by: ediazjorge on Sep 18, 2012 11:20 AM

  • Master detail form Error in mru internal routine: ORA-20001

    Hi,
    i created a master-detail form with apex standrad wizard.
    Master e datail are on the same page.
    All works fine.
    My detail form contain some fields of my detail table.
    Now i added a link on detail form for call a form with all fields of my detail table.
    The link work fine.
    When i try to add row or update my detail form i receive the error
    Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-20001: ORA-20001: Current version of data in database has changed since user initiated update process. current checksum = "D472A2BF636CA11122F196B8A32B3DC8", item checksum
    Any help?
    Thanks in advance
    Lukx

    Lukx,
    I've just reproduced your what I believe you wanted and didn't receive any errors. Here are the steps I took.
    1) Used the wizards to create a Master Detail form (with Detail edit on the same page as the master and only showing 2 of the detail columns)
    2) Used the wizard to create a FORM ON A TABLE for my detail table allowing the user to edit all detail columns
    3) Created a "column link" column on the detail form of the Master Detail form which links to the FORM ON A TABLE, passing across the ID of the detail record.
    When I do this, everything seems to work perfectly as expected.
    Is there something I'm missing in the steps you performed to create your scenario?
    Thanks
    Doug
    http://www.sumneva.com

  • Can't put Combobox  in Master-Detail Form

    I'm trying to create Master-Detail form with LOV's, but in both the Master and Detail selection, the Item Type LOV doesn't include combobox.
    From the looking at some of the Posts, this seems to be possible.
    Does anyone know what I need to do?
    Thanks Larry

    Hi,
    This is because you do not have any LOVs defined in your application. This LOV will show the LOV types, only if the application contains any LOVs. Define a LOV and then edit the form. You will be able to see it.
    Thanks,
    Sharmila

  • Creating Detail record in Master Detail form

    I have created a Master Detail form with the Detail form being on a second page.
    I have no problem editing an existing detail record. However, if I attempt to create a new Detail record (insert). I get an error. It appears that the value of the field that I am linking the Master and Detail records with, does not get passed to the second (detail) form when I press the 'Create' button and I have not been able to ascertain where I may need to modify the parameters of the page.
    Any guidance would be appreciated.

    Hi Judy,
    It's been 5-6 months since I've created a Master/Detail APEX application, but I don't remember having to create any special trigger or anything. I created a few maintenance appls over tables I created, and created an inquiry appl using Oracle vendor tables. All of them have worked nicely.
    If the PK/FK's are set up correctly it just works. :-) Like magic. If I recall correctly, as you create the appl you define the the key fields to use. If the tables are defined correctly, and you 'tie' them together using the correct key fields in the application everything should work nicely.
    Tony

  • Master Detail form on Oracle EBS

    Hello,
    This is on Forms 6i, on Oracle EBS 11.5.10.2
    I have a Master Detail Form, with one master block and several detail blocks(5 detail blocks).
    Each of the detail block is arranged on a tab. That means 5 detail block = 5 tab.
    Now I wan to implement opposite of master less operation meaning, i need to prevent detail less operation.
    To explain in a simple manner, If user enters a new record in master block, and does not bother to even navigate to any of detail tabs, then it should force user to at enter a record in these detail tabs and should prevent user from exiting the form or committing the form without entering detail tabs.
    How can I achieve above functionality?
    Thanks,
    AB
    Edited by: Rich V on Aug 28, 2012 4:26 PM

    Hi Liem,
    Could you please tell me the Portal Version ?
    Some new indexes were created for 3.0.9 version that had help improving the form performance.
    Create the following indexes as the portal owner (if the portal version is less than 3.0.9 )However, if the portal has been upgraded to 3.0.8 then they should have these indexes :-
    create index wwa_module_bindings_idx1
    on wwa_module_bindings$( subscriber_id,
    module_id,
    module_version,
    module_block_id,
    module_attr_id)
    create index wwa_module_lov_bindings_idx1
    on wwa_module_lov_bindings$(
    subscriber_id,
    module_id,
    module_version,
    module_block_id,
    module_attr_id)
    /

  • Master detail form initial insert issue on details sub-region

    Hello,
    I created a master detail form with report which should do insertion on master and detail region/subregion.
    On insert mode I enter with data master and detail block, when I press "Create" button, insertion happens only on master block (order table) not and on detail block (order_item table).
    On EDIT mode it does insertions/updates on master and detail block without problems.
    Application Express 4.2.1.00.08
    Oracle Database 11g Express Edition Release 11.2.0.2.0
    I appreciate your help.
    Regards

    Something like this should do the work:
    CREATE OR REPLACE TRIGGER order_item_table_tr
       BEFORE INSERT
       ON order_item_table
       FOR EACH ROW
    BEGIN
       IF :NEW.order_id IS NULL
       THEN
          :NEW.order_id := v ('P1_ORDER_ID');
       END IF;
    END order_item_table_tr;
    /Make sure the Automatic Row Processing (DML) of the order table returns key into item > Return Key Into Item > P1_ORDER_ID (or however the primary key of the order table is named)
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    http://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

Maybe you are looking for

  • Down payment request in f-47

    Dear sap guru How I can stop making a down payment Request of more amount than the P.O Value? I have changed the Message control and made the warning as error.....Now if I make a downpayment more than the P.O amount in a single posting, it gives me e

  • Web Photo Gallery - Feedback form not emailing?

    I'm using CS2 PShop and have created a web photo gallery using the Centred Frame 2 style and have entered my email address etc correctly. The gallery displays fine and on my mac I can approve and add descriptions, save and email the saved data - it a

  • RichEditableText textFlow problem with \n

    I cant say more right now, but I have found some strange problem. We have skin with RichEditableText and we bind text property with some data from server. If there is string with \n inside whole app froze, or CPU is very high. In profiler I have foun

  • How can i add link to web in an applicaion(Urgent)

    Hi I want to add link in an application mean when user click on this link it open a browser and goes to that address. I want to do that thing in JFrame.plz help me.

  • Payment  in  cash to vendor  without cash journal

    Hi I am not   using  cash  journal .   But  I   want   to   pay   vendor  invoice   by  cash   ( not   bank ).   FB60   is  not  allowing the  entry. How  can  I do it. Thanks kamala