Keeping current record after refreshing iterator (iterator refresh)

Greetings,
I'm using the following code to refresh a master iterator, so that when data is saved\edited it is automatically refreshed in the user interface. I'm using BC for the model layer.
public String commandButton_save_action() {
BindingContainer bindings = getBindings();
OperationBinding operationBinding =
bindings.getOperationBinding("Commit");
OperationBinding operationBinding2 =
bindings.getOperationBinding("Execute");
System.out.println("Now @ Global bean ... going to ...");
operationBinding.execute();
operationBinding2.execute();
// It should be a error page
if (!operationBinding.getErrors().isEmpty()) {
return null;
// Refresh main view object
DCBindingContainer bc =
(DCBindingContainer)FacesContext.getCurrentInstance().getExternalContext().getRe
questMap().get("bindings");
FirstCareAppModuleImpl fc =
(FirstCareAppModuleImpl)bc.findDataControl("FirstCareAppModuleDataControl").getD
ataProvider();
ViewObject vo_SitSocProf = fc.findViewObject("EpisodiosMain");
vo_SitSocProf.executeQuery();
System.out.println(" All done. Ciao ");
return "back";
I just want to refresh data from database and still show the current record. This is always taking me to the first record in the iterator.
The issue is: How to show the current record after the refresh? If the above
code is not correct, or not the most adequate, please don't hesitate and tell
me.
Thanks.

You can do this as follow:
1) In your ApplicationModule (e.g ScottAM) define function:
public void refreshView(){
getMainViewObject().executeQuery();
2) Expose this function to client
3) In your manage bean define:
public String commandButton_save_action() {
String dc = "#{data.ScottAMDataControl.dataProvider}";
FacesContext ctx = FacesContext.getCurrentInstance();
ValueBinding vb = ctx.getApplication().createValueBinding(dc);
ScottAM am = (ScottAM)vb.getValue(ctx);
am.refreshView()
return null;
Note, that this solution will set you on the first row after invoke.

Similar Messages

  • Moving to current record after execute query

    Hi all,
    I have a form where i can list all db jobs which can be start or stop.
    for more details, form is having columns like jobs, current db status, action(start/stop drop down)
    The user will view list of jobs in the screen and he straightly goes to a record and start (submit) the job using drop down for that record.
    once they start/stop the job, execute query will fire to show the current status of the job.
    Now going to my requirement,after execute query, I want to go to the record (job) which user has started the job .
    Currently the cursor will go to first record.
    Is there any oracle 10g AS property where i can get current record , put it in parameter and go to that record after execute query?
    Is there any other way?
    Regards,
    Leonard

    Hello,
    If you are sure the record after query will keep the same position, you can before, store the current record in a number variable with Get_Block_Property( CURRENT_RECORD) built-in, then after query use the Go_Record() with stored number variable in parameter.
    If you think that after re-query the record number can change, you have to loop through your records, then stop navidation while you find the corresponding key.
    Francois

  • Re: Displaying Current Record After Delete

    Hi all,
    I am using Jdeveloper 11.1.2.3.0
    I have two tables which has parent child relation among the both.
    I dragged the parent table as a adf form on to the .jspx page.
    Now if i am trying to delete fifth record in the parent table it is giving error message like "Table has child record, delete unsuccessful"
    It is fine, but the control going to first record after deletion.
    But i want to display current deleting record on the page if deletion is unsuccessful.
    Can anybody help me to resolve the above one.
    Thanks,
    Syam

    In this code when the bolded if condition fails i want to delete that record. I tried "delete struct1 index sy-tabix" but that record is not deleted.
    I tried "clear  struct1 ". its deletes the current record.
    but in some field its getting zero value & it is appending as a additional record.
    Please help me.
    loop at cdhdr.
    if ( it1-tcode = 'FSS0' or it1-tcode = 'FS00' ).
        w1_saknr = it1-objectid+4(10).
        w_orgid = it1-objectid+14(4).
       loop at it_cdpos  where changenr eq it1-changenr
                      and objectid eq it1-objectid
                       and   objectclas eq it1-objectclas.
       <b>If w_orgid in r_orgid.</b> 
      IF ( it_CDPOS-FNAME = 'XLOEV' AND it_cdpos-value_new eq 'X' ).
         replace struct1-change_ind with 'D' into struct1-change_ind.
                struct1-bukrs = w_orgid.
                struct1-cost = space.
                struct1-plant = space.
                append struct1.
          else.
             struct1-bukrs = w_orgid.
             struct1-change_ind = w_chngid.
             struct1-cost = space.
             struct1-plant = space.
             append struct1.
          endif.
       <b> else</b>.
        <b>delete struct1 index sy-tabix</b>.
      endif.
        append struct1.
           endloop.
    endif.
    endloop.

  • Set current record after dataset filter or sort

    How do you set the current record as the first record after a
    filter or sort? I have multiple dataset filters and sorts on the
    page and the current record always remains the first record after
    using them. Is there a way to force the current(viewed product,
    picture or whatever) to the first record after the Filter has been
    completed?

    thanks for your help,
    I was wanting the latter, "Or were you asking how to make the
    first row of the filtered data selected?" After the filter runs I
    want the current record set (to be displayed) to the first record
    in the filtered data.
    I am using the non-destructive filter method filter(), so I
    dont have to reload the data to bring the dataset back to original
    data, I can provide a reset button or set back to all records
    button.
    What I am using this for is a Home/Standard Plan Catalog. I
    want to filter our plans by square footage, number of bedrooms or
    baths, garage size, etc. so initalally it loads the complete
    catalog. the user selects the square footage range they want or any
    combination of specs and the filter works to narrow the dataset to
    the appropriate records. The filter works fine it returns the
    correct records from the dataset but after the filter I want the
    current (displayed) record to change after the filter, to the first
    record in the newly filtered data.
    Eventually we are going to have all 200 or so standard plans
    we have in the dataset and giving the user the ability to filter by
    these specs is the ultimate goal to help our customers make
    decisions. The page loads thumbnails of the exterior renderings for
    each standard plan. they click the thumbnail and it opens. With 200
    or so eventully I will have to page the results of the dataset or
    something else eventually, but I will cross that bridge when I get
    too it.
    here is my filter:
    >>>>>>>>
    function StartFilterTimerALL(){
    if (StartFilterTimerALL.timerID)
    clearTimeout(StartFilterTimerALL.timerID);
    StartFilterTimerALL.timerID = setTimeout(function() {
    StartFilterTimerALL.timerID = null; FilterDataALL(); }, 100);
    function FilterDataALL(){
    var SqFtVal = document.getElementById("sqft").value;
    if (!SqFtVal){
    dsStandards.filter(null);
    return;
    // for each value get the matching records sqftage
    if (SqFtVal == 1){
    var filterFunc = function(ds, row, rowNumber){
    var str = row["sqftage"];
    if (str < 1000)
    return row;
    return null;
    dsStandards.filter(filterFunc);
    if (SqFtVal == 2){
    var filterFunc2 = function(ds, row, rowNumber){
    var str = row["sqftage"];
    if ((str > 1000) && (str < 1501))
    return row;
    return null;
    dsStandards.filter(filterFunc2);
    if (SqFtVal == 3){
    var filterFunc3 = function(ds, row, rowNumber){
    var str = row["sqftage"];
    if ((str > 1500) && (str < 2001))
    return row;
    return null;
    dsStandards.filter(filterFunc3);
    if (SqFtVal == 4){
    var filterFunc4 = function(ds, row, rowNumber){
    var str = row["sqftage"];
    if ((str > 2000) && (str < 2501))
    return row;
    return null;
    dsStandards.filter(filterFunc4);
    if (SqFtVal == 5){
    var filterFunc5 = function(ds, row, rowNumber){
    var str = row["sqftage"];
    if ((str > 2500))
    return row;
    return null;
    dsStandards.filter(filterFunc5);
    thanks Jim

  • Return to the current page after refreshing

    Hello!
    When I refresh the current page I'd like to return to it, not to another page.
    When I choose "SAP Business Intelligence" forums link (with all subordinate forums in one screen) and go to previous pages (for example, to 3rd page), even if I return to 1st page when I refresh the screen it shows me again the 3rd one, not the first. It's very annoying. Could it be changed?
    Best regards,
    Eugene

    Eugene
    The forums are displayed in an iframe. Therefore, if you wanted to simply refresh the forums to the exact page that you have navigated to, you should right-click on the content area of SDN (the forums page) and choose the refresh option. This will refresh this window and should keep your place marker. If you refresh the URL in the browser window then this will refresh the entire SDN page and will take you to the entry point of the forums.
    I hope this helps
    D

  • Iterator getting refreshed before commiting.

    Hi,
    Scenario:
    User loads the first page. He can see his profile details. He clicks on a edit link ; it opens a popup to edit details along with a save and cancel button. He changes the his name and clicks on cancel. The cancel button will just close the edit popup.
    Problem:
    He will see his edited name in the front page. Only if he commits his edited name should appear in front page. Its happening because the same bindings am using in the first page and in the editable page.I tried giving in pageDef CacheResults="false"
    <iterator Binds="AdminVO1" RangeSize="25" DataControl="AppModuleDataControl"
    id="AdminVO1Iterator" CacheResults="false"/>
    But its not working. Please help me in this issue

    Hi Vinod,
    Thanks you very much. Its working fine. But i have one more query related to this . If am deleting one row in edit page on click of cancel on first page i need to show the deleted row;how can I retrieve that row back ;
    if we are deleting the row the row status will be 'unmodified' and
    currentRow.refresh(Row.REFRESH_UNDO_CHANGES); will be executed. I tried to refresh the iterator like iterator.setRefreshOption(8192);// as i found in one blog.
    Its also not working. Can you please tell me how can i refresh the iterator to show the deleted row when he goes back to the first page on click of cancel

  • Refreshing/clearing iterator (ADF bug?)

    Hi,
    I have three cascading SelectOneChoice lists.
    List A
    List B
    List C
    The user can select a value in List A, which Populates List B and List C. The user can then select a value in List B, which then narrows down the contents of List C. The problem is that list C now contains the results from the List A event and the List B event, instead of just containing the results of the new query.
    I am using EJB3, ADF Faces
    many thanks
    R

    Just realised that it's not a problem of not being able to refresh the iterator - I can - it's that the iterator still contains the data from the previous query... AND then the data from the requery. All I need to know is how to empty the contents of the iterator?
    Come on expert Oracles, I'm feeling lonely here :-)
    R

  • Newbie :  JSP session problem after reload with IE refresh button.

    Hi,
    I had an issue with JSP reloading using tomcat 4.* and IE.
    I have a jsp1.jsp is opened in two different IE windows(one by one). Once i refreshed using IE refresh button from the first window, its loaded with second windows session details. Its changess whole http request object with second window.
    Am not sure , why its happening ? Could anybody shed light on this ?
    Thanks and Regards
    PV

    Hello,
    No, am not saving any form details . But i noticed session id is changing completely for the first window once i loads frame on the second window.
    javascript:alert(document.cookie) Above scriptlet (IE address bar) returns session id from the second window rather than current window without refreshing, that means, its removed whole request completely or somehow manipulated previous sessions. Can anybody explain this behaviour ?
    Thanks

  • Current Record Pointer after ResultSet.DeleteRow()

    I have a question about the position of the Current Record Pointer in a ResultSet after a call to DeleteRow(). I have three records in the ResultSet, and call DeleteRow() while positioned on the first record. If I call moveToCurrentRow() or do not call any routine. It appears I am still pointed at the deleted first row. I can call getString() and get the data from the first row, which has been deleted. If I call next(), I find myself positioned on the third row, not the second row. How do I delete the first row and position myself on the NEW first row?

    Here it is again, this time with some formating.
        private void DeleteButtonActionPerformed(java.awt.event.ActionEvent evt) {
            try {
                int result = JOptionPane.showOptionDialog( PeriodicalMaint.this, "Delete Current Periodical?",
                                                          "Warning", JOptionPane.OK_CANCEL_OPTION,
                                                          JOptionPane.WARNING_MESSAGE, null, null, null);
                if ( result == JOptionPane.OK_OPTION ) {
                    String Periodical = PeriodicalField.getText();
                    deleteAllIssues( Periodical );
                    periodicalsRS.deleteRow();
                    JOptionPane.showMessageDialog(PeriodicalMaint.this,
                                                  "Periodical " + Periodical + " has been Deleted!",
                                                  "Periodical Deleted", JOptionPane.PLAIN_MESSAGE);
                    clearAllFields();
                    disableAllFields();
                    boolean rsEmpty = false;
                    periodicalsRS.moveToCurrentRow();
                    if ( periodicalsRS.isAfterLast() && !periodicalsRS.previous() ) {
                        rsEmpty = true;
                    if ( !rsEmpty ) {
                        populateAllFields();
                        addMode = false;
                        if ( Periodicals.UpdatePriv ) {
                            enableAllFields();
                        IssuesTable.setEditable( false );
                        NameField.requestFocus();
            catch (SQLException sqle) {
                JOptionPane.showMessageDialog( PeriodicalMaint.this, "SQLException: " + sqle.getMessage(),
                                               "Delete Error", JOptionPane.OK_OPTION );
        }

  • How to Select the Current Row When Using af:iterator?

    Hello all,
    I encounter the following problem when using af:iterator to display data from
    a View Object:
    When trying to display the content of a row via a popup, only the first row is
    returned no matter which row is selected. So a selection of the current row
    should exist or some other method which should allow the access to the
    current row.
    The af:table has a selectionListener attribute which permit to achieve this.
    Does anyone know about some similar attribute or some method for
    selecting the current row when the af:iterator is used?
    Thank you,
    Mirela

    I would be interested in the answer to this basic question as well. I cannot get the selected row value of an attribute in an iterator for a view if I simply set-up a attribute binding to the iterator. It seems that this should be possible. I've had no other option but to obtain the current row and the related attributes programmatically. This works fine, but if there is a more elegant option, then I'd certainly like to use it.
              <af:table value="#{bindings.CompaniesView1.collectionModel}"
                            var="row"
                            rows="#{bindings.CompaniesView1.rangeSize}"
                            emptyText="#{bindings.CompaniesView1.viewable ? 'No data to display.' : 'Access Denied.'}"
                            fetchSize="#{bindings.CompaniesView1.rangeSize}"
                            selectedRowKeys="#{bindings.CompaniesView1.collectionModel.selectedRow}"
                            rowBandingInterval="0" id="tCompanies"
                            summary="Companies"
                            width="100%"
                            rowSelection="single"
                            binding="#{CompanyBackingBean.companiesTable}">Page Def:
        <attributeValues IterBinding="CompaniesView1Iterator" id="Id">
          <AttrNames>
            <Item Value="Id"/>
          </AttrNames>
        </attributeValues>I should be able to get the Id attribute value of the current selected row using "#{bindings.Id}", right? Well, it doesn't work for me. Any ideas?
    Thanks

  • Reinstall of acrobat after my computer was refreshed! i have the lisence but no way to download

    reinstall of acrobat after my computer was refreshed! i have the lisence but no way to download

    Hi,
    Please use this link to download adobe acrobat.
    Download Acrobat products | 9, 8
    Regards,
    Devendra

  • Opening hotmail: Please refresh your browser window, When you access your Windows Live Hotmail account from more than one computer, we ask you to sign in again to help keep your account private and secure . Refreshed but no change. in Safari no problem

    opening hotmail in firefox: Please refresh your browser window, When you access your Windows Live Hotmail account from more than one computer, we ask you to sign in again to help keep your account private and secure . Refreshed but no change. in Safari no problem

    Go to '''Options '''on Firefox Browser-->'''Advanced'''-->''Click on'' '''Network '''tab-->''Select '''''Settings'''-->''Select '''''Use System Proxy Settings
    '''

  • Task flow return-Current Record pointing issue.

    Hi friends
    Newbie in ADF (basically from .net back ground)...........I am in the process of developing my first module.
    I have a task flow where a master detail records are displayed ..When I click "Edit" it is calling a edit task flow where the editing of master/detail tables are performed .When I click "New" a blank record is created and it is calling same edit task flow.
    my problem is when the child task flow exits and returns to the parent it is not pointing to the current record I edited...This is true if return either by commit or cancel.
    My data control is shared , parent task flow does not have any transaction and child always starts a new transaction.
    What is the ideal solution to point to the current record when I return?.
    Thanks .
    Ashraf

    Below is updated bean code
    ViewObject VO;
    FacesContext fctx = FacesContext.getCurrentInstance();
    DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding iter = bindings.findIteratorBinding("Delmast1Iterator");
    VO = iter.getViewObject();
    Key currKey = iter.getCurrentRow().getKey();
    Row[] rows = VO.findByKey(currKey, 1);
    if (rows.length == 1) {
    System.out.println("row found");
    VO.setCurrentRow(rows[0]);
    iter.executeQuery();
    iter.setCurrentRowWithKey(currKey.toStringFormat(true));
    iter.setCurrentRowWithKeyValue(iter.getCurrentRow().getAttribute("SaleId").toString());
    If my child task flow does not have a commit or rollback the above code works fine...But I am beginning a transaction in my child flow(edit flow) so it is a must to have commit/rollback.
    Is there any other options experts ?..Please guide me.
    Thax.

  • Keep the record in the view object if deletion failed.

    I have a view object which is based on the entity object, when I am trying to delete a row it failed because it has a child record associate with. I know the row is not delete from the database, but the record is deleted fromt the view.
    How to keep the record in the View object if delete failed?

    Hi,
    the row is not delete from the database,refresh the view . re-execute query and the view show the row

  • Update the record after insert

    Hi All,
    We have a requirement in Oracle Forms where the user should be able to insert the data into the custom table through the form. Once the user enters the data and does ‘Ctrl+S’, the record is saved in the database. After this if he has changed any of the details entered in record that is inserted(without refreshing the form) and does ‘Ctrl+S’, then a message is shown as per the standard form that the record is applied and saved. But the changes are not saved in the database.
    If anyone has worked on the similar requirement then please let us know how to implement this in Oracle Forms.
    Immediate help will be highly appreciated.
    Thanks and Regards,
    Aniruddha

    Hello:
    Change the target of the branch defined in the page that has your form to point to itself.
    Delete the 'reset page' page process defined on the form page.
    varad

Maybe you are looking for

  • ActionRequest Problem.

    Hi All Folks, I have got a problem with ActionRequest. I used to use Liferay portal and now I am porting something to Oracel Portal. I use JDeveloper and write JSR 168 portlets. So there aren't too many things to change. In somewhere in my code, I pu

  • VAT ON CAPITAL GOODS,

    Dear EXPERTS, I am using  condition type  JVCD  AND  JVCN    for  calculating  tax on capital goods  purchase,  I have maintained condition type JMOP & JMXI.   The  Excise base value is calculating fine, but  VAT is  NOT calculating  in PO,  Please s

  • IPlanet LDAP Maintenance

    I'm looking for maintenance commands for iplanets ldap. I got a core file in my log directory for iplanet ldap and I had to restart the service completely. The database is VERY heavily used, so I figured a bit maintenance work would work wonders. Any

  • Where can find latest version of Apache to download? And Tomcat?

    Hi! Can somebody give me an address in the Internet from where I can download Apache and Tomcat please? Thanks in advanse.

  • When to Expect Delivery?

    Here is a question for all those who have previously pre-ordered an iPhone from Apple. I pre-ordered the 32GB 3GS yesterday (June 8) for home delivery. Currently, under shipping estimate it says "Delivered by June 19". What exactly does that mean? In