Note: In this application, there will be a geo-map, which I will not explain how to code. If interested in how to apply filters to geo-maps, then please see my blog: Filtering Geo Maps ( https://blogs.sap.com/?p=1053842 ).
Below is a screenshot of the application that I am building:
Note: In upper-left there are three text fields that will hold item descriptions that I will select from the chart below the fields. When there are at least two items in the fields, then the geo-map will be displayed, as there has to be at least two items to perform the calculations for the bubble measures.
Video:
Note: Notice that each panel has slightly different navigation buttons.
Note: This is the panel for the second input chart that will select the second item. It has two navigation buttons that will allow navigation to the next or previous input panel.
- It is easier to manage panel visibility, then each control individually.
- Some widgets cannot be hidden. For example, the chart cannot be entirely hidden.
- An item in the first panel will be selected
- The selected value will be placed in the first text field above the selection panel.
- The first panel will be hidden
- The next panel will become visible.
- The second item will be selected:
- The selected item will be placed in the second selection text field.
- The geo-map will now be visible.
- The second selection panel will be hidden.
- The third selection panel will become visible.
- The third item will be selected
- The selected item will be placed in the third selection text field.
- The geo-map will be updated with the new addition.
At any time, we can navigate backwards of forwards using the navigation buttons located in each selection panel.
Finally, place the final panel in the same manner.
Note: Be sure to hide the panels that you are not placing, because if the panels are visible, then they may become the owner for the newly placed panel. Then, when one panel is hidden, then both panels will become hidden.
Note: In this screenshot I show the Hide/Show menu item that allows controlling the viability of a panel on the canvas.
Panel: First Item
- Name: btnRight_01
Code: pnlFirstItem.setVisible(false);
pnlSecondItem.setVisible(true);
Note: Since this is the selection panel for the first item, we only need a navigation button to go to the next panel. The code hides the first panel, and then shows the second panel.
Panel: Second Item
- Name: btnRight_02
Code: pnlSecondItem.setVisible(false);
pnlThirdItem.setVisible(true);
Note: The code hides the second panel, and then shows the third panel.
- Name: btnLeft_02
Code: pnlSecondItem.setVisible(false);
pnlFirstItem.setVisible(true);
Note: The code hides the second panel, and then shows the first panel.
Panel: Third Item
- Name: btnLeft_03
Code: pnlThirdItem.setVisible(false);
pnlSecondItem.setVisible(true);
Note: Since this is the last selection panel, then we only need a button to the previous selection panel. The code hides the third panel, and then shows the second panel.
Panel First Item:
Code:
// Code for the first selection chart onSelect method.
// This code places the selection text from the chart in the first selection text field. var selArray = chrtSICart.getSelections();
strSVDescriptionA = selArray[0]["DESCRIPTION"];
txtSelectedItemA.applyText(strSVDescriptionA);
// This code manages the visibility of the selection panels and the geo-map.
// Hide First selection panel - show second selection panel.
// This cycles from first to second panel
// Hide geo-map since only one item is selected.
pnlFirstItem.setVisible(false);
pnlSecondItem.setVisible(true);
GeoMap_1.setVisible(false);
// Clear the second and third selection texts, as the entries are irrelevant
// because a new lead item has been selected.
txtSelectedItemAB.applyText(' ');
txtSelectedItemABC.applyText(' ');
Panel Second Item:
Code:
// Code for the second selection chart onSelect method.
// This code places the selection text from the chart in the second selection text field. selArray = chrt2NIChart.getSelections();
strSVDescriptionAB = selArray[0]["DESCRIPTION"];
txtSelectedItemAB.applyText(strSVDescriptionAB);
// This code manages the visibility of the selection panels and the geo-map.
// Hide the second selection panel - show the third selection panel.
// This cycles from second to third panel
// Show geo-map since now there are two items selected.
pnlSecondItem.setVisible(false);
pnlThirdItem.setVisible(true);
GeoMap_1.setVisible(true);
// Clear the text in the thrid selection text, as there is now a new second selection made.
txtSelectedItemABC.applyText(' ');
// This code manages the filters for the geo-map
// See blog Filtering Geo Maps ( https://blogs.sap.com/?p=1053842 ).
// For details
chrtLift.getDataSource().setVariableValue("IP_SELECTED_ITEM_1", strSVDescriptionA);
chrtLift.getDataSource().setVariableValue("IP_SELECTED_ITEM_2", strSVDescriptionAB);
chrtLift.getDataSource().setVariableValue("IP_SELECTED_ITEM_3", strSVDescriptionAB);
Panel Third Item:
Code:
// Code for the third selection chart onSelect method.
// This code places the selection text from the chart in the third selection text field.var selArray = chrt3NIChart.getSelections();
strSVDescriptionABC = selArray[0]["DESCRIPTION"];
txtSelectedItemABC.applyText(strSVDescriptionABC);
// This code manages the filters for the geo-map
// See blog Filtering Geo Maps ( https://blogs.sap.com/?p=1053842 ).
// For details
chrtLift.getDataSource().setVariableValue("IP_SELECTED_ITEM_1", strSVDescriptionA);
chrtLift.getDataSource().setVariableValue("IP_SELECTED_ITEM_2", strSVDescriptionAB);
chrtLift.getDataSource().setVariableValue("IP_SELECTED_ITEM_3", strSVDescriptionABC);
// Note: We do not have to manage the visibility of the panels in this code, as it is the last selection panel. If we wanted to return to a previous selection dialog, then we would use the navigation buttons.
Fully populated screenshot with all three selections made, To modify selections, we simply use the back navigation buttons and change previous selections.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
12 | |
10 | |
9 | |
7 | |
7 | |
7 | |
6 | |
6 | |
5 | |
4 |