Removing external parameters from url

Hi,
is there some way to remove parameters from url (browser addressbar) after parameters have been handled?

I have a direct link to one child window in our application that works correctly, but I can’t change to any other child window after I have used this link. I need some way to remove this parameter so it won’t get handled more than once.

[code]
public void handleParameters(Map parameters) {
if (parameters.containsKey(“xxx”)) {
try {
ClassLoader classLoader = PSCApplication.class.getClassLoader();
Class<? extends AbstractWindow> xxxWindow = (Class<? extends AbstractWindow>) classLoader
.loadClass(“xxx.yyy.ooo.XxxWindow”);

			getMainLayout().setMainWindow(xxxWindow);

		} catch (Exception e) {
			log.error("Couldn't load class XxxWindow because of: ", e);
		}
	}
}

[/code]- markus

Hi!

You forward the browser to different url with Window.open method. I think you can achieve what you want by forwarding it to you applications location like this (works if in application class):



getWindow().open(new ExternalResource(getURL()));

cheers,
matti

Hi!

Worked great, thanks!

Is there some easy way to show notification in redirected page? My code is at the moment like this

[code]
PSCApplication.getCurrent().getMainWindow().open(
new ExternalResource(PSCApplication.getCurrent().getURL()));

Notification notification = new Notification(CommonResources
.getMessage(“info_logged_out”),

Notification.TYPE_HUMANIZED_MESSAGE);
notification.setDelayMsec(3000);

PSCApplication.getCurrent().getMainWindow().showNotification(
notification);
[/code]but it won’t show the notification message in opening page.

  • markus

Hi!

The notification is now “shown” on the previous view (which gets immediately redirected). You need to defer displaying of the notification somehow. I’d try setting the notification in a separate thread. If that doesn’t work you need to build some kind of queue for your notifications and handle them in transaction listener.

cheers,
matti

Hi.

Is there a way to clear out the Page.getCurrent().getLocation().getQuery() parameters after the parameters are processed and you can’t have them keep showing up and reprocessing over and over again when you go back to the same location or if you do a Page.getCurrent().getLocation().getSchema() + “:” + Page.getCurrent().getLocation().getSchemeSpecificPart()?

Brett