Projects:Tab Display Logic
Project Tab Display Logic - Technical Documentation
Overview
This article will contain the specification of the Tab Display Logic project, which was originally described in this feature request.
Technical design
This feature is already implemented for accounting and translating tabs, as described in this wiki entry. In this case, the logic is only applied when the window is built. This can be a problem in the following scenario:
- The user opens a window that contains a translation tab while the Show Translation Tabs option is unchecked.
- The window is built without the translation tab
- The user checks the Show Translation Tab option, and opens the window again.
- If the user did not have any module in development, the window will be cached, and the translation tab will not be displayed.
For this reason, this logic will be reimplemented in this project.
A new field, display logic, will be added to the Tabs. It will work in the same way as the display logic of the fields, an expression that can contain references to session variables and to other field values, and that must be evaluated to true of false.
As they are very similar, the display logic of the tabs will be evaluated each time the display logic of the fields is executed.
When a tab is hidden, all its subtabs will also be hidden. If the tab that is being hidden was visible at the moment, the next visible tab (if any) will be shown, and probably a request to the datasource to fetch its records will have to be done.