Using Repeaters to fill value of text field

Hi,

I am new to Axure 9. I want to use a Repeater with values from 1-24 to fill those values into a text field. I tried using a Button with the OnClick event set to “[[repeatme.text]]” where repeatme is the name of the repeater. This does not seem to work. Also, I would like to pause for 10 seconds after each value is used.

Thanks!

Do you mean you want to have a repeater that transfers arbitrary values in it into a text field, or must those values be a contiguous numeric series (ie 1-24)?

Either way, the general technique I’d use is to have a “listener” inside my repeater. Create this as a hotspot or something which can be given, say, an onMove event. That event then takes the value in the relevant repeater field and puts it into the text field after a suitable wait (you’ll also need to put the current value of the text field into a variable first and then append the new value to it I think, otherwise it’ll just overwrite). Then make the button trigger the listener’s event.

Mind you I’ve not tried this so it might not work. :slight_smile:

Thanks. I want to use a contiguous set of values: 1-24. I will try your technique to see if it works. If you have any samples, please forward along.

Here’s an example of what I mean.

example.rp (53.9 KB)

Perfect!! Thanks! This really helps me a lot.

One more thing. Do you know a way to put a delay in between setting the values? Maybe a Repeater is not what I need, but I am looking for a way to set the value of a text object to the first value in the Repeater, then test to see if it is greater than another value, then wait 30 seconds, and repeat for the next value in the Repeater, and so on until the last value in the repeater.

The way my “listener” approach works is that it sets all the values at once, so it can’t insert a delay. You could modify it so that the listener puts the index number of the row into a variable and looks to see if the current index value is equal to the variable + 1 and if it is, puts the value of the field that’s at that index into the text field after a delay.

Or (and here we get into the “art of prototyping”), if all that’s too perfect for what might be a throwaway prototype, you could just have a plain stack of named widgets instead of the repeater, and just have a button that puts the value in each widget successively into the text field after a delay.

Sometimes, when I’m creating a prototype, I have to remind myself that I’m not creating an application. All I need to do is demo some UI :slight_smile:

Thanks! These are both good suggestions and I will give them both a try.

This was really helpful. I am building a predictive search field for a mobile airline website. So I plan to use this code to populate a search field. Just so I’m clear, you created the CurrentContents as intermediary between repeater and the text field. In this sense that CurrentContents variable stores the data from the repeater and the text field populates from the currentcontents variable?

Best,
Theo

If I understand you correctly, yes that’s right. However, there are quite a few examples of reasonably elegant predictive search fields posted on these forums - you might want to start with one of those, unless you just want a project to learn how to do some advanced Axure stuff.

Hi Jon, Thank you for your response. I am building a airline app for a project. The repeater widget has proved helpful in helping me organize location info (e.g. City Name, Airport Code, and Image). I also have to use this info in different parts of the app too. Anyway for this particular use case:

            1. The user denies the app from using his/her current location. 
            2. User is redirected to a predictive search page where he or she searches their location.
            3. The user double taps the desired departing location 
            4. the departing location is populated on the main finding flights page. 

Steps 1 and 2 work but i am obsessed with figuring out how to make 3 and 4 steps work. My untested approach to the problem so far would be to:
1. Make is to transform each location into a separate variable.
2. Assign an a Hotspot to each rectangle.
3. Somehow make each hotspot unique with an Onclick/Tap command to set the text of Departing City Field according to its associated location variable.

Its so fuzzy in my head and something feels wrong. Aaah .

Best,

Theo