Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6715825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:39:39+00:00 2026-05-26T08:39:39+00:00

I have a table that consists of rows of reports. A back bean method

  • 0

I have a table that consists of rows of reports. A back bean method that is tied to a check box value change event is getting the row IDs and populating an array (rowsToBeRemoved) with this IDs. Another method gets this array and removes the object from reportlist class:

ObjectListDataProvider reportList = new ObjectListDataProvider();
List<RowKey> rowsToBeRemoved=new ArrayList();
Integer rowsToBeRemovedIndex = 0;

 for(RowKey rowToBeRemoved:rowsToBeRemoved){

            try {                
                System.out.println("rowToBeRemoved.toString()" + rowToBeRemoved.toString()); // outputs: rowToBeRemoved.toString()RowKey[0] 

                Report report = (Report) reportList.getObject(rowToBeRemoved);

                System.out.println("report.getId()" + report.getId()); //outputs: report.getId()199|


                Query resultQuery = queryGeneration(report.getId());
                List<String> dropTableQueries = resultQuery.getResultList(); // generated the queries to drop r tables


                for(int i=0; i<dropTableQueries.size(); i++){

                   String aDropTableQuery;
                   aDropTableQuery = dropTableQueries.get(i);
                    System.out.println("adroptableuery" + aDropTableQuery);// get single drop table query. outputs adroptableueryDROP TABLE r_199_0
                   entityManager.createNativeQuery(aDropTableQuery);
                    System.out.println("entitymanager dropTableQueries is invoked");//OK
                   reportList.removeObject(rowToBeRemoved);
                    System.out.println("removeObject");//OK
                    if (reportList.isRemoved(rowToBeRemoved)){
                        System.out.println("object removed");//OK
                    }                    
                    reportList.commitChanges();
                    System.out.println("commitchanges");//OK

               }
                reportJpaController.delete(report);
                reportList.removeRow(rowToBeRemoved);
                reportList.commitChanges();
                analyzerResultService.drop(report.getId().longValue());
                //rowsToBeRemoved.remove(rowsToBeRemovedIndex);
            } catch (Exception e) {
                error("Cannot delete report with row key " + rowToBeRemoved + e);
            }

The code executes fine, removes the object from the reportlist but after that my table brings up a mixed reportlist. If I refresh the page it brings the reportlist in correct order, otherwise it doesn’t. And if I try to delete a row in the mixed state it deletes the report as if it is in correct order, thus ending with deleting the wrong report. I hope I could explained.. What am I doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:39:39+00:00Added an answer on May 26, 2026 at 8:39 am

    I think this is similar to what you’re looking for: How to refresh entire JSF page from the backing bean

    This doesnt just refresh one part of the page though, but the full page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Html Table which consists of rows that were generated dynamically (from
I have an tblEmployeeProfile & a tblPersonnel. tblPersonnel is an HR table, that consists
I have a MS access database. In that, one table consists of questions and
I have a table that looks like this: id value AGA 0.211 AGA 0.433
I have a html table which consists of columns for days, and rows for
I have a table that contains approximately 22000 rows and I used a Boolean
I have a table closures that consists of times when my client's business is
I have a database with a table that consists of 65k+ entries, which is
I have a table that consists of two columns: question and answer. I currently
Im not quite sure. I have a table that consists of 2 foreach loops(2

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.