Loading values for multiple repeaters


#1

Hello,
I have multiple repeaters on page and the problem is following:

  • if I have one repeater, everything is fine
  • if I have more repeaters than one, when the page is loading / rendering itself, there’s default value of the repeater shown for a second.

What I’m trying to achieve is to be able to show different cell according to the repeater value – I have two states (active and inactive).

Sample file: https://www.dropbox.com/s/1bhnq6hvf5efwl3/repeater.rp?dl=0

Any thoughts or tips how to optimise it? I don’t want to have the blink between default value state and real value state there.

Thanks!


#2

Hi,

I would recommend you to use a dynamic panel with an empty panel by default.

See attached file, I did it for one and hide the others :

repeater-modified.rp (75.1 KB)

Generrally speaking, when one have to hide something and show something else, Dynamic panels are far better as show/hide.

Best,


#3

Thanks PierreJ, but the problem is still there when you have more than one repeater present :-/


#4

I’m a little confused - when should the field in your repeaters ever display the word “Deliverable”?


#5

Hi,

The so called “blink” may appear based on the number of elements on the page and the order the page loads those elements.

The order the page loads the widget is…

  1. Load the repeater element first with default values
  2. and then, Run the interactions

Go inside the repeater and delete the default text which says “Delivered” in your file. This may solve the blinking problem to an extent.




I see that you have used Masters for active/inactive states. Instead of using masters or dynamic panels, this can be simply achieved by setting Interaction styles. Just add a Disabled style for the content inside the repeater and add a condition based on the value (See image below)




You can do this by forcing an event on OnPageLoad. In this case, group all the repeaters and hide it by default and then add a Show event on OnPageLoad.
This is a quick and dirty way to optimize it but I am sure you can try many preload events.

See the page load comparison in the attached file
repeater_PN.rp (90.2 KB)


#6

See the variations I did to your file:
bunchOfRepeaters.rp (166.8 KB)

See it in action here: https://bl91jm.axshare.com

Simplest thing is to just remove the text in your cell --the “Deliverable” text in the masters. Once you have it styled the way you want, just delete that text. When the repeater loads it sets that text value anyway, so you don’t need it. When the repeater loads, it takes a few ms to run its onItemLoad code for every item in your list (and in all the repeaters.) So, there’s a small delay to change “Deliverable” to the value in the Item.Deliverable cells (1, 2, 3, etc.)

Another way to more gracefully present and update repeaters is to hide them on the stage, then show them onLoad. It makes editing a bit of a hassle to unhide it, edit, then remember to hide it before previewing (but with repeaters you don’t need to see them to edit them.)

On Page 1, I put all your repeaters in a dynamic panel, then put a “hide, wait, then show” sequence in the onLoad event. That doesn’t work because the repeater masters are still briefly shown when the browser loads the page.

On Page 2, I did the same thing, except checked the “Hidden” box for the dynamic panel, so it is hidden by default and not shown as the browser loads the page (at least in Chrome on Windows.) This gets the effect you want.

Now, on Page 3, I deleted the text on your Deliverable item widget. Only I had to do this in a (non-master) copy of your master, otherwise all instances on all pages would be changed, fixing it throughout but ruining my demonstration here. Same effect of the multiple repeaters, but they all load “clean” because their item is clean to start with. I then messed around with table features to demonstrate this to colleagues I work with. This was a good foil to show what can be done with repeaters in a simple way. It also shows some methods for hiding and showing list changes with nice “reveals”.

Notice you don’t need separate masters or separate items to achieve your “active” and “inactive” states. Just use one widget in your repeater and set it’s selected (or disabled) state, as praveen.naga shows above. I did the same thing in the repeaters on Page 3 so you can see how it is achieved.