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?
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.
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.
And I did the same (not shown) for Set B, where Skill Type is B
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
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.
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.