Questions on Master-Detail HTMLDB HOW-TO

Hi all
I have created a 3 page application based on the master detail how-to given at http://www.oracle.com/technology/products/database/htmldb/howtos/index.html
Instead of DEPT and EMP tables I have PERSON and PERSON_ADDR tables. The PK of PERSON is the person_id and the PK of PERSON_ADDR is the person_id and addr_start_dt. Person_id column in PERSON_ADDR is obviously the FK to the master table PERSON(person_id).
At first I had problems trying to create the pages themselves because the wizard always hides the person_id column on all the forms(and I don't want that,even though it is a sequence number I still want people to see it) , it being the PK, then somehow I managed it to display the person_id by replacing the EDIT link with the person_id itself. Now if a person already has an address and I click on EDIT then it copies the person_id values and others to the next page and all looks good but when I try to create a new address it does it ?? (It should take across the person_id as well)
My PERSON report is on page 1, when I click edit against a person it takes me to page 2 where I can see+change all the person details plus I can see the person_addr details. When I click edit against a person address it takes me to page 3 and I can edit all the address details nicely copied to the new page but when I click CREATE on the page 2, then all the fields appear as NULL on page 3( all the fields but the person_id should be null here). How can I fix this ?
Also, for my person address I would like to validate the address dates , there should be no overlapping start and end dates for a person's address. How to do this ? I think I will need to create a function to which I pass the person id and the new start and end dates and this function returns error message,if any, or null. I had a play around with validation and I think I need to use "function returning error text", what should I put in the "validate expression 1" box then...just something like
begin
my_function(param_1,param_2)
end;
If yes, then what variables would store the new start date and new end date of an address.
Lastly, for every table do I have to user a sequence number or a trigger to define a primary key, what if the primary key is just a character code and I want the users to add it ?
Thanks a lot in advance !!

thanks Marc.
Yes you are right, I used the 1.5 viewlet. I will try the master-detail wizard now.
With the primary key problems, for things to work nicely in HTMLDB, do you suggest each and every tables should have a sequence number generated primary key ? We have some tables for various statuses like ACTIVE,CLOSED where these codes themselves are the primary keys, so you suggest making these codes unique keys but still have a sequence number PK ? Also when I want the users to enter the primary key themselves I will let them enter new ones but not update existing ones, so data entegrity is maintained.
I was able to work out how to create validations using "functions returning error text" but my problem is I need to be able to compare what the user has just updated/entered with the data that already exists in the table. I have a table called person_Address having columns like person_id, start_dt,end_dt and various other fields. The primary key is person_id and start_dt and I need to put a validation which avoids any overlapping addresses. Overlap as in there can be only 1 active address for a given start and end date range. Does HTMLDB has something like :new.start_dt the way we can write database triggers ? Please suggest a way to do this.
Lastly, how does HTMLDB handles error messages raised by table triggers. Can they be shown along with the item on the page as we can with the other HTMLDB validations ? I have many tables with all sorts of triggers and if any validation fails I generally do...raise_application_error(-20001,get_my_message(234));
get_my_message function returns the message text for message number 234 . Will this message be displayed somewhere or not ? Do I have to duplicate my validations , once in the triggers and then in HTMLDB as well ?

Similar Messages

  • Portal Master-detail form how to auto assign detail record sequence number

    Portal Master-detail form how to auto assign detail record sequence number.Please help me?

    You can just read the following section
    Can I specify a sequence number generator as the default value for a form column?
    Yes. Enter the following in the "default value" field for the column:
    #<schema name>.<sequence name>.nextval
    where <schema name> is the name of the schema containing the sequence, and <sequence name> is the name of the sequence. The entry is preceded by a "#".
    For example, if the schema name is "SCOTT", and the sequence name is "CUSTOMER_SEQ", the default value entry is:
    #SCOTT.CUSTOMER_SEQ.NEXTVAL
    same way you can do for master - detail form.
    for more information on forms please refer the following URL.
    http://otn.oracle.com/products/iportal/htdocs/portal_faq.htm#BuildingApplications
    hope it helps.

  • Master-details problem: How to access the parent EO/VO in child side?

    Hello
    Refer to the reply of posting
    Re: How to insert  new records in Master and detail Forms.
    I have got the following questions
    The approach for setting the master-details relationship works well, however, in this example,
    I have overriden the create(AttributeList attributeList) method of VO2, so after calling
    DCBindingContainer dcb = ADFUtils.getDCBindingContainer();
    OperationBinding oper = dcb.getOperationBinding("CreateInsertVO2");
    oper.execute();
    , it will enter the create() method of VO2, at this point, i can only access the argument attributeList
    which stored the key value that link up parent and child, however, how can i get the entire VO1
    for accessing the value of all VO1's attribute?
    Thanks

    Neon wrote:
    I have mapped a createInsert action in the blinding layerThis is OK.
    Neon wrote:
    Do you mean that i have to create createRow and insertRow action in blinding layer?No. The createInsert operation does just that
    Neon wrote:
    Or call these function in the VO overridden create() method?No. You can't do that.
    In conclusion, I don't understand why the accessor returns null. Maybe someone else can shed some light... ?:|
    One last suggestion from me is to try getting the VO1 directly from the AM instead.
    This should work - it is not a recommended practice through.
    Use the following code:
    VO1RowImpl vo1 = (VO1RowImpl)this.getVO1();
    // ensure that the VO1 VL accessor is properly initialized
    if (vo1 == null) {
       vo1 = (VO1RowImpl)((YourApplicationModuleImpl)this.getApplicationModule()).getVO1().getCurrentRow();
    }

  • Question on master detail coordination

    Hi,
    Kindly help me with the following question.
    If a master details is waiting on its Wait for Flow activity, and it has previously spawned few detail processes, what happens when one of the detail processes at runtime didn't execute the Continue flow activity but completed successfully(for example .. due to a comparison activity) and other detail processes executed the continue flow activity and completed successfully?
    Thanks,
    Srini

    Hi,
    I've answered your duplicate post on the Workflow FAQ forum at http://smforum.workflowfaq.com/index.php?topic=599.0
    HTH,
    Matt
    WorkflowFAQ.com - the ONLY independent resource for Oracle Workflow development
    Alpha review chapters from my book "Developing With Oracle Workflow" are available via my website http://www.workflowfaq.com
    Have you read the blog at http://thoughts.workflowfaq.com ?
    WorkflowFAQ support forum: http://forum.workflowfaq.com

  • Question on "Master Detail page using ADF" sample

    I downloaded the "Master Detail page using ADF" sample application. I modified editDepartment.jsp page to include the Commit button as follows:
    <html:submit property="event_Commit">Save and Commit</html:submit>
    When I go to edit a department record and click on the new "Save and Commit" button, I SQLed the DEPARTMENTS table and noticed that the edits were not commited. I also restarted the embedded OC4J server and still get the same results. For some reason, the department view object contains the modification but the entity object doesn't. Why?

    Scott,
    My colleague suggested a workaround, which is to explicitly include the detail table's id in the master table's partialTargets list. So, for example, in MasterDetailDP.uix, changing:
    <table model="${bindings.DepartmentsView1}"
           id="DepartmentsView111"
           partialRenderMode="multiple"
           partialTargets="_uixState">to:
    <table model="${bindings.DepartmentsView1}"
           id="DepartmentsView111"
           partialRenderMode="multiple"
           partialTargets="_uixState EmployeesView312">...will cause the detail table to be updated when sorting the master table.
    There is some question about whether sorting a table should actually cause the currently selected row to change - we're still discussing this point.
    Andy

  • Master/detail + tabbed, how?

    I am designing my first form. I'd like to have a master-detail, but there is a difference from textbook examples: the detail should use tabs instead of tabular. This is because the the detail records are very few but variable (1 to 8 tabs).
    The critical part here is thet the number of tabs are not known in advance; only when he user executes the query, the form will find out how many tabs are needed.
    Do I need a trigger or something to generate the tabs at run time? How do I create this tabs dynamically? Do I have to use tabbed canvases or there are other ways to use tabs?
    TIA
    -Ramon F. Herrera
    null

    Ramon -
    What you can do is if you know the maximum possible, you mention 8, you can create a tab canvas that has eight tab pages. you can programatically determine whether the tab pages are displayed or not
    if get_block_property('myBlock', query_hits) = '7' then
    set_tab_page_property('tabName', VISIBLE, property_false);
    end if;
    Hope this helps,
    Candace Stover
    Forms Product Management

  • Questions about master-detail update and delete!!

    I have created a view object with two entity objects.
    These two entity objects map master-detail tables in DB.
    I want to update both tables when the user input, and delete the record in detail table (keeping master table unchanged) when the user click delete button.
    How can I do?

    did you figure this out? i have created VO made out of two updatable EOs and update works fine. But still have issue with deletion!

  • 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;

  • Master detail process, how to start detail process

    hi,
    i have a workflow process, which is about overtime.
    we created overtime request as a batch. each batch has more employees for OT.
    so when the batch is created, workflow starts and send the notification to the
    approver . So each approver got more than one employee' s OT request , for approval with in a batch. so he could select the appropriate records and just click the approval button once in forms to approve the selected records.
    If the approver approves, then system check again in the batch that, any of the employee got more than 10 hours, if exist , then system has to send those
    records to the next approver(manager). that is the detail process,
    But how can i start the detail process, shall i just draw a link to the detail process or i have to manually start using createprocess and startprocess for the detail process. any example is appreciated.
    thanks regars

    Hi,
    If you are creating a master-detail relationship, then each detail flow needs to be started from a custom function in the master process. You will need to call the APIs to create the process, set the relationship between master and detail, and then start the detail process.
    HTH,
    Matt
    WorkflowFAQ.com - the ONLY independent resource for Oracle Workflow development
    Alpha review chapters from my book "Developing With Oracle Workflow" are available via my website http://www.workflowfaq.com
    Have you read the blog at http://thoughts.workflowfaq.com ?
    WorkflowFAQ support forum: http://forum.workflowfaq.com

  • Master-Detail Form (How to pass an item value in Master to Detail field

    I have a Master-Detail form. When adding a new record in the Detail section, I expect the primary key in the master record will copy down to the detail record. But, it is not doing that. Does anyone know how to pass the master primary key down to the detail record field.
    By the way, query works fine. It knows the master-detail relationship. It is just when creating a new detail record, the key not pass down from the master record.
    thanks - Patty

    hi,you can do it by:in detail form's foreign key field,set it's default value as master primary key ,example master page p1,primary key as p1_master,detail form p2,foreign key p2_foreign, set p2_foreign key 's default value &p1_master.
    Message was edited by:
    lixinzhu

  • Master/detail layout - how to have 'detail' hidden by default.

    The 'master/detail layout' option for spry datasets are great but how can I get the page to load with all the 'details' hidden until the user selects from the 'Master' column to reveal the details?

    Hiya,
    Don't know whether you are still looking for a solution, but if you are, please take a look at:
    "Using URL Parameters to Control Data Regions"
    I used the info there to create a Master/Detail page at
    http://www.myosanthe-bernhard-huber.com/html/fotobergtraining.php
    (which calls its data from an HTML DataSet)
    The detail region is empty when the page first loads because I've used SpryURLUtils to 'listen' for a url parameter so that I can load a specific row's content from an external link (eg http://www.myosanthe-bernhard-huber.com/html/fotoalbum.php which is also made from the the same dataset).
    A side result is that If the parameter isn't included in the url when the page loads, the detail region remains empty.
    The relevant code from the <head> of the page is:
    <script src="/SpryAssets/SpryData.js" type="text/javascript"></script>
    <script src="/SpryAssets/SpryHTMLDataSet.js" type="text/javascript"></script>
    <script src="/SpryAssets/SpryURLUtils.js" type="text/javascript"></script>
    <link href="/SpryAssets/SpryMasterDetail_foto.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
    <!--
    var dsTrain = new Spry.Data.HTMLDataSet("/html/fotos/fotodata.htm", "TrainData", {sortOnLoad: "Nr", sortOrderOnLoad: "descending"});
       //Get the URL parameter for the row number
    var params = Spry.Utils.getLocationParamsAsObject();
       //Set an observer so that when the data is loaded, we update the current row to the url param value
    dsTrain.addObserver({ onPostLoad: function(ds, type) {
    dsTrain.setCurrentRow(params.row); }
    //-->
    </script>
    This may not be the best or easiest way (I'm a beginner myself), and I haven't yet worked out how to move back to the top of the page when a master-link is clicked, but this may be useful for you.
    Best regards,
    Len

  • TextField in Master/Detail. How to set content master dependend?

    Hey guys,
    I have a Master/Detail App. In the Master view I have different delivery-items. If I click on one Item I get the detail view loaded with information (among others a TextField for notes).
    If I enter some Text in this TextField it is shown in every delivery-items. How can I set it dependend on the selected item?
    Thanks
    Chris

    In that case the behavior is as expected : since the textfield is not bound to one of the delivery items, it is simply part of the detail view. Any changes to the selection (which changes the selected delivery item) would thus not change the value of the textfield.
    I would rather bind the textfield to the delivery item nodes as well, so your notes are being kept there as well

  • Master-detail list - how to spread over multiple columns

    I am using the master-detail functionality to create a image viewer.
    I have a long list of master thumbnails, and rather than having them go down the page in one column, I would like to make them spread over 2 or 3 columns before the detail column. 
    (example of format I am trying to achieve - http://www.franbainbridgephotography.com.au/gallery.html (I dont mind whether master thumbnails are on right or left of detail photo))
    You can see my problem on http://www.wcwra.com/webpages/images.php
    Is this possible with the master-detail functionality?
    Thank you!

    The brilliant David Powers has fixed this for me on the main forum (vw2ureg was v close).  David's answer is :
    There is no way of making a single dataset repeat in multiple columns, because it's simply one element being repeated over and over.
    However, with a little out of the box thinking, you can do it quite easily with thumbnails. Instead of putting the master column repeat region in a block level element, use an inline element, <span>. Images are treated by browsers as inline elements, so this should work just fine. Change the following code from this:
    <div spry:region="dsPhotos" class="MasterContainer">
        <div class="MasterColumn" spry:repeat="dsPhotos" spry:setrow="dsPhotos"
        spry:hover="MasterColumnHover" spry:select="MasterColumnSelected">{Caption}</div>
    </div>
    to this:
    <div spry:region="dsPhotos" class="MasterContainer">
        <span class="MasterColumn" spry:repeat="dsPhotos" spry:setrow="dsPhotos"
        spry:hover="MasterColumnHover" spry:select="MasterColumnSelected">{Caption}</span>
    </div>
    In your CSS, set the width of the MasterColumn class to the width of your thumbnails, and the width of MasterContainer so that it's wide enough to accommodate two or more thumbnails. The thumbnails will flow into the column two or three abreast.

  • Uix question on Master-Detail (Many to Many)

    Hello -
    I like how, when selecting a record in the master table, the detail table is automatically updated.
    How would one replace the master table with a drop-down list (messageChoice) that updates the detail table when a particular master record is selected?
    Thanks

    hi
    its very easy problem
    1-in the messageChoice Event handler get the selected index go to master iterator and get that row from the iterator
    2-go to the Detail iterator and put a craitira base on that row
    by by

  • Master/Detail Forms - How to go directly to detail?

    The things you forget when you haven't used them in a while.
    I have two tables:
    MASTER with a MASTER_ID
    DETAIL with a DETAIL_ID and MASTER_ID (foreign key back to master based on MASTER_ID)
    When I generate the form using the wizard, how do I get the MASTER_ID on create so that I can immediately start adding the detail after creating the master (without having to go back to the report and select "Edit" (which works).
    Basically, what I am asking is: How do I get the MASTER_ID sequence value(key) generated at INSERT populated in a form variable so that I can move straight to adding detail lines?
    Thank you
    --Too Sleep Deprived to think this through.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Both Seattle City Light (SPU) and the Seattle Police (where I work) are now using APEX. I actually love it as a development language (except for some of the page formatting issues which I deal with from time to time). We are "killing" all of our ACCESS 97 applications and moving them to APEX. But ACCESS applications for us seem to be like the Hydra - once I kill one, two more seem to appear in their place ("Oh, you did such a good job fixing our blah-blah database. Did you know about these other THREE...") Keeps me busy though.

Maybe you are looking for

  • Query on rendering the Human Tasks in the customized GUI application.

    Hi All, In oracle11g BPEL, Is there any way to render the Human Tasks in the Customized GUI (Weblogic Portal) application rather that using the applications like "Oracle BPM WorkList"?. Does the Oracle11g BPEL supports this ?. My requirement is that,

  • Probleme mit Diadem 9.1 VIEW

    Beschreibung der Fehlfunktion: - Corsur kann nicht gewechselt werden - Layout kann nicht gewechselt werden - Daten werden nicht dargestellt Das Klicken von Schaltflächen und Iconen wird dargestellt, aber nicht ausgeführt

  • Unable to download using the Creative Cloud desktop

    When I try and download applications I get the following message: "Installation Failed.  Unable to reach Adobe servers. Please check your internet connectivity, firewall setting, and then try again." I am definitely connected to the internet and have

  • Problem migrating Photoshop Elements to new Mac Air

    I got the following error "150:30" upon PE start up immediately after using Migration App to migrate data and applications from old MacBook to new MacAir. I can not reinstall the PE software as I purchased as disc installer and MacAir does not have i

  • Difference between xSPrint_22-10004336.exe and xSPrint_23-10004336.exe

    I wander what is difference between xSPrint_22-10004336.exe and xSPrint_23-10004336.exe. Is there any difference to use one of those (possibly the23 one) on Vista and xp. Thank you in advance