In other words

I have a panel called OrderPanel  this has a 
WebMarkupContainer    ajaxSpinner,
AjaxFallbackDefaultDataTable  orderConfirmation,

AjaxSelfUpdatingTimerBehavior  updateBehavior,

In the constructor of the panel
I instantiate all the above components and call set visible false on 
orderConfirmation,
here is the code

  public OrderPanel(String id){
          super(id);

          add(ajaxSpinner = new WebMarkupContainer("ajaxSpinner"));
          add(orderConfirmation= new
AjaxFallbackDefaultDataTable("orderConfirmation",.............));
          orderConfirmation.setVisible(false);

          add(updateBehavior = new AjaxSelfUpdatingTimerBehavior(Duration
                .seconds(5));
                  // updates my model   
          new OrderProcessThread(getSession()).start();
     }


I override the method  onBeforeRender()  here I check the status of thread
which I started in the  constructor .
becasue of  AjaxSelfUpdatingTimerBehavior with a duration of 5 seconds the
onBeforeRender is called  every 5 seconds.

here is the code for onBeforeRender

         @Override
     protected void onBeforeRender() {
        super.onBeforeRender();

          if(((MySession)getSession()).isOrderProcessComplete(true)){
               // This means our worker thread has finished and updated the
session.
               // Now, we can update our view states to show the order
confirmation.
               ajaxSpinner.setVisible(false);
               orderConfirmation.setVisible(true);

               // update behavior
               updateBehavior.stop();
          }
     }




till here I am fine, I have no problems implementing   time consuming
selects .  

In case of   AjaxFallbackDefaultDataTable  It has sortable Headers  and
pagination links, when user 
clicks on any header or pagination link  the code in constructor is not
called so my thread is not started , so this time the method from
dataprovider is  called which is

 

 public Iterator iterator(int first, int count)

my actual implementation of this method   is it just returns the model which
is updated by  OrderProcessThread.

is there any method which I can override for    AjaxFallbackDefaultDataTable   
when   user clicks on sortable header or paginations links so that I can
restart the thread and the timer  ?
 

 



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/fter-1-minute-the-Pagemap-null-is-still-locked-by-Thread-ACTIVE-tp3423610p3428191.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to