Home Forums Presentation Applications Force refresh to a workspace on every navigation

Viewing 2 reply threads
  • Author
    Posts
    • #9352
      Aditya PhatakAditya Phatak
      Participant

      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 recommend

      Due 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 triggered

      Please recommend how to approach the requirement.

      0
    • #9362
      Clayton ChowClayton Chow
      Participant

      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
      • #9377
        Aditya PhatakAditya Phatak
        Participant

        Thanks Clayton – 1st approach seems to solve the purpose.

        0
    • #9385
      Aditya PhatakAditya Phatak
      Participant

      Hi Clayton,

      There is 1 scenario where the intended workspace refresh is not getting triggered. Please check the steps mentioned:

      1. Login to application – navigate to Workspace A directly
      2. Navigate to Contact/Deal workspace – by default 1 of the records in the list (top record) gets selected in context
      3. 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
Viewing 2 reply threads
  • You must be logged in to reply to this topic.