Skip to Content
0

SAP Design Studio - Apply saved values AFTER bookmark load

Jun 29, 2017 at 01:12 PM

51

avatar image

Hell dear community,

I'm trying to find a way to apply 3 saved text values to 3 different Buttons AFTER I have load a bookmark.

EXAMPLE:

I have 3 text boxes (BEFORE bookmark load):

BUTTON_1 = "Bla"

BUTTON_2 = "Blub"

BUTTON_3 = "Bleb"

Now I want to load Bookmark 1 by clicking the BUTTON_1. But after the loading of the bookmark, the texts of BUTTON_2 and BUTTON_3 are empty (of course).

I want to reach this scenario:

Before the load of the bookmark, I need to cache the text of BUTTON_2 and BUTTON_3 somewhere.

And after the load of the Bookmark, I apply the cached values to the buttons again.

But unfortunately it doesn't work with this code I used :

var bookmarks = Bookmark.getAllBookmarks();

var button6 = BUTTON_6.getText();
var button8 = BUTTON_8.getText();
var button11 = BUTTON_11.getText();


var bookmarkId = DROPDOWN_2.getSelectedValue();

Bookmark.loadBookmark(bookmarkId);

bookmarks.forEach (function (element, index)
{
DROPDOWN_2.addItem(element.name, element.text);
});

BUTTON_6.setText(button6);
BUTTON_8.setText(button8);
BUTTON_11.setText(button11);

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Mustafa Bensan Jun 29, 2017 at 10:46 PM
0

HI Vu,

The issue here is that you are using a Standard bookmark, which will overwrite the state of the entire application. I suggest you use Fragment Bookmarks to selectively save and load the texts that you need.

Regards,

Mustafa.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Mustafa,

I didn't know about the existence of fragment bookmarks. Thanks for the help again, I have solved my problem.

Regards,

Vu.

1