Skip to Content
0

While saving Fragment Bookmarks in Design Studio, what should be given in container parameter ?

Apr 23 at 11:39 AM

28

avatar image

When we save Fragment Bookmark in design studio, we need to give a container parameter. My question is that how do we decide this parameter.

I have given the Panel as container for my dashboard , so when I save my bookmark it gets saved. But when I load the same bookmark it does not load. I think the problem is with the container parameter.

Kindly help me to know the use of this parameter.

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

3 Answers

Mustafa Bensan Apr 23 at 12:06 PM
0

Hi Sawan,

For a Fragment Bookmark, the Panel component is the generally recommended one as the container, however you can use any of the valid container types. I suspect your issue is related to how you are loading the Fragment Bookmark rather than the choice of container. In order to provide you with further guidance it would be helpful if you posted the following:

1) Screenshots of your application layout, highlighting the panel;

2) Script code for saving and loading the fragment bookmark.

Regards,

Mustafa.

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

Hi Mustafa,

Thanks for your response.

Below is the script that I am using for saving, Loading and deleting Bookmarks.

Saving:

var bookmarkname = INPUTFIELD_2.getValue();

if (bookmarkname == "")

{

APPLICATION.alert("Please Enter Bookmark Name");

}

else

{

if (Bookmark.bookmarkWithTitleExists(bookmarkname))

{

APPLICATION.alert("Bookmark name already exists");

}

else

{

Bookmark.FragmentBookmark.saveBookmark(PANEL_1,bookmarkname);

var bookmarks = Bookmark.FragmentBookmark.getAllBookmarkInfos();

bookmarks.forEach(function(element, index)

{

LISTBOX_2.addItem(element.id, element.title);

});

INPUTFIELD_2.setValue("");

}

}

Loading:

var id = LISTBOX_2.getSelectedValue();

Bookmark.FragmentBookmark.loadBookmark(id);

var bookmarks = Bookmark.FragmentBookmark.getAllBookmarkInfos();

bookmarks.forEach(function(element, index)

{

LISTBOX_2.addItem(element.id, element.title);

});

Deleting :

Bookmark.FragmentBookmark.deleteBookmark(LISTBOX_2.getSelectedValue());

INPUTFIELD_2.setValue("");

LISTBOX_2.removeAllItems();

LISTBOX_2.addItem("1", "Select Bookmark",0);

var array = Bookmark.FragmentBookmark.getAllBookmarkInfos();

array.forEach(function(element, index)

{ LISTBOX_2.addItem(element.id, element.title);

});

0
SAWAN SAGAR Apr 23 at 12:22 PM
0

Hi Mustafa,

Thanks for your response.

Below is the script that I am using for saving, Loading and deleting Bookmarks.

Saving:

var bookmarkname = INPUTFIELD_2.getValue();

if (bookmarkname == "")

{

APPLICATION.alert("Please Enter Bookmark Name");

}

else

{

if (Bookmark.bookmarkWithTitleExists(bookmarkname))

{

APPLICATION.alert("Bookmark name already exists");

}

else

{

Bookmark.FragmentBookmark.saveBookmark(PANEL_1,bookmarkname);

var bookmarks = Bookmark.FragmentBookmark.getAllBookmarkInfos();

bookmarks.forEach(function(element, index)

{

LISTBOX_2.addItem(element.id, element.title);

});

INPUTFIELD_2.setValue("");

}

}

Loading:

var id = LISTBOX_2.getSelectedValue();

Bookmark.FragmentBookmark.loadBookmark(id);

var bookmarks = Bookmark.FragmentBookmark.getAllBookmarkInfos();

bookmarks.forEach(function(element, index)

{

LISTBOX_2.addItem(element.id, element.title);

});

Deleting :

Bookmark.FragmentBookmark.deleteBookmark(LISTBOX_2.getSelectedValue());

INPUTFIELD_2.setValue("");

LISTBOX_2.removeAllItems();

LISTBOX_2.addItem("1", "Select Bookmark",0);

var array = Bookmark.FragmentBookmark.getAllBookmarkInfos();

array.forEach(function(element, index)

{ LISTBOX_2.addItem(element.id, element.title);

});


snwmo.png (22.4 kB)
Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Sawan,

When using portable fragment bookmarks, as a best practice, the container component should only include the visual content that you wish to bookmark the state of. It should not include the "administrative" components that take care of the bookmark processing such as saving, loading and deleting.

Looking at your example, the PANEL_1 component used as the container for your fragment bookmark includes only administrative components (buttons, list boxes, input field etc) but no "real" content such as a chart. You need to restructure your application accordingly, such that PANEL_1 only contains visual content and move the administrative components outside PANEL_1.

The approach I have described above is effectively the approach implemented in the example Christian has posted in his answer, although I prefer not to include filter components in bookmark containers.

Regards,

Mustafa.

0
Christian Hauswald Apr 23 at 01:02 PM
0

Hi Sawan,

I suggest to store the Panel where either your crosstab/chart is located in, or your filterpanel.

In my example I have a Crosstab, located in "PANEL_1" (white Background)
and a Dimension Filter in "PANEL_2" (gray background)

When hitting "save" it makes no difference, whether you store 1 or 2, as both are related to the same datasource.

However: I was facing issues with my already saved bookmarks, when changing the container, which I have used as bookmark-source. So I always store the container where the filterpanel is located in, because this is in my view the container, which will be changed the less.

Skript for Save:
//saving the gray container
Bookmark.FragmentBookmark.saveBookmark(PANEL_2);


Skript for getting all boomarks:
var all = Bookmark.FragmentBookmark.getAllBookmarkInfos(); all.forEach(function(element, index) { LISTBOX_1.addItem(element.id, element.id); });


Skript for loading the selected bookmark from the list:
var id = LISTBOX_1.getSelectedValue(); Bookmark.FragmentBookmark.loadBookmark(id);



Regards,
Chris


screen.png (21.3 kB)
Share
10 |10000 characters needed characters left characters exceeded