How to pass/update repeater data in different pages

repeater-widget

#1

Hi,

I am trying to do a bookmark feature where the articles and the bookmarks page are separate pages. However, i am unsure of how to add the article details to the bookmarks repeater when “Bookmarked”. in the articles page. I have also read a few forum discussion here but couldn’t find a solution. Is there any workarounds?


#2

The way to share data across pages is global variables. So your basic approach would be to assign values to one or more global variables when an article is bookmarked. Then, when your bookmarks page loads you can use the repeater’s OnItemLoad to assign specific rows to show as “bookmarked” --or alternatively, the OnPageLoad could add rows for each bookmarked item/value, or use filters to show a hidden row.

For instance, you could use one Global Variable, like “Bookmarks” to keep track of a list of which articles are bookmarked, perhaps using their title or a representative number–some kind of signifier. I presume each article is on its own page with some kind of button/icon/link affordance to flag it as “bookmarked.” The OnClick event could add the signifier to the end of the Bookmarks value ( something like, set value of Bookmarks to "[[Bookmarks]], [[This.text]] ). Then in your bookmarks page you could parse that Bookmarks variable with subsequent substring() or slice() statements using the comma (or any character that would not appear in your signifiers) to extract the signifiers and update your repeater list. Another method would be to have a different Case for each possible bookmark and just search the list (something like, If [[Bookmarks]] contains "1" remove filter "bm1" from MyRepeater ) Or, you could set a reasonable limit for the number of bookmarks in your prototype. Perhaps 2 or 3 would suffice to show a proof of concept, or maybe you need 10 to fully test this out with users. You could set up 10 global variables, such as B0, B1, B2, etc. which could make it a lot easier to set and track which articles have been bookmarked.

I would recommend you use values as short as possible in your global variable(s) to keep things efficient and more reliable when passing data across pages. If the article details you want to show in the bookmarks repeater rows are extensive, say perhaps you want to show the title, author, journal, publication number, an abstract and an image in each repeater row of your bookmarks list, you don’t have to pass all this data from one page to the next, just a pointer or reference number (what I’m calling a “signifier”) which can be a single number or short string. On your bookmarks page you would have all the “article details” info needed (copied from your articles’ pages) for each possible article in your prototype. In fact, I would recommend you create your repeater with all possible bookmarks, so if you have 10 articles in your prototype, you would have 10 rows in your repeater all ready to go. To start with no bookmarks, hide all the rows in your repeater with a filter, and as bookmarks are added, show the appropriate rows. Perhaps you could have a different filter for each row and just remove that filter if your global variable includes that article or row number.

If you post your .rp file or a basic version of it, I’d be happy to show some solutions for this based on how you are representing your articles and repeaters.


#3

Hi,

Do you have an example file?


#4

@bernice,
No, I haven’t had to do something like this yet, but have used all sorts of global variables, and made repeaters that get updated/filtered on page load.

How are your articles and bookmarks arranged in your prototype, and how many articles? How is your bookmark repeater structured? If I have some time I might create a basic demo of my ideas above.


#5

The articles and bookmarks are arranged by date in descending order. I am just testing it so i used around 10 articles only. As for the bookmark repeater, I used the exact same structure for the articles with a field indicating if it is bookmarked or not. However, the bookmark page will of course show the bookmarked ones.


#6

Hello,

can you help with the RP file if possible. Can provide example in your file itself.
Thanks


#7

@bernice,

Here is a demo based on how I understand you want your articles list and bookmarks list to work. I just grabbed some article titles from https://www.popsci.com/science if you get curious about signing mice or whatever…

Bookmarks Repeater Across Pages.rp (119.4 KB)

The Home page has a repeater with 10 articles, each with a bookmark icon. There are 10 global variables, B1, B2, etc…, one for each article (and possible bookmark.) Clicking the bookmark icon will toggle its selection state and set the corresponding global variable to its selection state (“true” or “false”) so that it can be tracked across pages.

The Boomarks Page page has an identical repeater, with the addition of a number in the row to more easily see how many bookmarks have been set. The OnPageLoad event has 10 cases, each with a condition to test the global variables and assign a filter. For example, If value of B1 does not equal "true" Add Filter F1 to bookmark repeater. The filter “F1” has a rule of [[Item.ID != 'A1']]. This translates to "show all rows in the repeater if the value in column, “ID” does not equal “A1”, or in other words, “hide the A1 row.” The rest of the conditions will successively apply their filters (note the “Remove other filters” checkbox is deselected) with the default result being all rows are hidden. This method of “multiple repeaters” is kind of the “magic” of this approach, and it may take some time to wrap your head around the way a filter works. For good measure I placed some text behind the repeater: “No articles bookmarked yet” which is obscured if any of the repeater rows are shown.

So the way all this works is when the bookmark icon is clicked in row 1 of the articles list on the Home page, then that widget is selected and the gobal variable, B1 is set to “true”. When the Bookmarks Page is loaded and B1 = “true” the corresponding row with ID = “A1” is never filtered out, so it is shown.

Now look at the repeater on the Home page and notice its OnItemLoad event. In addition to setting the text, there are 10 cases, each with a condition to test one of the 10 global variables. If the value of the global variable is true and its number equals the ID number, the bookmark icon is set to “selected” state, e.g., If value of B1 equals true and [[Item.ID]] equals "A1" Set is selected of bookmark equal to "true". All of this is done to ensure that the bookmarks are retained when you come back to the Home page.


Pass Repeater Data Set to Another Page
#8

Ahhh! I get what you mean now. But what if i have a bookmark page that contains bookmarked items from 2 separate pages (with 2 separate repeater) then? So page1 - repeater1, page 2 - repeater2, and bookmark contains duplicatedRepeater1, duplicatedRepeater2. And what if the number of articles is more than 20 lets say, then i have to create 20 global variables for it?


#9

Hi, also what if i am doing a chatroom bookmarking feature where there will be new chat rooms and new messages? These chatroom and bookmark are also on different pages. Is there any way to do this?


#10

Same method should work. Just coordinate your repeater IDs. This would work with 20 global variables as well. Axure says there is no actual limit to number of variables, but they recommend using “only up to 27 global variables.” To make things more flexible, you could create a hash list for one global variable and parse it on your Bookmarks pages.

Hmm… bookmarks for chatrooms is an interesting concept. What gets “bookmarked”? Are you needing to preserve text that is dynamically entered? If so, you might be better off “faking” different web pages and keep it all on one page with different “page views” for instance using different states in a dynamic panel. Then you would not need to transfer data between pages.


#11

Like I would need to preserve the newly added messages that is originally not in the dataset.


#12

@bernice , Take a look at this thread where I set up a way to copy a repeater with user-entered text from one page to the next, using a method to parse one global variable.


#13

Hi, I used you Bookmarks Repeater Across Pages.rp file to style a restaurant app that passes repeaters from one page to another using global variables. i noticed that when you deselected a bookmark it will disappear the next time you load the bookmark page. Can you explain to me how this is done? I’m having trouble removing the order image from my checkout page and can’t figure out how to remove them.