cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Design Studio - Apply saved values AFTER bookmark load

former_member358236
Participant
0 Kudos

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);

Accepted Solutions (1)

Accepted Solutions (1)

MustafaBensan
Active Contributor
0 Kudos

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.

former_member358236
Participant

Hi Mustafa,

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

Regards,

Vu.

Answers (0)