cancel
Showing results for 
Search instead for 
Did you mean: 

Using Bookmarks in design studio application

former_member342346
Participant
0 Kudos

Hi,

I need your help with the following scenario:

I have an applications with tabs and I need that each tab will be cleared after a user goes to another tab and then returns to the same tab.

For example: a user goes to tab 3, filters the data and then moves to tab 5. I want the when he moves back to tab 3 the tab will return to its initial state.

In order to achieve this I used the bookmarks:

1. I added the following script in the event On Startup of the application:

g_bookmarkID = Bookmark.saveBookmark(); (g_bookmarkID is declared as a global variable of the application)

2. In the On select event of the tab strip  I added the script:

Bookmark.loadBookmark(g_bookmarkID);

Everything is working fine when the application is running, but get an error message:

Bookmark "AS9dsM.Ch8REsPme.fhbSeY" does not exist and therefore cannot be loaded

when the mentioned bookmark is not the one that was created in event On Startup.

Also, in the error log this message appears as a warning and not as an error.

Any ideas?

Regards,

Hagit

Accepted Solutions (0)

Answers (3)

Answers (3)

MustafaBensan
Active Contributor
0 Kudos

Hi Hagit,

I agree with Martin that bookmarks are probably not the right solution for your scenario.  Nevertheless, if you must use bookmarks, here are my questions and comments:

1)  It looks like you are using standard bookmarks.  These are invalidated every time the application is modified and re-saved, even if it is a minor change.  This could be the reason why you receive the "bookmark does not exist message".  I recommend that you use Fragment Bookmarks instead of Standard Bookmarks since they are more stable and not influenced by application changes outside the fragment.  Also, loading a Standard Bookmark will reload the entire application state, including the state of the the other tabs, which is probably not what you want, as Martin has already pointed out;

2)  Can you be more specific about the type of data source manipulations you want to preserve when you say "here are manipulation on the datasources do I want to avoid repeating the same code"?

3)  Are the data source manipulations you mention in point 2 performed as a result of user interactions/selections or are they performed programatically on application start-up?

4)  Does each tab have it's own separate data source?

5)  How are you creating and loading the bookmarks outside the one that is created on startup?

Regards,

Mustafa.

gopinath_kolli
Active Participant
0 Kudos

can you please let me know the other statements in the startup, which may effect. And how the data sources are loading(I mean is it script loading).and any other related stuff to the bookmark logic.

Martin-Pankraz
Active Contributor
0 Kudos

Hi Hagit,

I think the bookmarking feature is not what you are looking for. They save naigational state of the application or parts of it if you use fragments.

You should think of using the clearFilter or clearAllFilters on your data source so that they resume their initial state. That will impact the assigned components too. That approach will be much better in performance too.

You could call those methods on tab change to achieve what you want.

Kind regards

Martin

former_member342346
Participant
0 Kudos

Thanks Martin.

clearFilters is not the right solution for me.

There are manipulation on the datasources do I want to avoid repeating the same code (even when using global script).

This is why I though of using the bookmark and save the status of the initialization of the application.


Regards,

Hagit

Martin-Pankraz
Active Contributor
0 Kudos

Hi Hagit,

If I understand you correct, there are initial filters on the data source which you don't want to clear along with the newly introduced ones by the user.

If so you could use getFilterExt to remember the initial filter values using a global script variable. Having done that you can now clear and filter again your state, which is considered initial.

Of course touching the data source not to use filters could also be a line of thought.

Kind regards

Martin

former_member342346
Participant
0 Kudos

Hi,

Thank you Martin, but this is not what I was looking for.

I would like to understand the reason for the error I'm getting.

Regards,

Hagit