Hello, I am new to the forums but not to Axure. I am however new to the Repeater widget and am learning how to use it.
I work for a company creating a web platform for processing medical payments. In our prototype, the user can click an icon to upload a file. Each uploaded file is represented by a thumbnail icon. The user can arbitrarily delete one of the uploaded files by clicking “remove” beneath the icon, which should delete the row from the repeater, removing the file preview thumbnail and adjusting the other icons to fill the space dynamically. The last row of the repeater is always the upload icon (add a new file).
The initial view is an empty dataset. I am using this code on the Repeater Item Interactions:
if "[[Item.isLast]]" equals "1"
Set Thumbs to State 1
Else If True
Set Thumbs to [[Math.floor(Math.random()*10)+1]]
This checks to see if the current row is the last row, and if so, sets the dynamic panel to the upload icon. If not, a random thumbnail icon is selected to represent an uploaded file.
Before the “file” is “uploaded,” I’m also throwing up a dummy lightbox file selection dialogue. Because I only want this to occur when a file is added, not removed, I’m using a global variable called Unset.
I have two problems - firstly, none of this works very well. The repeater occasionally sets the dynamic panel to State 1 (file upload) even if the row is not the last row in the dataset. Also, when a file is deleted, sometimes it works correctly, and the other files remain unchanged. Other times, the existing files randomize. The lightbox will show up once when a file is removed. Then on subsequent removals it will not show up.
The other issue is that in this prototype, which is a 7 step submission process, the user needs to be able to revisit a page in order to see the values entered. So I need to store the selected files in a global variable on page exit, and populate the repeater from this variable on page load. I have no idea how to do this!
I’m attaching the file for reference. I appreciate any help or pointers. Thanks!
Prototype.rp (2.32 MB)

