Dynamic Tab selection

0
In our application, we have view and edit pages for each object. In these view/edit pages we have tabs to organize the data. Both View and Edit pages contain the same tabs.    When users go from view page to edit page, we want the tab they were in to be the same tab in the other page.    For example: Let’s say we have an object called Customer. So, we have Customer_Edit and Customer_View pages. In both pages, we have 3 tabs called; Tab1, Tab2, and Tab3. If the user in the Customer_View page is in Tab2 and then presses Edit Customer button (which will open the Customer_Edit page) the Tab2 in Customer_Edit page should be active.    I tried a few Tab Switchers widgets using the tab onclick widgets to change the Tab index numbers. However, could not achieve the functionality as we wanted.    Any suggestions on how we can achieve this result?
asked
3 answers
1

Have a look at the tabswitcher widget: https://marketplace.mendix.com/link/component/2964/Valcon/TabSwitcher this will allow you to achieve exactly what you describe

answered
1

Hi Ayaz,

If marketplace modules aren't working for you can try the following:

1. Have the page opened via microflow. This microflow will create a non-persistent object containing a boolean attribute for "editable". (Default false). Wrap the entire page in a dataview pointing too this object.
2. For each tab, have two containers. Each container has the exact same attributes but show and hide the container based on the "editable" boolean being true or false.
3. For the view container make the attributes editable = false. For the edit container make editable = true.
4. Somewhere on the page, have a switch widget, when clicked, triggers a nanoflow to update the NPE object to either true or false.

This should allow the containers to swap in and out on the page seemlessly and shouldn't take you away from the tab you're on.

answered
0

Have you tried this widget? I think it would work for this kind of what you want to do. https://marketplace.mendix.com/link/component/204732

answered