NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

how to reinstantiate a managed bean to show updated data?

 
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users
View previous topic :: View next topic  
Author Message
farhad



Joined: 19 May 2012
Posts: 2

PostPosted: Fri May 25, 2012 11:25 am    Post subject: how to reinstantiate a managed bean to show updated data? Reply with quote

hey guys,
I am showing the data from a VIEW, then getting this data trying to update the database tables related to the view. it is perfectly working and the database gets updated. but the View still showing the same data retrieved previously, I have a session scoped managed bean and the data is retrieved from view with the following method and passing the list to the JSF datatable.
Code:
public List getProducts() {
        return productsSessions.getProducts();
    }


the session bean is stateless and local. the for the session bean is like:
Code:

public List<VProducts> getProducts() {
        try {
            Query query = em.createNamedQuery("VProducts.findByDELIndicator").setParameter("dELIndicator", 0);
            return query.getResultList();
        } catch (Exception e) {
            throw new EJBException(e.getMessage());
        }
    }



So, now I want to find a way to show the updated data in the page. the main problem here seems to be different between tables and View. tables are updated but the view show same data. but when you clean and build the application, the changes are displayed

I appreciate your help.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo