Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
How do I reload mashup in runtime on session changed or service invoke completed event?
Tried location.reload(); in service.But it's not working.Please provide a way to achieve this.
Solved! Go to Solution.
I'm not clear how can you navigate to another page before logging in (since you said you navigated to a different page on a new tab, and after that you login in the home page).
Regardless, coming back to your first question, services are always executed server side, which means they don't have a page context (they can not act directly on the page, only via their result which is bounded to widgets).
As such, location.reload() written in a service, will never work.
The answer to your question is present in the articles below (as a quick hint, if you have access to the support portal, there are tons of articles there that can help you much faster in many cases; make sure you also search there)
https://www.ptc.com/en/support/article/CS240759
https://www.ptc.com/en/support/article/CS287379
Please explain the scenario you are trying to do with location.reload()
It is a method used at a low level in the HTML page methods which works exactly as the F5 (refresh) button and triggers a full reload of the page (which can be pretty slow).
There are other ways to refresh widgets to their default values - like the Mashup's ResetInputToDefaultValue. Would that work in your case?
I have clicked on a button and navigated to different page on a new tab from home page
After that I login in home page,session value changes.But login status is changing only on home page.
In the navigated page it's reflecting only after reload of navigated page.i have given same session change trigger in both cases and using same session parameter
I'm not clear how can you navigate to another page before logging in (since you said you navigated to a different page on a new tab, and after that you login in the home page).
Regardless, coming back to your first question, services are always executed server side, which means they don't have a page context (they can not act directly on the page, only via their result which is bounded to widgets).
As such, location.reload() written in a service, will never work.
The answer to your question is present in the articles below (as a quick hint, if you have access to the support portal, there are tons of articles there that can help you much faster in many cases; make sure you also search there)
https://www.ptc.com/en/support/article/CS240759
https://www.ptc.com/en/support/article/CS287379
Your point is correct as reloading entire page makes it very slow.
Session updates after logging in on Home page.
I am using changed session value on a navigated page.Session changed value is given to button(Disabled) on home mashup and navigated mashup too.It's reflecting in homemashup with reload but navigated mashup needs a reload to reflect button(disabled) status.Please find the attachments below of both the mashups.
Please let me know what's the issue is about.
The session change events will only take effect within the same page, they won't work in your scenario in the way you want. So what you need to do is to use a wrapper service that reads on the server side the session variable that drives the Disabled state, and trigger it manually via a button.
The session variables in a page will get get a new value only when a widget in the same page updates them (like an expression), and on page load, but not when being updated from another page (that will set that variable in that page context only and on the server side).
But, can you explain me how are you able to get all the weather data in the Login page without being actually logged in? ThingWorx doesn't allow unaunthenticated access to its mashups.In my thinking, the mashup should not allow you to switch to another page if you're not logged in because you would not be able to see the home mashup itself.
Are you using maybe a two layers authentication method?
Thank you so much.
We are not following traditional login method on thingworx which is possible only after logging in.We went for a pop-up login on login button click and authentication on popup as requirement is like that