How to set page item to null, when browser is reloaded. I tried with DA after refresh but, it works only when I change page inside application not for reload page on browser button.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, it will reload, because on reload, I am redirecting to the same page.
Thank you Vinish!
I’ll consider what’s the best solution for me, in my opinion, twice reload does the job but, it doesn’t look nice.
Ok I will try to find another solution. 😂
Hi Vinish!
Thank you so much for your effort to help me, I set value for the item in column link.
For instance, when I click in badge list on status NEW, I get records in IG where status = NEW. I see that when I reload the page, the item value still exists in URL. Although the item is NULL on the page, and IG still shows results for the old item value.
Your requirement is really interesting Pavlo.
Now I have changed the JavaScript code to redirect to the same page by setting the page item to null.
So the DA will be the same on Page Load to execute JavaScript code. But now update the code with the following:
Here the 15 is the target page number, change it with your page number, and then the other 15 is the clear cache page, specify the same target page value. Change the item name P15_NEW to your page item.
If you have more items then separate it by a comma. For example:
And notice, that the after last page item P15_NEW2 there is a colon (:) to end the page items and then concatenating the null values as (||”,”).
I tested, and it worked. Let me know if this approach suits you.
Works now but, I don’t know why the page is reloaded twice when I click on reload button.
Hi Pavlos, after a little research I found the solution and I take my words back that it can not be done 😅.
Create a dynamic action on Page Load as Execute JavaScript code and add the following code in it:
You can set all item values to null between the above if condition. I tested and it is working fine.
Please test and let me know if it works for you.
Then, in this case, you just can’t expect the items to clear on just page reload/refresh.
The clear session state method should work. I tested here already.
When I add before header process, type: Clear Session State like in your answer, the item is always null I can’t set the value.
I added to the demo app, you can take a look.
Works now but, I use links which set item value and should change IG report on click. For that, I need to submit the page.
I have modified the application now, please check.
First of all, when we set a page item using the redirect to page option the session state is set and the page will reload. Then the item session state can not be cleared when reloading or refreshing the page. And if we will call the clear session state at this point it will make the null always as it is doing it already.
So I have changed the way of setting item value, using the Set Value DA, and now when you will set the item value and will refresh the page the item will set to be null because of the clear session state process.
But I understand that if your requirement is to call the page using the redirect option, then you won’t be able to make items null on page refresh because the item state is set and page loading is in progress.
Please let me for further questions.
Sorry, I think I didn’t explain well.
I’ve created a demo app you can take a look here
Workspace: apex1, user: testuser, password: 73s7us3r!@#
You can set the value of the item by clicking the button. When the value of the item is set, and I reload the page on the browser reload button, I want to set the item to null.
Oh, finally I checked your code.
On button click, you are redirecting to the same page by setting the item value to 1.
Which is now impossible to set as null.
Thank you Vinish, sorry for a bad explanation.
I added DA after refresh and this DA set value for the item to null when I change page or click on the same page in the menu. But, doesn’t work for reload.
I opened your app to see the code, but I think you changed. Can you revert it?
I deleted DA, now it’s like before.
There is no DA, I tried with and doesn’t work.
The method I suggested above should clear your items.
I saw your demo application, I can not see the source code of your application, but I doubt that your Set Value action is executing on the page reload.
Please turn-off the Fire on Initialization for the Set Value action.
Thanks for your response Vinish!
I tried, but on this page, I can set the value for the item, when I do that the page is submitted. and the item is always null
Ok, if this is not working, then try to create a dynamic action on page load and set the action as Set Value. Below is the screenshot:
If more than one item, then change SQL as follows:
Select null n1, null n2, null n3 from dual
Then set the affected items also.
Create a before header process as a clear session state and set the clear all items on the current page from the drop-down for the Type setting or specify the specific items.
Below is the screenshot:
Please let me know if any questions.