Home › Forums › Presentation › Applications › Force refresh to a workspace on every navigation
Tagged: workspace refresh
- This topic has 3 replies, 2 voices, and was last updated 6 years, 4 months ago by Aditya Phatak.
-
AuthorPosts
-
-
July 26, 2018 at 4:46 am #9352Aditya PhatakParticipant
Hi,
We are exposing an external system URL as a portlet in a new custom workspace
– Wokspace A (Screen with property portlet = #f)
– Portlet (Screen with property portlet = #t) in Workspace A
– Form (in the portlet) – bound to a “Browser” control which uses a static url endpoint.
– Form is bound to Entity class; which has the attribute which reads the URL from the System Preferences (Global Application Settings)
– This has been done, so we can change the URL runtime, if there is a better solution please recommendDue to limitations of the external system, we are required to “force” a refersh of the workspace whenever a user navigates to it
Example – User Click on Workspace A; then clicks on Contact/Deal workspace; then clicks on Workspace A (the already loaded URL should not show); a complete reload should be triggeredPlease recommend how to approach the requirement.
0 -
July 26, 2018 at 6:48 pm #9362Clayton ChowParticipant
Hi Aditya,
The “Browser control” allows the embedding of a web browser in the NexJ application. The navigation of this browser was designed to be controlled by the browser itself, however it can be re-directed to a different URL (in case where a CRM context has changed).
The refresh ability of the Browser control is not exposed due to the uncertainty if the supporting system would even allow a refresh of the same URL or would retrieve from cache.These are the two challenges of the requirement:
i) a hook is needed to kick off a refresh
ii) a refresh of the same URL may not be successful (depending on the setup).Below would be the workaround to these two issues which should meet the requirement:
1. When selecting the workspace, force a UI action to run which will refresh the activeNode, which in turn will set/refresh the browser’s URL
– this can be accomplished by:
i. When on the Contact/Deal worksapce, call the “event-broadcast” for a unique UIevent which will be captured by the Browser workspace (i.e. Workspace A in your example).
ii. Add a UI Event for the new event in the form in Workspace A. In this event, refresh the activeNode (e.g. (add-to-batch-requests this (@ view activeNode) “refresh”))2. Make Workspace A’s URL to be dynamic
– if the above step is not enough to get the desired behaviour, it is likely because the system browser is retrieving the site from cache
– a workaround is to make the URL dynamic each time it is called. This can be done by using a calculated attribute which appends a different URL parameter which is not being parsed by the external system (e.g. https://www.google.com/?dummy=123). Since the parameter is expected, it can be ignored by the external system and still load the site; and since the parameter will be different in each call, the site will not be retrieved from cache.0-
July 29, 2018 at 3:56 am #9377Aditya PhatakParticipant
Thanks Clayton – 1st approach seems to solve the purpose.
0
-
-
July 29, 2018 at 8:42 am #9385Aditya PhatakParticipant
Hi Clayton,
There is 1 scenario where the intended workspace refresh is not getting triggered. Please check the steps mentioned:
- Login to application – navigate to Workspace A directly
- Navigate to Contact/Deal workspace – by default 1 of the records in the list (top record) gets selected in context
- Navigate to Workspace A again – it doesn’t trigger a refresh which is expected
Tried calling the same event-broadcast from the “Script” level of the EntityList form as well as EntityNavigatorPortlet (with and without using a “postMessage”).
Please suggest how to tackle this.
Regards,
Aditya Phatak.
0
-
-
AuthorPosts
- You must be logged in to reply to this topic.