Adding a new row to an existing repeater with form fields

Hello There,

I have a requirement to add a new row to an existing repeater where there is already a row with a view only content. I would like to add a new row with form fields like text field, dropdown and date picker to choose and save the date. Simultaneously, when I try to save the record the row should turn into view only field without the text fields appeared in the row. I should have the provision of adding multiple records and saving them.

I tried to solve this by creating 2 repeaters. One is the parent repeater where the row to be added and the other is with the input fields, that needs to be added in the parent repeater. I am struggling to port the data from the 2nd repeater to the first repeater and need help here.

The second requirement is, post clicking the save icon the input field should be disappeared and it should be displayed as the first row.

Here is the sample axure file attached. All help extended in advance is dearlymove row data from one repeater to other.rp (67.1 KB)

This probably isn’t quite perfect - but see attached.

You don’t need a second repeater. I used a dynamic panel that houses your “add another” button and the form to add a new row. On click on the save button in the form it adds the row. You were also missing columns and onItemLoad events to set your data.

Moving the button on the bottom is accomplished by adding an event for the last item that moves the button based on the number of items in the repeater.

I didn’t have a chance to put logic in place to sort - but you’ll want to add another column to your dataset to accomplish that. Let me know if you don’t know how to do that or if you have other questions.

move row data from one repeater to other.rp (77.3 KB)

Thanks for the response. I tried the way you suggested but this doesn’t solve the purpose of adding multiple rows of data. This is just a hack to simulate the experience of adding just one row to the repeater but doesn’t solve my purpose. However the second solution for adding as view only field I guessed it right as you suggested.

You can add as many rows as you want using this approach because each time it’s adding another row to the repeater…

if you’re looking to do multiple rows you’ll just need to reset the form fields after you add the row - see attached. That way each time you go back in to add another the form will be in the default state.

move row data from one repeater to other.rp (77.9 KB)

I guess you could do the form as a repeater if you wanted to and refresh the repeater to reset the state. That would work as well. Sometimes repeaters can have a bit of overhead and slow things down. But I’m guessing a single row repeater wouldn’t be so bad if you wanted to go that route. In either case - the logic is the same, you need use the add row action and use the values from the form fields to insert the row into your repeater, and you definitely need the actions on load of the primary repeater to actually set the values.

Yes, I realized this after a dig down. Thanks for the elaborated explanation though. I have another requirement and I know the same can be resolved using add row logic and a dynamic panel. However I want to resolve this using update row action.

The problem I am facing.

I can add a new row by clicking the “Add new Owner” link and on click of save button I would show a popup of with another repeater showing some records. What I want here is, on select of a particular record and then then the add button below, the parent repeater with a newly added row value should update with the value from the repeater I have selected from the popup.

While I try to resolve this, I found two set of expressions (One example is Item.FirstName and TargetItem.First Name). While I understand TargetItem is to update the target repeater, in my case its “rptr-addowner-content”. Then why another set of expression (Item.Firstname, Item. LastName…etc are displayed).

The second issue While I try to update the record for the target repeater, I am not seeing the items to select from the “search_results” repeater from the popup.

The thrid Issue: Is there any synatx in axure where I can target the specific item from a row (For example: if I want to pick an item from row number1.

Kindly help. Your help appreciated in advance

update rows of one repeater from the data of other repeater.rp (1.3 MB)

First Item:
The TargetItem prefix refers to the dataset of another repeater. It’s generally used when you need to evaluate logic for filtering, updating or marking a row. For example, let’s say you have repeater a which is a list of products and repeater b which is a list of customers. If you wanted to update an item in repeater b from inside of repeater a, you might do logic like this in a filter or update row rule:
[[Item.ProductID == TargetItem.ProductID]]

2nd Item:
From your file it looks like your pop-up is a separate page? You can’t natively perform any interactions between separate axure pages without some really fancy hacks. You can pass data in between pages using variables, but that’s about it. If you need to have interactions between the parent and the pop-up, perhaps you can put your content in a dynamic panel on the same page and treat it as a lightbox? Then you’d be able to reference widgets between the two.

3rd Item
Do you mean being able to get a value out of the repeater for a specific row, or to update a specific value for a row?

1 Like

On the third issue what I mean here is, the rownumber in reeater. For example: if a repeater have 5 rows and I want to target the row 1