Stuck with custom state

Hello everyone.

I’m trying to build a vehicle app where users can search and add listings.

I want users to have the possibility to search multiple brands and models at the same time.
I want them to search for up to three different brands or models.
And for this situation, I have thought to add more rows when it needs.

Basically when the user click Add Button (+) one more row should be added.

And after adding the row the Remove Buttons (x) for the two rows and one more underline should be visible (to separate the two rows).
I don’t want the Remove Buttons (x) to be visible from the beginning because 1 row It is necessary and should not be deleted.

I want to show up to three rows and then the Add Button should not be visible to the users so they cant add more rows. (Its also a sign to show them that this is the max)

Right now I’m messing around with Custom State which I can do with two rows but not three.
I tried Repeated Groups but with no luck, because it shows in every row Remove Button (x) and Underline which I don’t want in the beginning when it’s 1 row and not, in the end, when are there rows.

Any idea how that should be done?

Thanks in advance guys.
Fabian

You can leave it as a repeating group and add a conditional on the X element to not be visible if current cell’s index is 1. Then you can add a conditional on the + element to not be visible if repeating groups’s list of things count is greater than 2. Or if it is not a repeating group then just remove the X from the first group and add a conditional to the + element that if the third group is visible then the + is not visible.

Hello again William.
Thanks again for your help.

The problem is that the Repeated Group refreshes the page and wipes the dropdowns.
Besides that, I don’t know how to control the Underline appearance.

I tried that and it’s not working.

Fabian

I figured out how to do this… Even with Underline
I have another problem.

I can’t show the Remove Button (x) on the first row and when I delete the middle row it wipes the field of the last row.

I’m still experimenting. I hope I will find out.
Fabian

How to use Custom State with Repeated Group?
I’m using the Database with the Repeated Group but is very slow.

Fabian

I would you store the repeating group search constraints as parameters in the url. So when the user browses from page to page you can pass them around.

Then have your drop downs default value be the URL parameters

Thank you for your reply AliFarahat.

I don’t need to pass data between pages.
I want the Repeating Group to act as an option to show more fields or hide.

Fabian

This topic was automatically closed after 70 days. New replies are no longer allowed.