How to hide row from table after logical delete

Hello.
I am using Jdeveloper 11.1.1.3.0, ADF BC and ADF Faces.
I want to implement Logical delete in my application.
In my Entity object I have Deleted attribute and I override the remove() method in my EntityImpl class.
    @Override
    public void remove()
       setDeleted("Y");
    }and I added this condition to my view object
WHERE NVL(Deleted,'N') <> 'Y'in my page I have a table. this table has a column to delete each row. I dragged and drop RemoveRowWithKey action from the data control
and set the parameter to *#{row.rowKeyStr}* .
I what I need is this:
when the user click the delete button I want to hide the roe from the table. I tried to re-execute the query after the delete but the row is still on the page. Why execute query does not hide the row from the screen.
here is the code I used for delete and execute query
    public String deleteLogically()
        BindingContainer bindings = getBindings();
        OperationBinding operationBinding = bindings.getOperationBinding("removeRowWithKey");
        Object result = operationBinding.execute();
        DCBindingContainer dc=(DCBindingContainer) bindings;
        DCIteratorBinding iter=dc.findIteratorBinding("TakenMaterialsView4Iterator");
        iter.getCurrentRow().setAttribute("Deleted", "Y");
        //iter.getViewObject().executeQuery();
        iter.executeQuery();
        return null;
    }as you see I used two method iter.getViewObject().executeQuery(); and  iter.executeQuery(); but the result is same.

Thank you Jobinesh.
I used this method.
    @Override
    protected boolean rowQualifies(ViewRowImpl viewRowImpl)
      Object attrValue =viewRowImpl.getAttribute("Deleted"); 
        if (attrValue != null) { 
         if ("Y".equals(attrValue)) 
            return false; 
         else 
            return true; 
        return super.rowQualifies(viewRowImpl);
    }But I have one drawback for using it, and here is the case:
If the user clicks the delete button *(no commit)* the row will be hidden in the table, but when the user click cancel changes the row is not returned since it is not returned due to the rowQualifies(ViewRowImpl viewRowImpl) (the Deleted attribute is set to "N" now).
here is the code for delete and cancel change buttons
    public String deleteLogically()
        BindingContainer bindings = getBindings();
        OperationBinding operationBinding =
            bindings.getOperationBinding("removeRowWithKey");
        Object result = operationBinding.execute();
        DCBindingContainer dc = (DCBindingContainer)bindings;
        DCIteratorBinding iter =
            dc.findIteratorBinding("TakenMaterialsView4Iterator");
        iter.getCurrentRow().setAttribute("Deleted", "Y");
         iter.executeQuery();
        AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
        adfFacesContext.addPartialTarget(this.getTakenMaterialsTable());
        return null;
    public String cancelChanges(String iteratorName)
        System.out.println("begin cancel change");
        BindingContainer bindings =
            BindingContext.getCurrent().getCurrentBindingsEntry();
        DCBindingContainer dc = (DCBindingContainer)bindings;
        DCIteratorBinding iter =
            (DCIteratorBinding)dc.findIteratorBinding(iteratorName);
        ViewObject vo = iter.getViewObject();
        //create a secondary RowSetIterator to avoid disturbing row currency
        RowSetIterator rsi = vo.createRowSetIterator(null);
        //move the currency to the slot before the first row.
        rsi.reset();
        while (rsi.hasNext())
                currentRow = rsi.next();
                currentRow.setAttribute("Deleted", "N");
        rsi.closeRowSetIterator();
        iter.executeQuery();
        AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
        adfFacesContext.addPartialTarget(this.getTakenMaterialsTable());
        return null;
    }as example, if the user initially has 8 rows, then deleted 2 rows, in cancelChanges only 6 rows appears. and the deleted rows are not there??
any suggestion?

