Page 1 of 1

Redirect to a filtered list

Posted: Tue Jan 22, 2013 5:31 am
by denis
Hi,

I added a new tab in customer section to display a list of subscriptions (http://i.imgur.com/pKlCfqK.png) :

Image

I would like to redirect the admin to the subscription section when he click on the cell, to display the detail of this subscription :
Image

What i have done :

In MyCustomerPresenter :

Code: Select all

((CreateBasedListStructurePresenter) customerSubscriptionPresenter).getRowDoubleClickedHandlerRegistration().removeHandler();
      getDisplay().getCustomerSubscriptionDisplay().getGrid().addCellDoubleClickHandler(new CellDoubleClickHandler() {      
         @Override
         public void onCellDoubleClick(CellDoubleClickEvent event) {
            String subscriptionId = event.getRecord().getAttributeAsString("id");
                    Window.Location.assign(BLCMain.webAppContext + "#moduleKey=BLCCustomerCare&pageKey=Abonnement&itemId="+subscriptionId);

         }
      });


It works, but all the page is reloaded. Is there another mean without reloading all the page ?

Thanks in advance for your help

Re: Redirect to a filtered list

Posted: Tue Jan 22, 2013 11:23 am
by phillipuniverse
Try replacing this:

Code: Select all


Window
.Location.assign(BLCMain.webAppContext "#moduleKey=BLCCustomerCare&pageKey=Abonnement&itemId="+subscriptionId);
 


With this:

Code: Select all


History
.newItem("moduleKey=BLCCustomerCare&pageKey=Abonnement&itemId="+subscriptionId);
 


Window.Location.assign causes all the GWT state to be lost while History.newItem causes it to stay intact. That should greatly decrease your load times.

Re: Redirect to a filtered list

Posted: Tue Jan 22, 2013 1:00 pm
by denis
Perfect it works !

Thanks !!!