How to change Checkbox Name based on repeater text value

repeater-widget

#1

I have a repeater with a checkboxes. I want to change a Repeater Name value based on a text in my repeater data table. Is it possible?

I am using Checkbox Name value to filter my another table. I would appreciate any help

Sample-test-checkbox name change.rp (590.4 KB)


#2

Hi!

This post covers that very thing. The filter becomes much simpler, but the checkbox code is more involved than the facet-filter method you are using.


#3

Oops - that was the wrong file. It doesn’t use a repeater. I know I have it: let me look…


#4

Here it is. It’s an expanded version of my original facet filter example. The 5th page has the example you are looking for.

File: facetfilters.rp (320.5 KB)


#5

That’s awesome, looks like this is exactly what I need.

Don’t you have any examples on how we can put these repeater checkboxes into a predictive search? I have a long filter with about 70 checkboxes and I don’t want my users to scroll, I want to let them search for the checkboxes they need


#6

Hi!

At some point I created an example of creating a predictive search, which you could easily do with the checkboxes.

Note, however, based on how this solution works, this winnowing would also make is so winnowed out checkboxes would no longer filter the other repeater. So if you had Tom Smith checked, and you predictive-searched the checkbox list for Jane Doe then selected her, Tom Smith would not appear in the other repeater, UNLESS, upon selecting the checkbox, you blank out the search field before forcing the other repeater to update, which might feel awkward.

Here is that predictive search file. Note that it uses a similar method to the facet filters, in that the filter is created on page load, and typing in the text field forces its re-evaluation.

Preview

File: winnowing_search.rp (171.4 KB)

Note that the file has three pages.

[Edit] A workaround to the winnowing search would be to have two checkbox repeaters, hide the one that isn’t subject to the predictive search (which will be the one that the filter is based on) and then keep the two repeaters in sync, so that when you check or uncheck a checkbox in the visible one, you update the hidden one.

Note that the hidden one would have the text label that the filter is based on: the visible one doesn’t need it.

The code would go like this:

OnClick (of checkbox in visible repeater)
  -- Update the isSelected column of the visible repeater (that code is already in the checkbox)
  Update rows set isSelected of hidden repeater to [[This.isSelected]] where [[TargetItem.name == Item.name]]

… assuming “name” is the column that holds the text of the checkbox.

In the visible repeater, you would get rid of the code in Item Loaded that builds the filter string and forces the filtered repeater to re-evaluate (important!). The only code Item Loaded would have would be setting the text of the checkbox and checking or unchecking it based on the value of isSelected.

You could remove the checkbox entirely from the hidden repeater, since the only thing that matters is the value of isSelected. But I’d keep it at least until you get the code working.


#7

Axure is all tape and glue sometimes. Let me know if you run into issues.


#8

Thanks, it was really helpful. I don’t fully understand the logic of your components but I was able to copy-paste it to my file and apply the data I need. So I am good for tomorrow’s deadline, but I would definitely want to come back to it. Thanks again!