Design Studio listbox usage
In this case a LISTBOX is read and a filter is set on DS_1 data source. Also an extra text item is being filled with the chosen values to be displayed elsewhere on the canvas.
On Startup script code.
LISTBOX_REGION.setItems(DS_1.getMemberList(“0REGION”, MemberPresentation.INTERNAL_KEY, MemberDisplay.TEXT, 10));
LISTBOX_REGION.addItem(“All”, “All regions”, 0);
LISTBOX_REGION.setSelectedValue(“All”);
There is an extra entry added at the start of the list, this is also the default selection (all entries).
The listbox looks like this.
The extra text component All will be made visible when necessary.
LISTBOX_REGION On Select script.
var lv_select_arr = me.getSelectedValues();
var lv_selecttext_arr = me.getSelectedTexts();
var lv_element = [“”];
var lv_text = “”;
- me.removeItem(“All”);
TEXT_ALLE_REG.setVisible(true);
lv_select_arr.forEach(function(element, index) {
lv_element.push(element);
});
DS_1.setFilter(“0REGION”, lv_element);
lv_element = [“”];
lv_selecttext_arr.forEach(function(element, index) {
lv_element.push(element);
lv_text = lv_text + “, “+ element;
});
TEXT_A_REG.setText(Convert.subString(lv_text, 1));
The last line of code shows the chosen entries in a TEXT element and takes away the extra first comma.
Since “All” was placed as an extra first option in the initial list, it’s been taken away again when multiple selection is made.
Also an extra TEXT element named All has an event and is added onto the top right of the LISTBOX.
TEXT_ALL_REGION On Select script.
LISTBOX_REGION.setItems(DS_1.getMemberList(“0REGION”, MemberPresentation.INTERNAL_KEY, MemberDisplay.TEXT, 20));
LISTBOX_REGION.addItem(“All”, “All regions”, 0);
LISTBOX_REGION.setSelectedValue(“All”);
TEXT_A_REG.setText(LISTBOX_REGION.getSelectedText());
DS_1.clearFilter(“0REGION”);
me.setVisible(false);
This makes it possible to return to all entries after a multiple selection is made.
Hi
This is usefull! Thanks a lot! But can you explain how to show FragmentBookmarks save on a folder by clicking on it?
Adrian,
For examples about how fragments and bookmarks work, please have a look at the standard delivered content in the Ready-To-Run section when starting a new application in Design Studio.
In here you'll find Generic Analysis (DS 1.6 SP1), Online Composition (DS 1.6) and Data Discovery and Visualization (DS 1.5).
The first one can be used to load query's and save them in a bookmark including parameters.
The second one uses a fragment gallery and can be used to pick up the bookmarks and present these in a Fiori-like environment.
The third one can be used to pick up query's, slice-n-dice, save slices and make a storyboard using fragment gallery containing all the slices. It even works with different slices on one page, horizontal and vertical.
The application contains a button that picks up the url. This contains the story which can be sent via email or be used in a portal.
We use BO 4.1. All bookmarks are saved onto the server. These can be managed by logging in to the CMC, Applications, Design Studio Run-time, Manage Bookmarks.