How to open page in the same tab

Martin76
Kilo Expert

I want my users to navigate between pages created in UI Builder while keeping the number of opened tabs constant.

Current setup

  • Page x has a required parameter sysId.
  • When I do Link to Destination with the same route x but a different sysId, a new workspace tab is opened and the browser URL changes from /x/originalSysId to /x/newSysId
  • To have it open in the same tab, I can set the Target Route to "current" in the Link to Destination event, but when I do this the following happens:
    • the URL gets changed from /x/originalSysId to /x/originalSysId/sub/x/newSysId (this is acceptable)
    • Back button appears (this is kind of acceptable)
    • The tab title is not updated (that's a problem - it would confuse the users)

find_real_file.png

 

I guess I need either:

  • Have the page loaded in the same tab without that sub part
    • So far it seems this might work if the sysId parameter is not required but optional - however I consider this a workaround
  • Provided that loading in the same tab is not possible, I would like the old tab to close automatically
  • or to somehow force the tab title (I'm setting it using helpers.updateStatus({title: "New title"}) )

Thank you for your suggestions.

2 REPLIES 2

Tom Sienkiewicz
Mega Sage

Hi, I think it is correct to open a new tab, since the routing is handled via URL and the new tab has the new sys_id in the URL.

What you're looking for is more of a single-page design, it would reqire the routing not to be handled via URL but internally, within the component. Not sure if there is any ready component that does that, my experience with UIB is somewhat limited at that point still.

Opening a /sub/ URL might work but technically this is adding parent-child relationship to the routing, so that is still not perfect.

Perhaps the other solution is more "robust" - closing the old tab whenever user clicks on a different Case link. Most probably this has to be scripted, search any similar open tabs by class or ID and close.

IMO - what is the problem of keeping multiple tabs for tickets? Isn't is a matter of simply following a process of closing current tab before moving on to the next one? Perhaps the effort to achieve that is not worth it.

Hi Tomasz, I agree with everything you've mentioned. Just to explain the workflow of the users:

They will have a queue of cases to go through and they need to do it as fast as possible. The queue is continuously filling in so it's basically endless work.
Once they review a case, they don't need to access it again, so it makes no sense for hundreds of tabs to pile up in their workspace.

Currently, I'm using the /sub/ thing but that's limiting my ability to set the tab title.

But you made me think of a different approach: not to have the sysId in the URL at all and store it just as a state parameter instead. That way, I could just change the parameter and refresh the data source without any navigation happening. I think I'll explore this option too.

I will keep this question open in the case someone comes up with an answer.
Thanks.