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

Repeating section behaviour not understood

Hi, I'm currently workin on an Exalted 3e sheet that already existed and in some part of the sheet i have a repeating section looking like this < fieldset class = "repeating_martialarts" style = " display: none; " >     < div class = "sheet-trait" >         < input type = "text" name = "attr_repmartialartsname" placeholder = "Celestial Monkey Style" >         < div class = "sheet-dots" >             < input type = "radio" class = "sheet-dots0" name = "attr_repmartialartsval" value = "0" checked = "checked" >< span ></ span >             < input type = "radio" class = "sheet-dots1" name = "attr_repmartialartsval" value = "1" >< span ></ span >             < input type = "radio" class = "sheet-dots2" name = "attr_repmartialartsval" value = "2" >< span ></ span >             < input type = "radio" class = "sheet-dots3" name = "attr_repmartialartsval" value = "3" >< span ></ span >             < input type = "radio" class = "sheet-dots4" name = "attr_repmartialartsval" value = "4" >< span ></ span >             < input type = "radio" class = "sheet-dots5" name = "attr_repmartialartsval" value = "5" >< span ></ span >             < input type = "radio" class = "sheet-dots6" name = "attr_repmartialartsval" value = "6" >< span ></ span >             < input type = "radio" class = "sheet-dots7" name = "attr_repmartialartsval" value = "7" >< span ></ span >             < input type = "radio" class = "sheet-dots8" name = "attr_repmartialartsval" value = "8" >< span ></ span >             < input type = "radio" class = "sheet-dots9" name = "attr_repmartialartsval" value = "9" >< span ></ span >             < input type = "radio" class = "sheet-dots10" name = "attr_repmartialartsval" value = "10" >< span ></ span > </ div >     </ div > </ fieldset > Sadly, in the browser the radios looks like to generate as a separate ID, and i don't understand how it's happening or how to get that ID through sheetworker If anyone is able to help or explain that to me that would be really nice guys ^^' Have a great day to all of you
1645552687

Edited 1645552788
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
There are two types of IDs associated with repeating attributes. The ID of the attribute itself (this is what the attribute is stored under in the Roll20 database). That's the ID that you see in the name property there. Character sheets don't care about this attribute and don't interact with it in any way; it's only used by the Roll20 backend and occasionally by API scripts. EDIT: This ID actually exists for all attributes, not just repeating attributes. The repeating section row ID. This is the ID of the individual row in the repeating section, and you can see it in the repitem div in the data-reprowid property of that div. Character sheets see this as part of the name of the attribute (e.g. repeating_martialarts_-MVXfsf09825lkjasd_repmartialartsname ). To get the Row ID of a row, you can do it a few different ways depending on what you're trying to accomplish. The first option is just straight from the sourceAttribute property of the event object passed by the sheetworker listener. The second option is to use the getSectionIDs  sheetworker function to get the row IDs of all rows in the section.
1645555419

Edited 1645555451
hmmm ok, i was using legacy code of this sheet that was doing TAS.repeating('martialarts') .fields('repma') .attrs('ma-snake', 'ma-tiger', 'ma-void', 'ma-reaper', 'ma-ebon', 'ma-crane', 'ma-nightingale', 'ma-devil', 'ma-claw', 'ma-pearl', 'ma-steel') .tap(TAS._fn(function getMaxMaAndApply(rows, attrs) { and then doing  _ . each ( rows , function ( v , k ) {     TAS . debug ( `v= ${ JSON . stringify ( v ) } , k= ${ JSON . stringify ( k ) } ` );     ma = Math . max ( ma , v . I . repmartialartsval ); }); but looks like it doesnt work x) i updated it to a  getSectionIDs that getAttr each attr i need, and that works i'll search about the TAS library exact behaviour thanks for your answer and time !
1645556121
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Well, that TAS code would be looking for a repeating attribute named repma  in the martialarts  section. So, you'd need to update it to look for your repmartialartsval  attribute instead.
oh ok
way more concise, and it works ! thanks where can i find the documentation for the TAS library please ?
1645559443
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Aaron has a pretty comprehensive set of docs for TAS. You can find them on his github .
1645613088
Andreas J.
Forum Champion
Sheet Author
Translator
See also <a href="https://wiki.roll20.net/Character_Sheet_Development/Pattern_Libraries" rel="nofollow">https://wiki.roll20.net/Character_Sheet_Development/Pattern_Libraries</a>
Thanks a lot guys !