Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Are repeating sections with identical names really allowed?

1660758807

Edited 1660812793
In <a href="https://wiki.roll20.net/BCS/Repeating_Sections" rel="nofollow">https://wiki.roll20.net/BCS/Repeating_Sections</a> , it is stated that " Each repeating section should have a unique name ", but the section "Duplicate a repeating section name to display the same data on more than one tab or present a summary of the data elsewhere" indicates a trick using repeating sections with the same name. This is a trick I'd like to use (to present a summary) but I'd rather it be officially supported. Do you reserve the right to break this "functionality" or can we assume it is there to stay?
1660761481

Edited 1660761587
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Yes, what the&nbsp; " Each repeating section should have a unique name " bit means is that the repeating sections store their data based on the repeating section name, so you can't have two sections with the same name and expect them to operate off of different data sets. The sheet doesn't care if you repeat a given input, textarea, button, repeating section, etc. It's just going to display the data it has for that thing. The one exception is radio buttons, which don't do well when you have multiple versions of the same radio button (same name property) with the same value. Edit: I should also note that you're going to have a hard time creating a sheet without a pro subscription. All of the roll20 tools to do so are pro perks, and character sheet code doesn't run well on generic web dev platforms (e.g. codepen) because there are several backend technologies going on that are difficult to replicate.
OK, good. I'm editing an existing sheet, improving it marginally, and I created a sandbox "emulator" that does the job correctly for this sheet's requirements so far (the PRs I made worked as expected). I'm currently ironing out the repeating sections, which work fine in their basic usage (add/delete/getAttrs/setAttrs). I'm a bit less confident on the multi-repeating section trick, since it's not used in the sheet yet, so I can't compare with the online version. But I have the spec in the trick description and I think I understand why it works.
Hum, actually it's not as straightforward as expected. Would someone happen to know a sheet that uses this?
1660816414
Finderski
Plus
Sheet Author
Compendium Curator
The Official Savage Worlds character sheet does. It displays 4 or 5 different repeating sections on different tabs and with different views.&nbsp;
1660816541
Finderski
Plus
Sheet Author
Compendium Curator
One thing I should have mentioned...it's probably easiest to bring ALL the inputs over from the original repeating section (including their default values) and then just hide the ones you don't need and style the remaining how you need them to look. And by "hide" I mean apply some CSS to them, leave them in the HTML.
Thanks, that helped a lot. Nice sheet BTW. Could you elaborate on your remark? I edited the summary fieldset live in Chrome (I removed some inputs) and added an item in the edition repeating section: a summary row was added with the edited content of the summary fieldset without error. Will I encounter errors if all the inputs are not found in the summary fieldset?
1660828145
Finderski
Plus
Sheet Author
Compendium Curator
It depends...You can leave some that are not needed for anything, but if you are going to display a button and that button relies on fields as part of the value, if those fields aren't present, I've gotten weird results. So, I've just found it easier to &nbsp;add them all.