Reset State Append

I have 3 screens.
Sc1 calls Sc2 that calls Sc3 using each one the ResetState = true.

I notice that the reset state is appended in the URL and this causes a problem in my application.

This is the URL after my second call
sh.wmp_rs=true&wmp6970.wmp_rs=true&wmp6970.wmp_rt=render&wmp6970.wmp_tc=6970&wmp_rt=render&editmode=false&wmp_tc=6964

Is there any way to clean the URL of the appended Reset State?

THanks

There isn’t a way to clear the previous params using just the CAF Controls so you’ll have to use the API. I’ve attached a sample app that demonstrates this. The code looks like:


	public String getPageThreeURL() throws Exception { 
		IPortletURL renderURL = createRenderUrl(); 
		renderURL.clearParameters();
		renderURL.clearState();
		renderURL.setBaseURL("portlet.three.page"); 
		renderURL.addPortletURL("portlet.three.portlet");

		return renderURL.toString(); 
		}

Regards,
–mark
NavigationTest.zip (14.5 KB)

hi

I dont think that this approach work, I will simplify the example.

I have page1 that contains a portlet link to page2. If I in the page1 dont use portletLink with ResetState=true then the page2 is loaded with data from DB only in the first time. This is a problem because if someone changes the data I will view old data. So from in the Page1 I need the ResetState=true.

However in page2 I have some Async actions. In my tests I saw:

Async actions from page2 never call the server side when in page1 I have ResetState=true.

Async actions from page2 call the server side when in page1 I have ResetState=false.

So that’s why I wanted to remove the ResetState parameter but only in the second page (since it seems it’s being added in the URL for the Async Actions).

So the question is: for my problem the best way is to remove the ResetState? if yes how? in javascript???

The problem can be solved in a different way?

Thanks

Maybe instead of reusing the same managed bean (shared between the two portlets), you could pass the parameter to the second portlet and use a different managed bean?

Are you sure that the Async actions in page 2 are not being called when the the resetstate is true?
Because, the application i’m working on has many navigations like the one you described and all the async actions are working perfectly right.

We’re using MWS 7.1.2 version.
We’re using a Portlet Simple link and Extended Portlet URL inside this, keep the keep state and reset state to false in this extended portlet URL and set the render type as action for this and give the alias in the base url. Drag and drop another Extended Portlet URL in the first Extended Portlet URL, set the keep state as false and reset state as true and set the render type as render only, set the Portlet with the alias of the portlet.

Try this and let me know if your issue is solved or not

Thanks a lot, it solved the problem

Hi, i tried to use this solution, but it wouldn’t work for me. I would appreciate it, if someone could have a look at my post [url]http://193.26.193.139/viewtopic.php?C=30&p=70765&sid=4c145793b0a0d77600a3ba70783c453a#70765[/url].

Thanks a lot!