4 Replies Latest reply on Jul 8, 2010 3:46 AM by Milo van der Zee

    Need help in refreshing a panel

    Satya K Newbie

      Hi,

       

      I have a shopping cart functionality in which user selects few items from dataTable by selecting each row by checkBox and clicks on a button.

       

      The backing bean adds these selected items to a cart object in http session. This cart object is used to refresh the shopping cart view. The ID of shopCart panel is provided for reRendered property of a4j:commandButton also.

       

      But the problem is... the cart object in session is updated normally and in a proper way by my backing bean (Seen by log messages). But the shopping cart view is not updated as per the values in cart object (i.e some times i see duplicate values or some times value itself not shown even though it is in session object). But if i reload the page by F5 or move out to another tab and move in again, then shopping cart view shows correct data.

       

      Is it because rerendering happens before session object is updated by backing bean?

       

      I also tried a4j:poll functionality to update only the panel in a periodic manner, that even didnt update the panel.

       

      Can the a4j:poll be used for only refreshing panel by reading daat from session scope or is ther any other way?

       

      My code is as below:

       

      Comman button which invokes bean method to add items to cart object in session scope :