Similar Messages

  • How to Hide Row in table view depend on condition

    Dear Friends,
    Please any one suggest how to do hide some rows in table depend on condtions.
    My Issue is :
    I have table with binding componant context controller, with in that some rows are no need to disply in my table, I tried to delete that entities from collection wrapper in do_prepare_output. but that entites are perminatly deleted from model node.
    how can achive this with out delete entities from model node and hide some rows in table view.
    thanks & Regards

    Hi Andrew,
    Please can you explain alobrate, because i wont' found that method in my implimentation and it's table config like follow
    <% IF attr->check_consistency( ) eq abap_true. %>
        <chtmlb:configTable  xml="<%= lv_xml %>"
                             id="TextList"
                             navigationMode="BYPAGE"
                             onRowSelection="select"
                             table="//Text/Table"
                             width="100%"
                             selectedRowIndex="<%=Text->SELECTED_INDEX%>"
                             selectedRowIndexTable="<%=Text->SELECTION_TAB%>"
                             selectionMode="<%=Text->SELECTION_MODE%>"
                             usage="ASSIGNMENTBLOCK"
                             visibleRowCount="3"/>
      <% ENDIF. %>
    thanks & Regards
    Ganesh

  • How to update duplicate row from table

    Hi,
    how to update duplicate row from table?
    First to find duplicate row then update duplicate row with no to that duplicate row in oracle.
    can you give me suggestion on it?
    Thanks in advance.
    your early response is appreciated...

    In order to find a duplicate row, see:
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1224636375004
    (or search this forum, your question has been asked before)
    In order to update it, just create and use an Oracle sequence, have it start and increment at a value that doesn't exist in your table.
    If that doesn't get you going, post some CREATE TABLE + INSERT INTO statements, and the results you want from them, in other words: a complete testcase.

  • How to hide rows?

    Hello folks,
    I just would like to know that how to hide rows except dbms_rls package? I mean, it has been said that I can hide rows to create views but lets said that I have got 200 students and each student can see only their rows in students table, in that scenerio I have to create 200 views, isn't it? I just would like to learn that how to hide rows with using views? Do you have any ideas?
    Note: I know dbms_rls package, except this solution I am tryin to find onather solution.
    Thanks a lot.

    Hi,
    Polat wrote:
    Hello folks,
    I just would like to know that how to hide rows except dbms_rls package? I mean, it has been said that I can hide rows to create views but lets said that I have got 200 students and each student can see only their rows in students table, in that scenerio I have to create 200 views, isn't it? No! As you realized, that's not practical.
    If every student is a separate Oracle user, the USER fucntion will return the name of the current user. A view definition can reference that function, like this:
    CREATE OR REPLACE VIEW view_x
    AS
    SELECT   *
    FROM    table_x
    WHERE   student_account  = USER;If you logged in to Oracle as POLAT, then the view will contain only rows where student_account='POLAT'.
    If you logged in to Oracle as SYSTEM, then the view will contain only rows where student_account='SYSTEM'.
    If students do not have thier own Oracle accounts, then they are probably authenitcated by some procedure in your package. That procedure can set a SYS_CONTEXT variable, or write data to a global temporary table, which you can then use instead of the USER function in view definitions.
    Note: I know dbms_rls package, except this solution I am tryin to find onather solution.Why can't you use dbms_rls, or why don't you want to use it? It's a very powerful tool, and not vey hard to use.
    I'm not saying there's never a good reason not to use dbms_rls; I'm just asking if you have one.
    I hope this answers your question.
    If not, give a specific example of what you want. Post CREATE TABLE and INSERT statements for some sample data for all tables involved. Identify 2 or 3 different students, and show what the contents of the view should be for each student, given the same sample data. If students do not log in to Oracle with their own usernames, then explain how you know which student is currently logged in.

  • How to hide fields in Table maintenace screen

    I have created a view with table maintenance generator. I would like to hide some fields. With event I am able to fill in those fields but I want to hide those from screen.

    HI, 
    This is reff with ur below post, I have been stuck with same problem,
    I got your code, how its functioning, but didn't get get where i have to write it.
    plz tell me in brief.
    Thanks in Advance.
    Regards
    Vivek
    Re: How to hide fields in Table maintenace screen  
    Posted: Feb 6, 2009 11:42 AM   in response to: Aarti Ramdasi in response to: Aarti Ramdasi           
    Click to report abuse...             Click to reply to this thread      Reply
    Hi,
    You can hide the fields like this..
    For example
    select-options:
    s_carrid for spfli-carrid modif id gr1,
    s_connid for spfli-connid modif id gr1,
    s_cityto for spfli-cityto modif id gr2.
    I am going to hide last fied..To do this
    at selction-screen output.
    if s_carrid is initial or s_connid is initial.
    loop at screen.
    if screen-group1 CS 'GR2'.
    screen-active = 0.
    modify screen.
    endif.
    endloop.
    endif.
    whenever u click on any one of the field i.e. carrid or connid the third field will displayed.Otherwies the last field cityto is not visible initially
    Regards
    Kiran

  • How do I restore column headings in Response table after accidently deleting them? Undo doesn't work.

    How do I restore column headings in Response table after accidently deleting them? Undo doesn't work (only seems to go back one level). I also have so many headings I won't be able to type them in manually!

    With the help of information from user, ptressel, in [https://support.mozilla.org/en-US/questions/1032154#answer-673322 a post here about the existence of sessionstore.js when version 33 was released], I was able to easily recover my tabs and tab groups as follows:
    # close Firefox and, perhaps, allow a few seconds (30s?) for any final closing of files;
    # check to see if you have a sessionstore.js file in your profile folder, named like the one I documented in my original post above;
    # if it is not timestamped prior to the discovery of your problem, open the sessionstore-backups folder;
    # check if the recovery.js file is suitably timestamped and, if not, the recovery.bak.
    # At this point, you are likely to find that none of them are prior to your problem occuring. If so, open your backups of this folder and go through steps 2-4 to find a file prior to your problem occuring.
    # When you find a file, copy it to the root of your current profile folder and name it, "sessionstore.js"
    # Open Firefox. Mine opened up as desired.
    This is a Windows solution. Sorry I can't comment on other platforms, but I'd bet that as this is just a file copy and renaming, it is likely the same.
    For Windows users, you may find you need to sign out and login as an administrator in order to access the backups. You need not logoff your standard account, but do have Firefox closed as described above.
    Hope that helps.

  • How to hide rows if all values are Zero  (0) horizontally?

    Hi,
    I have got a requirement to hide rows from the results if all values are equal to zero horizontally.
    Example:
    Region   M1    M2   M3
    East     0      0    3
    West    10     20    0
    South   -5      0    5
    North    0      0    0In the above example only North Region row should be hidden from the results becasue all the measures values are zero.
    Can someone please let me know the logic to achieve this?
    Thank in advance.

    Hi Karthik,
    Your answer was spot on(you are awarded points) but not my question. My client uses some X erp, which removes all zero value records when he clicks to see results. He wanted the same thing for Answers (he does not want to add any filters). Is there anyway to achive that, like using javascript or something?
    Thanks in advance.

  • How to hide rows with merged cells?

    I would like to know how to hide rows on numbers with merged cells, could do it normally at excel but I am not being able to do it at Numbers.
    thanks!

    Felipe,
    To hide a row with Merged Cells, Un-Merge first, then Hide. Select the Merged Cells and Table > Unmerge.
    Note that this is only a problem with vertically merged cells when you want to Hide a Row.
    If you want to Hide a Column, you can't have a Horizontal Merge that involves that Column.
    Jerry

  • How to retrieve data from table(BOM_ITEM)

    Hi All,
    I wrote webservices using axis1.4 to get BOM information from SAP.. funtional module is CAD_DISPLAY_BOM_WITH_SUB_ITEMS
    webservices works fine..I'am able to retrieve data from Export Parameter..But not able to retrieve data from table
    How to retrieve data from table(BOM_ITEM)..?
    Cheers, all help would be greatly appreciated
    Vijay

    Hi,
    1. Create Page Process.
    2. Select Data Manipulation
    3. In category select "Automated Row Fetch"
    4. Specify process name, sequence, select "On Load - Before Header" in point.
    5. Specify owner, table, primary key, and the primary key column(Item name contains primary key).
    6. Create a process.
    7. In each item select "Database Column" in "Source Type".
    Regards,
    Kartik Patel
    http://patelkartik.blogspot.com/
    http://apex.oracle.com/pls/apex/f?p=9904351712:1

  • How to hide libraries from breadcrumb in SharePoint 2013?

    Hi,
    How to hide libraries from breadcrumb in SharePoint 2013? just we want to display parent and least node like below,
    Home Site > Test page
    not like,
    Home Site > Pages > Test page
    Please help us to resolve this.
    Thanks., Prakash

    hi
    OTB breadcrumb have many problems, e.g. it doesn't work properly also with friendly urls. The simplest way is to create custom breadcrumb, e.g. as shown here:
    Building breadcrumbs the way you want it in SharePoint 2010.
    Blog - http://sadomovalex.blogspot.com
    Dynamic CAML queries via C# - http://camlex.codeplex.com

  • Deleting rows from table based on value from other table

    Hello Members,
    I am struck to solve the issue said below using query. Would appreciate any suggestions...
    I have two tables having same structures. I want to delete the rows from TableA ( master table ) with the values from TableB ( subset of TableA). The idea is to remove the duplicate values from tableA. The data to be removed are present in TableB. Catch here is TableB holds one row less than TableA, for example
    Table A
    Name Value
    Test 1
    Test 1
    Test 1
    Hello 2
    Good 3
    TableB
    Name Value
    Test 1
    Test 1
    The goal here is to remove the two entries from TableB ('Test') from TableA, finally leaving TableA as
    Table A
    Name Value
    Test 1
    Hello 2
    Good 3
    I tried below queries
    1. delete from TestA a where rowid = any (select rowid from TESTA b where b.Name = a.Name and a.Name in ( select Name from TestB ));
    Any suggestions..
    We need TableB. The problem I mentioned above is part of process. TableB contains the duplicate values which should be deleted from TableA. So that we know what all values we have deleted from TableA. On deleted TableA if I later insert the value from TableB I should be getting the original TableA...
    Thanks in advance

    drop table table_a;
    drop table table_b;
    create table  table_b as
    select 'Test' name, 1 value from dual union all
    select 'Test' ,1 from dual;
    create table table_a as
    select 'Test' name, 1 value from dual union all
    select 'Test' ,1 from dual union all
    select 'Test' ,1 from dual union all
    select 'Hello' ,2 from dual union all
    select 'Good', 3 from dual;
    /* Formatted on 11/23/2011 1:53:12 PM (QP5 v5.149.1003.31008) */
    DELETE FROM table_a
          WHERE ROWID IN (SELECT rid
                            FROM (SELECT ROWID rid,
                                         ROW_NUMBER ()
                                         OVER (PARTITION BY name, VALUE
                                               ORDER BY NULL)
                                            rn
                                    FROM table_a a
                                   WHERE EXISTS
                                            (SELECT 1
                                               FROM table_b b
                                              WHERE a.name = b.name
                                                    AND a.VALUE = b.VALUE))
                           WHERE rn > 1);
    select * from table_a
    NAME     VALUE
    Test     1
    Hello     2
    Good     3Edited by: pollywog on Nov 23, 2011 1:55 PM

  • How do I recover a background after accidentally deleting it from the background catalog

    How do I recover a background after accidentally deleting it from the background catalog

      Close Photoshop Elements Editor and Organizer.
    Navigate to:     
    //Library/Application Support/Adobe/Photoshop Elements/11.0/Locale/en_US/
    Delete the file Mediadatabase.db3.
    Re-launch Photoshop Elements Editor. A progress bar appears as the media database is re-created. Wait for this process to complete. It make take some time and the screen may periodically go blank; so go away and get yourself a coffee and be patient.
      N.B. If you have any of your own custom effects, you may need to re-create/re-install them.
     

  • How to hide ribbon from all item view for particular user group

    hi friends
    how to hide ribbon from all item view of particular list for specific user group.
    using OOB functionality or javascript. 

    Hello,
    Use this codeplex tool to hide ribbon to user group:
    http://spribbonvisibility.codeplex.com/
    If you don't want to use above tool then you have to add SPSecuritytrimming in "Rajiv Kumar" code for filtering based on user group permission.
    http://www.topsharepoint.com/hide-the-ribbon-from-anonymous-users
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • HT204088 how do you recover itune money after you deleted number from account?

    How do i recover my money after i deleted the itune card number?

    Once you redeem the card the balance stays in your account until you use it.
    You only need the card once.

  • Capturing the row selector and perform logical delete

    Hi All ,
    I add a tabular report in one of my page .But in the MULTI_ROW_DELETE button I like to capture the checkbox (row selector) and fire a PL/SQL anonymous block where rather than performing actual row delete it will update a database field and perform some sort of logical delete .
    Now my problem is I cant able to capture that what are the rows need to be logically deleted :
    DECLARE
    vRow BINARY_INTEGER;
    BEGIN
    FOR i IN 1 .. apex_application.g_f01.COUNT
    LOOP
    vRow := apex_application.g_f01(i);
    update test123 set delete_flag='y' where col2=vRow ;
    end loop;
    end;
    Its throwing error .Can anyone help on this pls how to write the pl/sql code to perform the logical delete.
    Thanks in advance ,
    Regards,
    Debashis.

    Guys ,
    Got the solution by searhcing several of the therads from Denes...
    Create the checkbox from Form page :
    htmldb_item.checkbox(1,t.USERNAME) DeleteItem,
    and then captured it as :
    FOR i in 1..HTMLDB_APPLICATION.G_F01.count
    LOOP
    UPDATE table1 set DELETE_FLAG='Y'
    WHERE USERNAME = HTMLDB_APPLICATION.G_F01(i);
    END LOOP;
    Cheers,

Maybe you are looking for

  • Distributed services with load balancing and failover?

    Hullo; What platform would you use to implement something like the following: * easy registration of various services * delegation of a service request to the best candidate of many, based on some measure (probably reported by the services themselves

  • Contact Sheet II error message

    I tried opening the Contact Sheet II app in Elements and got these two messages: The first message that appeared was: The operation could not be completed. The file or directory could not be found. Next message was: Could not complete the Contact She

  • What browser do you use?

    Hi, I'm having some usability problems in Planning. IE9 doesn't work very well sometimes and Chrome doesn't even open workspace for me. What browser do you recommend? (v11.1.2.1)

  • NOKIA N73 headset problems!!! HELPP!!

    nokia headset only works in only one ear when connect but tryedin other phones and headset works both

  • Re: my macbook Pro will not startup.

    when trying to turn my macbook Pro on it repeats the start up sound continuously, with the disk drive eject sound every 20 seconds or so. prior to this occurring, my screen flickered, and then the computer froze.