VC5 Accordion: Handle Multiple Topics in the UI wi...
Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
In many scenarios, the UI content is too much to contain in one screen. There are several ways to deal with this, for example: Use a Tabstrip to split the content to different tabs, according to topics.
I would like to present another option: a vertical list of expandable views, or an accordion. The main differences from other, built in options:
Flexibility: Any number of views could be presented at the same time (including none).
Horizontal space limitation: In the case of a long list of topics, their names won't show nicely in a Tabstrip solution, as they take too much horizontal space, and we suffer bad usability. The vertical list solves this.
Here is an example application. In this case handling orders of windsurfing items to shops.
Modeling:
1. For each topic add a pair of Panel elements: One for the title (top row), the other to hold the content (second row).
2. Add a Data Share (share1) to control the visibility of topics.
I used several other Data Share elements here to show static data in the application. Use your own sources for the data instead.
3. In the share1 Data Share, define a Boolean field for each topic:
4. Set the Content Scale for the Window:
5. Set the scaling for the title Panel for each topic. This is a key element in this solution: It allows us to set the height of the panel to show a toolbar only.
15. From the configuration panel, choose to define an Image for the Button, as follows. We get the correct image according to the value in share1@details field.
16. Repeat the steps in the Layout Board for the rest of the topics. Note that each one is depending on its own Boolean field for visibility.
This is it
Some remarks:
Each topic may contain whatever combination of UI elements we should like.
It is good practice to hold the content of each topic in a single panel. this way we only need to handle the visibility for one element per topic.
Control height of panels using Scale Mode: In this solution we needed to prevent Panels to "auto fit to height", so we could have a Panel as high as its toolbar.
The "Scale Mode" property is a new one. Ignore its instructions if it does not appear in your version.