Repeating Group Loading

I recently changed my app navigation to be state-based and to show and hide groups based on the state of the page. When I show an element with a repeating group for the first time after the page load, the group causes the state change (and subsequent group display) to lag for a few seconds, while the groups without repeating groups show and display instantly.

Has anyone else dealt with a similar problem? Is there a way to avoid this, or somehow pre-load the repeating groups so they don’t lag when shown?

1 Like

Did you try something like this?

  1. define a state (a variable) on an object as a list of the things you want to display in the repeating group
  2. create an action on the “page load” event to load that with the desired query.
  3. define your repeating group’s source to be the variable that you preloaded

Hope this helps,

1 Like

Thanks @alex5! Steps 2 and 3 seem straightforward, but how can I do step 1?

I’m interested on how to do point 2
How do you pre load the list

Here’s an example of table of skills that change its contents based on the status of a radio button element.

The way I do that may not be exactly what you want to do in your app but will show you how to manipulate states and contents of a repeating group.

The page has a Repeating Group (RG) of skills, whose contents are based on the things in a table called SKILL.

  1. Define the states
    To make this work, I defined two states (i.e. 2 variables) called Set A and Set B, where I will keep the desired result sets. A result set is a set of records (a list of things) of type SKILL that will be shown in the RG.
    A state can be “attached to” (created on) any object in your page. I am attaching them to the RG.

Note that you have to define these states to be of the same type of the RG and to be able to hold a list of things.

This is the result:

  1. Create actions on page load to populate the states

Here, I set the state Set A to be the result of a search in the table SKILL where Skill Type is A

And I did the same (not shown) for Set B, where Skill Type is B

  1. Change the content of the RG based on certain conditions.
    Here, I’ll use a radio button to select what s/b displayed in the RG. I will attach an action to the event “the radio button value is changed”. The action will change the content of the RG. You do this by selecting

and then setting the value of the display list to what you want. In this case, I’m using a condition (selected “Only A”) to display Set A

I did the same (not shown) for the “Only B” option.

For the Show All, I used a different selection in Element Actions: Clear List, which resets the contents of the RG to what is defined as its default source.

Here’s a link to the page in case you want to see it:

I hope this helps you!

Alex

1 Like

Ok so by setting the state to the data I want, will this load my desired data into that state? Hence making it that when I show it in the repeating group there will be no lag?
If so if Can I search for all skills then filter it with the radio button?
Or after loading all skills to a state can I change the search for skills to have parameters and have it load quickly

My issue is that I have up to 5000 items which I want to offer a search input for but I want the user to be able to search without waiting for results.
My current method takes around 20 seconds the first time the input is populated but is then very quick on subsequent searches. If I could
Load all the data at the start when the user expects to wait it would be a much better user experience

Using the example I gave you will load the data into a state Will that be faster in your application? I don’t know, you have to try it.

You can filter, but there are several posts in the forum that say that filtering is slower than searching with the proper constraints.

What I offered for your consideration is a way to do the searches (in the example I gave you there were 3) when the page is loaded and then “swap” the source of data for the repeating group when the radio button is changed.

But, as you probably know, there’s always more than one way to accomplish the same result, and sometimes you have to try a few alternatives to find what works best in your specific situation.

If your entire table is 5,000 elements, needing 20 seconds to load a repeating group looks a bit excessive. You may want to look into the searches you’re using. You may be filtering instead of constraining search and that, as said above, is slower. Try to find @josh’s post on the subject. It’s very educational.

Alex

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.