How to control detail records displayed after requery

I have a master/detail form. I did not like the behavior of the screen clearing after I did a save so I added code to requery the master/detail records. There is still one behavior which I need to fix -- after I requery the master and detail records, I always get the first set of detail records, not the set of records displayed on the screen when I did the save. So if I have detail rows 40-50 displayed on the screen and do a save, the master/detail rows are requeried but I see rows 1-10 on the screen, not 40-50. Any ideas how to code around this?

This is due in part to the fact that detaching the detail object from its master and actually deleting the detail object are two different things. To work around this, add the following in your session bean, where Departments and Employees are your master/detail objects, respectively:
public void removeNestedEmployee(Employees entity) {
Departments owningDept = entity.getDepartment();
owningDept.removeDepartment(entity);
UnitOfWork uow = getSessionFactory().acquireUnitOfWork();
uow.deepMergeClone(owningDept);
Object empWorkingCopy = uow.readObject(entity);
uow.deleteObject(empWorkingCopy);
uow.commit();
Re-generate the data control for this session bean and then drag and drop this method onto your JSF page. The argument you'll pass in is the data provider for the selected employee:
${bindings.departmentCollectionIterator.currentRow.dataProvider}
This will both detach the record from the owning entity, delete the record, and force a refresh of both the master and detail iterators.
Hope this helps,
Lynn Munsinger
Oracle JDeveloper and ADF Product Management

Similar Messages

  • How to put detail records in fixed formÉ

    Hi,
    I am trying to build a crystal report based on an existing printed form. The form includes elements that look like the following:
    Activity
    Hot Oiler - 4 mbtu     7mbtu
    Pressure Pumping - 5K   10K   15K
    Travel - 5K   10K   15K
    Standby - 5K   10K   15K
    Each Activity also has a quantity, a rate, and a total (quantity * rate) associated with it.
    The user used to circle the applicable value on the paper form (for example, if it was a 4 mbtu hot oiler vs. a 7 mbtu hot oiler).
    In the application and database the user will enter line items in the work order that specify if it is a Hot Oiler  4 mbtu or a Hot Oiler 7mbtu.  Similarly, the user will create a record that is either Pressure Pumping 5k or Pressure Pumping 10K or Pressure Pumping 15K. And so on.
    The application is capturing all of this information.  I want the crystal report to still display each of these elements as they are laid out on the current paper form however because these are detailed records I do not know how to place them in the report properly. If we take the first line in the form, I created the formula:
    +if {field_tickets_has_resources.resources_id} in [150, 151] then
    "Hot Oiler - " & "4 mbtu" else
    if {field_tickets_has_resources.resources_id} = 163 then
    "Hot Oiler - " & "7 mbtu" else
    "Hot Oiler - "+
    I created another formula for the second line in the form:
    +if {field_tickets_has_resources.resource_roles_id} = 15 then
    "Pressure Pumping - 5K" else
    if {field_tickets_has_resources.resource_roles_id} = 18 then
    "Pressure Pumping - 10K" else
    if {field_tickets_has_resources.resource_roles_id} in [22, 24] then
    "Pressure Pumping - 15K" else
    "Pressure Pumping -"+
    And so on.  However, I cannot place each of these formula beside each other in a details line because it places the values horizontally rather than vertically in the report.  I cannot place these in a header because they are actually detailed records.
    I hope this makes sense. Any help, as always, is appreciated!
    Mark

    Hi Mark, 
    I recommend a similar apporach but the first formula will be created so we can group the records by the Activity type.  For example all the Hot Oilers then Pressure Pumping, etc. 
    We group on this formula then a second formula will build a list of the quantities. 
    One final formula in the Group Footer will display everything on a single line.  We can then hide the Group Header and Detail section because we only want to see one line per actvity type. 
    Create a group on this formula:
    @ActivityGroup
    If {field_tickets_has_resources.resources_id} <> 0 Then
       "Hot Oiler"
    Else If {field_tickets_has_resources.resource_roles_id} <> 0 Then
             "Pressure Pumping";
    This formula will define and reinitialize a string variable for each group.  This goes into the Group Header and can be suppressed. 
    @Initialize        
    WhilePrintingRecords;
    StringVar myQuantity := "";
    This formula goes into the Detail section.  Based on your first formula I'm guessing the Activity Type is based on which field is populated.  I assume only one field per record can have a value that isn't 0. 
    @Quantity        
    WhilePrintingRecords;
    StringVar myQuantity;
    If {field_tickets_has_resources.resources_id} <> 0 Then
       (Select {field_tickets_has_resources.resources_id}
          Case 150  :myQuantity := myQuantity & "4 mbtu "
          Case 151  :myQuantity := myQuantity & "4 mbtu "
          Case 163  :myQuantity := myQuantity & "7 mbtu ";)
    Else If {field_tickets_has_resources.resource_roles_id} <> 0 Then
       (Select {field_tickets_has_resources.resource_roles_id}
          Case 15   :myQuantity := myQuantity & "5K "
          Case 18   :myQuantity := myQuantity & "10 "
          Case 22   :myQuantity := myQuantity & "15K "
          Case 24   :myQuantity := myQuantity & "15K ";)
    This formula goes into the Group Footer and builds your string. 
    @Display     
    WhilePrintingRecords;
    StringVar myQuantity;
    {@ActivityGroup} & "-" & myQuantity;
    All the sections except for the Group Footer can be formatted to hide. 
    Hope this helps,
    Brian

  • How to control custom button display or hide in toolbar

    I had been added four buttons in Acrobat Tool bar.
    Now I find a function AVToolButtonSetComputeEnabledProc in SDK that this function only control the button enable or disenable.
    Now I want to control the custom button display or hide, how can I to do?
    Does this SDK have a API to achieve my  need?

    As of Acrobat X, we no longer support dynamic hiding/showing – only enable/disable.

  • How to modify-detail record

    I have a master detail form
    i have three items in detail
    i want to delete one of them
    i wrote
    clear_record;
    commit;
    on when button pressed
    but it not works
    regards
    vikas Singhal

    you'll have to use the delete_record built-in to delete a record.
    Clear_record removes the record from the block, but does not delete it.

  • How to keep ical alarms displayed after restarting

    I notice that my iCal alarms disappear after quitting iCal or restarting my computer. For example "Call Doctor" shows up today at 8 am when I start work. I shut down for a meeting. I restart and the alarm message is gone. The event is still there. But I might forget to call unless I see the alarm again. I remember Microsoft Entourage did this and I found it very helpful. Is there a way to get this same effect with iCal?

    Hi,  This is not related to your question about ical alarms, but to a previous post you made when your iweb crashed when saving.  I also had to use time machine to transfer all info to a new computer and I am having the same problem when I try to save.   I did not completely understand your solution because I am not very savvy with computers. I did go in and change all the permissions to read and write, but I still have the problem.  I don't know how to "add my account name to the File Info"-
    I just spoke with a supervisor from Apple for two hours and who did not solve the problem.  (He thought he did, but he did not and he has not called me back). 
    If you could give me an explanation of your solution, it would be very helpful and immensely appreciated. 
    Thank you for any assistance you can give me regarding this.  I really need my iweb!
    [email protected]
    Here is the solution you posted: 
    I figured it out. It was those permissions. I simply added my account name to the File Info. For some reason the Time Machine restoration did not copy the permission for the package (however the contents had the correct permissions.

  • How to concat detail records in one line

    Hi,
    I would like to concat all empoyees and it as column next to department name, like that
    DEPTNO DEPTNAMR EMPLIST
    Is there any way to do it using select without user-define function to concat emp records
    Im using O10R2
    Thanks & best regard

    Take your pick, these examples span several database versions:
    http://www.oracle-base.com/articles/misc/StringAggregationTechniques.php

  • Master-detail: detail field not displayed after changed by master field

    I want to use the Depends on item with Clear/refresh value functionality in a master detail situation. Within the same group it is no problem to use the setter method of a field to change a second field and then displaying this new value. But in the detail group, I can not select items from the master group as a depends on item.
    In the setter of the master field, the value in a field for each row in the detail (table layout) is updated. The only problem is that this updated value is not displayed, the old value doesn't change. When saving the changes, the displayed value is committed to the database. When de updated field is not displayed at all, the correct value is saved, so I know the detail field is updated.
    How can I make sure the displayed value in the detail is displayed after changeing a master field? I already gave the detail field the correct partial trigger.

    Wouter,
    I guese you don;t see the changed value when you display the detail item because after the depends on item update changed the detail item, JSF procesing continues and the detail table changes are sent to the server which will override again the detail item attriibute, resetting it to the old, still displayed value.
    So, the trick is to get PPR working. Make sure the partialTYriggers property of the detail item is set to the value of the id property of the master item. If it still doesn't work, try setting the partial triggers property on the table, instead of the individual item.
    Steven Davelaar,
    JHeadstart team

  • ALV_GRID How to get number of lines after filted applyed?

    Hi, all!
    The task is to display title in alv_grid like
    "N records selected (X records on the screen)".
    It means, N records in dataset and X records displayed after  filter applyed by user.
    But i can't get number of lines after filter applyed from the alv_grid.
    Can anybody help me?
    Thanks & regards,
    Konstantin

    Hi,
    If it goes through PBO/PAI cycle after user sets the filter then in your PBO call method get_filtered_entries of CL_GUI_ALV_GRID and then do a describe statement on the table.
    Number of entries in your grid table - number of entries in this filtered entries table will give you the displayed entries after the filter is set.
    If it does not go through PBO/PAI cycle then register for after_user_command and I think the fcode for filter is '&FILTER' and code for the above logic in your handler method..
    Hope this helps..
    Sri

  • How to print blank records after the detail records in a masterdetail report

    Hi,
    Developing a report for time and attendance record. In this report I am printing all the employees in a department, limiting the no. of records per page to 10.
    I need to insert blank lines at the end of all of the detail records in a page that has less than 10 employee records so that the no. of records displayed on a page can always be 10(these blank lines will facilitate the management to note down the temporary employees who worked for the department but are not part of the department).
    I am using a tabular form with group above layout.
    The report layout is as follows:
    Department : FINANCE & ADMINISTRATION
    Employee Name | Employee Number |
    1 Jim | 1234 | _________________
    2 John | 5678 |__________________
    3 blank
    4 blank
    5
    6
    7
    8
    9
    10 balnk
    Supervisor's Sign:______________________
    Note: the no. of blank lines should be inserted dynamically based on the no. of emp. records being printed on the page.
    Any help is greatly appreciated.
    Thanks in advance.
    Kavita.

    Your solution works when I am not limiting the no. of records per page for a department to 10 records and when I want to print blanks lines for the depts that has fewer than 10 employees in it.
    Exactly in my report I have several dept's that has more than 10 emp's. In such cases I'll be printing first 10 in one page and the rest in the next page. Now I want to dynamically print the blank lines in the second page depending on the no. of emp's on that page. I tried to acheive this by using a CS column that reset's at page level but, REPORTS is not letting me use CS column that reset's at page level in a format trigger. I also tried to copy the CS value into a parameter and or to a Place holder column and did not help.
    Any more work around ideas to acheive this?? please help.
    Thanks alot
    Kavita.
    Hi
    Create a column called Serial_No in ur emloyee query like this
    select 1 , empno ,ename from emp;
    Create a summary column on the serial column with the function SUM
    and resetting it to Page
    Display the column in the report by using the text color as white
    so it doesn't display in the report
    I think this should help u i believe
    Sri
    Hi,
    Developing a report for time and attendance record. In this report I am printing all the employees in a department, limiting the no. of records per page to 10.
    I need to insert blank lines at the end of all of the detail records in a page that has less than 10 employee records so that the no. of records displayed on a page can always be 10(these blank lines will facilitate the management to note down the temporary employees who worked for the department but are not part of the department).
    I am using a tabular form with group above layout.
    The report layout is as follows:
    Department : FINANCE & ADMINISTRATION
    Employee Name | Employee Number |
    1 Jim | 1234 | _________________
    2 John | 5678 |__________________
    3 blank
    4 blank
    5
    6
    7
    8
    9
    10 balnk
    Supervisor's Sign:______________________
    Note: the no. of blank lines should be inserted dynamically based on the no. of emp. records being printed on the page.
    Any help is greatly appreciated.
    Thanks in advance.
    Kavita.

  • Displaying the master and detail records ....

    Hi ,
    There is a master - detail form. The end-user make some insertions/updates in the detail block...
    How is it possible to display these detail records and its master when the user presses a custom button 'refresh' which just requery the records in both master and detail blocks...?????
    When i write "to display these detail records and its master " i mean that the current record (the one which the cursor would be focused in ) would be this master record... however,all other records would be displayed as well....
    Many thanks,
    Simon

    From what I understand you want to re-query and go to the record where you were just before re-querying??
    Interesting requirement, why you wanna do this? if for the user to see the changes of the updates, that is the default behavior.
    You can do this in two ways.
    1- in your "Refresh" button save the :system.trigger_record in a parameter :parameter.record_num, for the Master block and after the query you do a go_record(:parameter.record_num) .
    BEGIN
         GO_BLOCK('EMP'); --Master Block
         :PARAMETER.RECORD_NUM := :SYSTEM.TRIGGER_RECORD;
         EXECUTE_QUERY;
         GO_RECORD(:PARAMETER.RECORD_NUM);
    END;2 you can loop through the block with next_record built-in and an exit condition of a key value you saved in a parameter.
    BEGIN
         GO_BLOCK('EMP'); --Master Block
         :PARAMETER.EMPNO := :EMP.EMPNO;
         EXECUTE_QUERY;
         FIRST_RECORD;
         LOOP
              EXIT WHEN :EMP.EMPNO = :PARAMETER.EMPNO;
              NEXT_RECORD;
         END LOOP;
    END;Tony

  • How to create multiple detail records dynamically  ?

    Hi All,
    I have a master-detail Form. I would like to display 5 records from details in my form. After entering data in 5 records in my detail how do I create a new detail record. And how can I get a scroll bar to manage them ? Right now all I could do is just create 5 records as default while designing the form.
    Can anyone please help me out ASAP.
    Thanks very much,
    Murali
    [email protected]

    Hi murali,
    Currently this is the way how MD forms works.If you wish to add more records in one go you can set at the design time for more no of detail records using "Number of Detail Rows to Display" in the Detail section .There is no provision of scrollbars at present.
    The other time when you enter just enter the Master form's key value with "Master action" set to none and just insert the Detail Form's record using the "Detail actions " to Insert.
    Hope it helps.
    rahul

  • OAF matester detail page : How to have a "Show All" feature on screen, so that all the master and details records are expanded .

    Hi ,
    I was trying to have a "SHOW ALL" feature on the master - detail page,
    the detail table is an advancec table.
    Please help me with inputs on how to have  "SHOW ALL" feature,
    Currently, we have to click on  ":Show" for each record at master level to view the child data.
    Trying to achive "Show All" Feature so that on click of this the master records on the page 'Expands"  showiing all master records with respective detail records.
    Regards
    bhuvanm

    Hi,
    You should not set DetailFlag = "Y" in whereclause because there is no such record.
    Also detail flag is transient attribute and not the query column, hence the error "Invalid indentifier".
    I asked you to use DetailFlag as query column with static value "Y".
    for example:
    SELECT "Y" detail_flag
    FROM <table_name>
    This will display all the table records in expanded format. if you want it conditionally then use decode on some bind parameters.
    For example:
    SELECT DECODE(:1, "SHOWALL", "Y", "N") detail_flag
    FROM <table_name>
    This bind parameter should be passed whenever you want to execute query for the table.
    Regards,
    Sandeep M.

  • Master Detail module returns to Master page after Detail record saved

    Using Oracle Designer Editor version 10.1.2.0.2 I have generated a Web PL/SQL package
    set up as a Master/Detail where the Master and Detail records appear in separate windows.
    The Master window contains multi-records each with a link to the related Detail records.
    The user clicks on the Detail link and the window that appears will allow the user to insert
    a new Detail record. Once the user clicks the Save button I need the Detail window to disappear
    and the focus returned to the Master records preferably after a new query is performed.
    What are the steps I need to perform to navigate back to the Master page and close the Detail
    page?
    Thanks,
    Mark

    The simple answer is that to do exactly what you want would take some fundamental changes to the way the framework works. The actionInsert procedure does what it does - it saves the changes and redisplays the form. You can do post-generation changes to make it do something else, like return to the Master, but I'd advise against it.
    But if you want a way to return to the Master window, where the user clicks a button or link on the detail form after saving changes, that we can do. Just make a note of the URL that does the initial display of the Master page - probably my_module_name$.startup. Go into the detail module component, and click the User Text tab. Then at Text Location, "Bottom of View Form" (or Top if you want the link there) add for a link:
    htf.anchor('my_module_name$.startup','Return to Master')Or for a button:
    htf.formOpen('my_module_name$.startup','GET')||htf.formsubmit('Return to Master')||htf.formCloseYou may need to set the SECECS preference for this module to "No" to get this to work.
    An alternative to my method is to define an Action Item in the module that does a navigation. I often am linking directly to the View form for a master table, rather than a record list, as you are, and Action Items don't work well for that, but one might work fine for you.

  • How to clear a record of control block

    i have one control block with 2 items and the Max. records displayed property is set to 10.I have populated 5 records and now i want to clear one record, but the clear_record statement does not seem to be working. How to clear a record in a control block. Please help me out in this doubt of mine.

    You have probably moved focus to another block. You have to go_block and maybe go_record before using clear_block.

  • How To Hide the Record after Update from ADF Front End

    Hi Every One,
    I have done the Scenario of Database Table rows displayed in ADF front end. It is editing and updating also. My Query is after update the record, how to hide that record from adf front end.
    Could any one please help me.
    Thanks,
    Narasimhulu.S

    hi you can create transient field in view object indicate to visibility of row (boolean ) and create view criteria that show only rows that are able to be visible according to transient attribute and at the update process set the attribute to true inside entityImpl class

Maybe you are looking for

  • Macbook OS Leopard to Macbook pro

    I just bought a used macbook pro and I wanted to reformat it.. my friend has an unused Macbook OS Leopard Install CD that came from Macbook when she bought it.. is it safe to use her Macbook OS in order to reformat my Macbook Pro? Are they the same?

  • ITunes 11 not sorting multi-disc audiobooks by disc number

    I just updated to iTunes 11, and for some reason, my multi-disc audiobooks are not being ordered by disc number in the Books view. Instead, it goes track 1 of disc 1, track 1 of disc 2, etc. The tracks have the disc numbers in their metadata, so why

  • ITunes digital skips and premature shuffle

    I'm a new user. I have a few dozen favorite instrumentals in a playlist, some purchased and some converted from my CD-ROMs. While listening I frequently hear the computer skip over some brief segments of the music. Sometimes songs are ended before th

  • Problem installing 0SALES_UNIT from Business Content

    Dear Friends, I have tried to install 0SALES_UNIT from the business content but it does not appear under the InfoObjects tab. What could be the problem? When i try to install it, the system shows that an active version of the object already exists. I

  • TS3274 Sound doesn't work for games but does for everything else!

    The sound doesn't seem to work with the games but works with everything else ..... What's the reason for that and how do you correct that?