How to get a dynamic URL to open in new page ?
Application Type
Reactive

Hi, 

We are looking for a better way of doing dynamic URLs opening in new tabs/window, from a click action in a Reactive Grid.

Scenario : items are in a Reactive DataGrid, when the user clicks an item the detail is shown; the user should be able to open the detail in a new window if he wants to. 

We have this working right now using a checkbox "Open in new window" and a JS action window.open('/OurApp/ThePage?ItemId=' + $parameters.ItemId, "_blank"); when the checkbox is unchecked, we use a normal Destination action.

Our issue with the JS action is the URL is hardcoded and won't refactor if we move things around, or if additional parameters are added to the page.

Is there a better way to do dynamic URLs to new tabs/window ?



Hi Francois,

Agree that having that option on Destination node would be nice.  Maybe read this idea to understand that the whole opening of extra tabs is a matter of debate, and might be the reason why it is not standard functionality in Outsystems)  (... and while I'm making this post, I am being offered he option to open the link I add in a new tab, how ironic...)

To deal with what is currently available, for a complex UI with lots of dynamic/conditional screen transitions, I would probably have a separate client action dedicated to opening only one screen, with exactly the same signature as the screen.  This comes with the penalty of having to maintain that action together with the screen, so not te be used if application is simple, I think, but offers 

  • findability : you can do a "find usage" on that action to know what other screens link to the screen in question
  • easier refactoring : when screen moves / changes name, only need to change hardcoded screen name in this single action

See attached oml for a simple  example.

Dorine

QDR_TraceableDynamicDestination.oml

Hi Francois Gaudet ,

You can create a function that will take inputs like query parameter values and need to design if-based logic to generate the final URL. You can make use of GetRequestDomain() function to get the environment domain and then can append the module, page name, and parameters logically. See the sample below

"https://"+ GetRequestDomain()+"/YourModuleName/PageName?Parameter1="+Value+"&Parameter2="+Value

Hi @Pranav Pandey,

Thank you for your reply.

Our current solutions is much like you describe, using a function; however this does not solve the refactor issue as the "PageName" is still hardcoded in the function. 

Also, not having a 'real' reference to the page means Usage search for that page will not show up for that function.

I feel like the "Destination" action should have an option "Open in new window", perhaps as one of the "Transition" options .... 

Hi Francois,

Agree that having that option on Destination node would be nice.  Maybe read this idea to understand that the whole opening of extra tabs is a matter of debate, and might be the reason why it is not standard functionality in Outsystems)  (... and while I'm making this post, I am being offered he option to open the link I add in a new tab, how ironic...)

To deal with what is currently available, for a complex UI with lots of dynamic/conditional screen transitions, I would probably have a separate client action dedicated to opening only one screen, with exactly the same signature as the screen.  This comes with the penalty of having to maintain that action together with the screen, so not te be used if application is simple, I think, but offers 

  • findability : you can do a "find usage" on that action to know what other screens link to the screen in question
  • easier refactoring : when screen moves / changes name, only need to change hardcoded screen name in this single action

See attached oml for a simple  example.

Dorine

QDR_TraceableDynamicDestination.oml

Hi Dorine, 

Thanks for your reply, always on point! We'll be using the client action solution until something better comes around. 

That link was quite a read... 

Justin and J may find opening new tabs has "horrific usability" and pity that "designers [...] cannot figure out a better way to design your screens/workflow/applications". On their account, we should all be fine working with a single monitor I guess! (try that and see all our programmers and users just quit)

Having multiple tabs/windows is a major requirement for just about any modern, complex app, and a major boost to workflow, productivity and organization. 

I do hope they revise their vues on this and add this feature, sooner that later.

Francois

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.