7 Replies Latest reply on Feb 7, 2013 10:25 AM by 985680


      Hello ,

      I am usinf Jdeveloper
      I want to delete a row from af:table and from database.
      I want to select the row using checkbox and click 'delete' to delete.
      I am using this function :

      DCBindingContainer bindings = (DCBindingContainer)getBindings();
      DCIteratorBinding iter = bindings.findIteratorBinding("InterviewView1Iterator");
      for (int i = 0; i < iter.getViewObject().getEstimatedRowCount(); i++) {
      Row row = iter.getRowAtRangeIndex(i);
      if (true == row.getAttribute("SelectedRow") )

      the problem is if I select more than 1 row and click delete.. just 1 row is deleted.

      any siggestions ?

        • 1. Re: Delete
          Check out example

          1 person found this helpful
          • 2. Re: Delete
            Timo Hahn
            FARAJ, Please format code you post here. Read the FAQ (https://forums.oracle.com/forums/help.jspa) to find out how to format code.

            I see some problem here. First of all, you are iterating over all rows. If you have many of them and only have a couple of selected rows, it's a big waste of time and memory. The af:table gives you the ability to select multiple rows which are accessable via the selectedRowKeys property. OK, then you don't select the rows using a checkbox.
            If you really want to use a checkbox, let me ask if you have added the transient attribute for this in the EO. Then you schould call a method in the application module or hte VO which does the work (remove the row in your case). You should not do this from a bean method.
            To to the 'How to iterate a rowset' question.
            you can use this code inside your VO
                private static ADFLogger _logger = ADFLogger.createADFLogger(EdossSexViewImpl.class);
                public void deletecheckedRows() {
                    RowSetIterator delRowIter = this.createRowSetIterator("del_me");
                    while (delRowIter.hasNext()) {
                        Row row = delRowIter.next();
                        if (true == row.getAttribute("SelectedRow")) {
                            String msg = row.getAttribute(0).toString();
                            _logger.info("Information:" + msg);
            and call it via a button from the UI.

            • 3. Re: Delete
              hello ,

              I used the steps in this example.
              I did the same but when I check more than a row and I click the delete button .. only 1 row is deleted.

              do u have any idea?

              • 4. Re: Delete
                Is rowSelection="multiple" in your table component?
                • 5. Re: Delete
                  yes it is 'multiple'

                  any idea ?
                  • 6. Re: Delete
                    Hi timo ,

                    I used this code but i still have the problem.. if I check more than 1 box and I click the delete button.. not all the rows are deleted... any idea ?

                    thanks again,

                    • 7. Re: Delete
                      I am getting this error :

                      Attempt to access dead view row of persistent id 1