Opening the multiple browser tab through deeplink when single hit of button

0
Hello Team ,  I have a requirement to open the multiple browser tabs when we hit on the button for single time . Usually to open the page in the next tab of  browser we are using url redirector . In that URL we are passing the deeplink name and triggering the deeplink there . now as per the requirement I need to call the Deeplink ‘N’ number of times . Based on the selection count of objects need to open the tabs . Ex: If I select 3 objects and hit on the button 3 tabs need to be opened and each and every objects should be there in separate tabs . For that I have taken all object id’s and Iterate through loop and inside the loop I’m calling the deeplink and passing each and every object Id to open the Objects in multiple tabs . But what happened is , Number of tabs are opened in the multiple tabs with same object . For example If I’m having a objects 1,2,3,4 and I’m iterating through loop . last object would be 4 . that 4 th object is there in the 4 tabs in the browser .  Means It is passing only last object to the deeplink .  So in every tabs last object is there . Can anyone please help me to solve this issue .  Thanks in Advance !
asked
3 answers
0

Hello,

From your above posts I assume you are well aware of creating multiple page specific URLS which you want to

open, just the problem is if we use “show page” action or “OpenURL” JS function of nanoflow commons then

only last URL gets open in another tab.

 

To solve above issue you can create something like following nanoflow:

 

 

Consider above iterator is your selected values list , also I am assuming that you want to open URL something similar like – http://localhost:8080/WO/PageId/{id}

  1. as you need to create URL specific to every page, you can use SUB_GetApplicationURL microflow which is part of Deeplink Module, this will return application url, something like http://localhost:8080/
  2. use GetGuid nanoflowcommons JS action to retrive ID, we need to do it because we cannot retrieve entity ID directly.
  3. create object of NPE, DeepLink.DeepLinkURL and set attribute url. for above example →  $ApplicationURL+'/WO/'+$Id
  4. Use DeepLink.Open_DeeplinkURL JS action and pass newly created object of DeepLinkURL.

This solution works to open multiple tabs same time the way you wanted, I hope it helps.

 

On a side note → 

As a best practice rather than using DeepLink.Open_DeeplinkURL JS action directly I would suggest to create separate (your own) JS function in your own module.

In nutshell DeepLink.Open_DeeplinkURL just do window.open(deeplinkURL.get('URL'),'_blank');

answered
0

Hi Buddy!
 

To achieve the desired functionality in Mendix where clicking a button opens a tab for each selected object, you can follow these steps:

1. Create a microflow: Start by creating a microflow that will handle the logic for opening the tabs. This microflow will be triggered when the button is clicked.

2. Add parameters: In the microflow, add a parameter of type "List" to receive the selected objects. This parameter will represent the objects that are selected.

3. Iterate over the list: Use a loop to iterate over the list of selected objects.

4. Create new tabs: Within the loop, create a new tab for each object. You can use the "Create object" action to create a new tab entity in your data model.

5. Set tab attributes: Set the necessary attributes of each tab entity, such as the title or content, based on the selected object. You can use the "Change object" action to modify the tab entity.

6. Open the tabs: Finally, use the "Show page" action to open each tab. You can specify the tab entity as a parameter to the "Show page" action to indicate which tab should be displayed.

Once you have set up the microflow, you can configure your button to call this microflow and pass the list of selected objects as a parameter. When the button is clicked, the microflow will be executed, and a tab will be opened for each selected object.

Note that the specific implementation details may vary depending on your Mendix version and application structure, but these general steps should help you achieve the desired functionality.

answered
0

Hi,

In my opinion you should be able to succeed if you put a specific url in your page : 

 

Doing so, every page should keep it's specific object.

answered