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

Issues with repeating sections and action buttons

1614277300

Edited 1614323308
Richard W.
Pro
Sheet Author
API Scripter
Compendium Curator
I have recently started building character sheets here at Roll20, and think it is a lot of fun. But sometimes you encounter inconsistencies, and it is difficult to know if I am doing it wrong, if the system isn't allowing it or just not working properly.  I have created a repeating section for my characters profession skills, it is mostly an exact copy of my working repeating spells section but with different attribute names. However, the action buttons and the sheet worker works for spells but not skills.  So, the classic question : My action button in my repeating section doesnt work, any ideas? Here is my html, with some of the options removed for brevity:  <fieldset class="repeating_pskills"> <span class="skills-row chartype-background-light"> <input class="skill-name chartype-background-light" class="input" type="text" name="attr_pskill_name" /> <span class="small-caps skill-name">     <input type="hidden" name="attr_pskill_base" value="0" min="0" title="@{pskills_$X_pskill_base}" readonly />     <select class="input character-skill-mod chartype-background-light" name="attr_pskill_attr" title="@{pskills_$X_pskill_attr}">     <option value="" selected disabled hidden data-i18n="base">Base</option>     <option value="str" data-i18n="strength-abbr">Str</option>     <option value="agi" data-i18n="agility-abbr">Agi</option>     <option value="wit" data-i18n="wits-abbr">Wit</option>     <option value="emp" data-i18n="empathy-abbr">Emp</option>     </select> </span> <input class="input-number character-skill-level" type="number" name="attr_pskill_level" value="0" min="0" title="@{pskills_$X_proffskill_level}" /> <select class="input character-skill-mod" name="attr_pskill_misc" title="@{pskills_$X_pskill_misc}">     <option value="0" selected>+0</option> </select> <select class="input character-skill-gear" name="attr_pskill_gear" title="@{pskills_$X_pskill_gear}">     <option value="0" selected>+0</option> </select> <button type="action" name="act_pskill-roll" data-i18n-title="update-dice-pool" title="Update the dice pool. Use the 'Roll' button to roll the dice.">     <span class="readonly character-skill-total" name="attr_pskill_total" value="0" title="@{pskills_$X_pskill_total}">0</span> </button> </span> </fieldset> And sheetworker script:   /* set prof skill dice pool */   on("clicked:repeating_pskills:pskill-roll", function () {     clog("Change Detected: Profession Skill - button clicked");     clog("eventInfo.sourceAttribute");     getAttrs(["repeating_pskills_pskill_name", "repeating_pskills_pskill_base", "repeating_pskills_pskill_level", "repeating_pskills_pskill_misc", "repeating_pskills_pskill_gear"], function (values) {       const pskill_name = values.repeating_pskills_pskill_name,         pskill_base = int(values.repeating_pskills_pskill_base),         pskill_level = int(values.repeating_pskills_pskill_level),         pskill_misc = int(values.repeating_pskills_pskill_misc),         pskill_gear = int(values.repeating_pskills_pskill_gear),         pskill_skill = pskill_level + pskill_misc;       setAttrs({         attribute: pskill_base,         skill: pskill_skill,         gear: pskill_gear,         current_preset: getTranslationByKey(`skill`) + ` - ${pskill_name}`,         include_with_roll: `{{skill-base=${pskill_base}}} {{skill-level=${pskill_level}}} {{skill-bonus-misc=${pskill_misc}}} {{skill-bonus-gear=${pskill_gear}}}`,       });     });   }); This sheetworker script sets the pskill_total and pskill_base, and works (seen in sheet and clog)   on("change:repeating_pskills:pskill_name change:repeating_pskills:pskill_attr change:repeating_pskills:pskill_level change:repeating_pskills:pskill_misc change:repeating_pskills:pskill_gear change:strength_total change:agility_total change:wits_total change:empathy_total", function () {     clog("Change Detected: Profession Skill - recalculating Base & Skill totals");     getAttrs(["repeating_pskills_pskill_name", "repeating_pskills_pskill_attr", "repeating_pskills_pskill_level", "repeating_pskills_pskill_misc", "repeating_pskills_pskill_gear", "strength_total", "agility_total", "wits_total", "empathy_total"], function (values) {       const name = values.repeating_pskills_pskill_name,         attr = values.repeating_pskills_pskill_attr,         strength = int(values.strength_total),         agility = int(values.agility_total),         wits = int(values.wits_total),         empathy = int(values.empathy_total),         pskill_skill = int(values.repeating_pskills_pskill_level),         pskill_misc = int(values.repeating_pskills_pskill_misc),         pskill_gear = int(values.repeating_pskills_pskill_gear);       const base = attr === "str" ? strength : (attr === "agi" ? agility : (attr === "wit" ? wits : (attr === "emp" ? empathy : 0))),         pskill_total = base + pskill_skill + pskill_misc + pskill_gear;       setAttrs({         repeating_pskills_pskill_base: base,         repeating_pskills_pskill_total: pskill_total,       });       clog("pskill_name: " + name + ", pskill_base: " + base + ", pskill_total: " + pskill_total);     });   });  It seems to me that the action button is not throwing any event, since there is nothing in the browser F12 console (not the clogs, not even an error) I have so far tried the following to no avail:  Changed naming on attributes and repeating section to see any difference, especially made sure no uppercase nor underscores in the repeating section or action button attributes.  I have another sheetworker script that successfully updates the attr_pskill_total in the html above, so referencing the attributes work (can share if needed) I have tried with "clicked:repeating_pskills:pskill-roll" and "clicked:repeating_pskills", made no difference Tried removing the span inside the button, and reverted to a roll-button class Compared with the working repeating_spells section and sheetworker, they look extremely similar but still this one doesn't work while spells does I have even tried removing everything but the clog rows, and still nothing Scratching my head, staring myself blind at the code, and not really finding more things to try nor more posts in the forum to read.  Thanks, Rich
1614277591
GiGs
Pro
Sheet Author
API Scripter
The first think I notice is your action button is named  pskillroll but in your sheet worker, your click event is looking for  pskill-roll
1614285879
GiGs
Pro
Sheet Author
API Scripter
I'd suggest changing your select to             <select class="input character-skill-mod chartype-background-light" name="attr_pskill_attr" title="@{pskills_$X_pskill_attr}">     <option value="" selected disabled hidden data-i18n="base">Base</option>     <option value="strength" data-i18n="strength-abbr">Str</option>     <option value="agility" data-i18n="agility-abbr">Agi</option>     <option value="wits" data-i18n="wits-abbr">Wit</option>     <option value="empathy" data-i18n="empathy-abbr">Emp</option>     </select> Then you can simplify your second sheet worker to on('change:repeating_pskills:pskill_name change:repeating_pskills:pskill_attr change:repeating_pskills:pskill_level change:repeating_pskills:pskill_misc change:repeating_pskills:pskill_gear change:strength_total change:agility_total change:wits_total change:empathy_total', function () {     clog('Change Detected: Profession Skill - recalculating Base & Skill totals');     getAttrs(['repeating_pskills_pskill_name', 'repeating_pskills_pskill_attr', 'repeating_pskills_pskill_level', 'repeating_pskills_pskill_misc', 'repeating_pskills_pskill_gear', 'strength_total', 'agility_total', 'wits_total', 'empathy_total'], function (values) {         const name = values.repeating_pskills_pskill_name,             attr = values.repeating_pskills_pskill_attr,             pskill_skill = int(values.repeating_pskills_pskill_level),             pskill_misc = int(values.repeating_pskills_pskill_misc),             pskill_gear = int(values.repeating_pskills_pskill_gear);             const base = int(values[`${attr}_total`]),             pskill_total = base + pskill_skill + pskill_misc + pskill_gear;         setAttrs({             repeating_pskills_pskill_base: base,             repeating_pskills_pskill_total: pskill_total,         });         clog('pskill_name: ' + name + ', pskill_base: ' + base + ', pskill_total: ' + pskill_total);     }); }); 
1614325621
Richard W.
Pro
Sheet Author
API Scripter
Compendium Curator
Hi GiGs, Thanks for the quick response, much appreciated.  For the first one, the pskill-roll is actually the same in both places in my html file which I am pretty thorough checking. I must have copied one of those form my work file (a .js file to get the code highlighting and such). But good eye there! The second one is appreciated, but sadly doesnt help with my issue here. Setting the base and displaying the total is not a problem (I think), although it could be done in a better way. The problem is that button not firing, as evident when using only this code snippet:   on("clicked:repeating_pskills:pskill-roll", function () {     clog("Change Detected: Profession Skill - button clicked");     clog("eventInfo.sourceAttribute");   }); Since it seems the button doesn't even fire, I have looked at alternatives around the html. Last one was to change the spans inside the fieldset to divs, but no difference. Also encapsulating the fieldset is another layer of divs, no difference.  Above the repeating section I have a list of static skills, these work fine with action buttons but obviously require less dynamic code. Also, I have a spells repeating section that more or less is exactly the same as this one, the former working but the latter not. I have even copied the repeating spells section into where the skills are, and that still works.  Still pretty lost, and wondering if it would be bad and lots of work to just modify the spells section after copying it and then moving on.  Any other ideas, team?
1614326522

Edited 1614326595
GiGs
Pro
Sheet Author
API Scripter
I copied your html, and sheet workers you linked above, and made this one change: <button type="action" name="act_ pskillroll " (removed the dash there) and the button fired perfectly. (Along with the original html). I just tested again, using the pskill-roll version in both places, and it worked fine. So I have no idea why its not working for you.* Can you post the entire html and css in pastebin or github, so I can test the full code you are actually using? I might be able to figure out why it's not working that way. *Actually I do have one idea. Sometimes when you are designing a sheet, and updating it multiple times, a character can get corrupted, and the most recently edited sheet workers stop working. The solution here is to create a new character and test it again. PS: The second thing I posted wasnt meant to be a fix - just an alternate way of doing what you're already doing in a but more optimised fashion.
1614340015
Richard W.
Pro
Sheet Author
API Scripter
Compendium Curator
Thanks, appreciate you testing my issue and agree that it seems to be something weird going on. I guess the repeating attributes arent really displayed anywhere, so difficult to check., I will try to run this in a new game with a new character (and hope for the best).  PS. I very much appreciate the suggested improvements and hope that I didnt sound dismissive. This is my first sheet so reading up on it and learning as I go. Roll20 has been much faster than buiöding my own Heroku React app, but some intricacies still to learn. Very thankful for theae forums and your input! DS. /Rich (on mobile)
1614354966
Richard W.
Pro
Sheet Author
API Scripter
Compendium Curator
So, creating a new game and new character didnt help. Something is definitely off with something in there, part of being noob on sheets but also merging other sheets into one.&nbsp; @GiGs, if the offer to test still stands, then the code is at&nbsp; <a href="https://github.com/dwarfwing/MutantYearZeroFL/" rel="nofollow">https://github.com/dwarfwing/MutantYearZeroFL/</a>. &nbsp; Appreciate all help! /Rich
1614408354

Edited 1614415509
GiGs
Pro
Sheet Author
API Scripter
I've ben messing with the sheet, and I'm just as stumped as you are. I cant figure out why the button isnt working. I did notice you have errors in two of your sheet workers, that aren't related to this. They are the same error: using sheet:opened &nbsp;in a repeating section that doesn't&nbsp; use the getSectionIDs function will always cause errors. The repeating_pskills worker that starts line 4088 should be: /*&nbsp;set&nbsp;profession&nbsp;skill&nbsp;base&nbsp;and&nbsp;skill&nbsp;total&nbsp;FIX&nbsp;*/ &nbsp;&nbsp;on('sheet:opened&nbsp;change:repeating_pskills:pskill_name&nbsp;change:repeating_pskills:pskill_attr&nbsp;change:repeating_pskills:pskill_level&nbsp;change:repeating_pskills:pskill_misc&nbsp;change:repeating_pskills:pskill_gear&nbsp;change:strength_total&nbsp;change:agility_total&nbsp;change:wits_total&nbsp;change:empathy_total',&nbsp;function&nbsp;()&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clog('Change&nbsp;Detected:&nbsp;Profession&nbsp;Skill&nbsp;-&nbsp;recalculating&nbsp;Base&nbsp;&amp;&nbsp;Skill&nbsp;totals'); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;getSectionIDs('repeating_pskills',&nbsp;idarray&nbsp;=&gt;&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;const&nbsp;fields&nbsp;=&nbsp;[]; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;idarray.forEach(id&nbsp;=&gt;&nbsp;fields.push( &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`repeating_pskills_${id}_pskill_name`, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`repeating_pskills_${id}_pskill_attr`,&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`repeating_pskills_${id}_pskill_base`,&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`repeating_pskills_${id}_pskill_level`,&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`repeating_pskills_${id}_pskill_misc`,&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`repeating_pskills_${id}_pskill_gear`,&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`repeating_pskills_${id}_pskill_total` &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)); &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;made&nbsp;the&nbsp;change&nbsp;event&nbsp;specific,&nbsp;so&nbsp;its&nbsp;only&nbsp;fired&nbsp;when&nbsp;needed,&nbsp;and&nbsp;likewise&nbsp;reduced&nbsp;the&nbsp;getAttrs&nbsp;to&nbsp;those&nbsp;only&nbsp;needed &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;getAttrs([...fields,&nbsp;'strength_total',&nbsp;'agility_total',&nbsp;'wits_total',&nbsp;'empathy_total'],&nbsp;function&nbsp;(values)&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;const&nbsp;output&nbsp;=&nbsp;{}; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;idarray.forEach(id&nbsp;=&gt;&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;const&nbsp;name&nbsp;=&nbsp;values[`repeating_pskills_${id}_pskill_name`]; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;const&nbsp;attr&nbsp;=&nbsp;values[`repeating_pskills_${id}_pskill_attr`]; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;const&nbsp;pskill_skill&nbsp;=&nbsp;int(values[`repeating_pskills_${id}_pskill_level`]); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;const&nbsp;pskill_misc&nbsp;=&nbsp;int(values[`repeating_pskills_${id}_pskill_misc`]); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;const&nbsp;pskill_gear&nbsp;=&nbsp;int(values[`repeating_pskills_${id}_pskill_gear`]); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;separate&nbsp;out&nbsp;the&nbsp;basic&nbsp;values&nbsp;read&nbsp;from&nbsp;the&nbsp;sheet&nbsp;from&nbsp;those&nbsp;calculated&nbsp;within&nbsp;the&nbsp;worker.&nbsp;for&nbsp;clarity &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;const&nbsp;pskill_base&nbsp;=&nbsp;values[`${attr}_total`]&nbsp;||&nbsp;0; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;const&nbsp;pskill_total&nbsp;=&nbsp;pskill_base&nbsp;+&nbsp;pskill_skill&nbsp;+&nbsp;pskill_misc&nbsp;+&nbsp;pskill_gear; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;output[`repeating_pskills_${id}_pskill_base`]&nbsp;=&nbsp;pskill_base; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;output[`repeating_pskills_${id}_pskill_total`]&nbsp;=&nbsp;pskill_total; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clog('pskill_name:&nbsp;'&nbsp;+&nbsp;name); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clog('pskill_base:&nbsp;'&nbsp;+&nbsp;pskill_base); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clog('weapon_skill_total:&nbsp;'&nbsp;+&nbsp;pskill_total); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setAttrs(output); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}); &nbsp;&nbsp;}); To make this work properly, change the select that starts on line 1427 to &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt; select &nbsp; class = "input&nbsp;character-skill-mod&nbsp;chartype-background-light" &nbsp; name = "attr_pskill_attr" &nbsp; title = "@{pskills_$X_pskill_attr}" &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt; option &nbsp; value = "" &nbsp; selected &nbsp; disabled &nbsp; hidden &nbsp; data-i18n = "base" &gt; Base &lt;/ option &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt; option &nbsp; value = "strength" &nbsp; data-i18n = "strength-abbr" &gt; Str &lt;/ option &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt; option &nbsp; value = "agility" &nbsp; data-i18n = "agility-abbr" &gt; Agi &lt;/ option &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt; option &nbsp; value = "wits" &nbsp; data-i18n = "wits-abbr" &gt; Wit &lt;/ option &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt; option &nbsp; value = "empathy" &nbsp; data-i18n = "empathy-abbr" &gt; Emp &lt;/ option &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/ select &gt; The error here is that when strength, or agility, or whatever changes, you need to check every row &nbsp;in the repeating section, and update the values. But the original code used the repeating_section_attribute syntax for getAttrs - there was no row id so roll20 couldnt identify which row to change. You need to use getSectionIDs to get all the rows and update them all. The same error occurs in the repeating_armour worker immediately after the above sheet worker, but you can fix that one just by removing sheet:opened &nbsp;from the first line, and also adding change: to the first attribute - it's missing. I havent figured out why that action button isnt working though. It's baffling.
1614409329
GiGs
Pro
Sheet Author
API Scripter
I've found the issue in an old post, first discovered by Scott C:&nbsp; <a href="https://app.roll20.net/forum/permalink/7330244/" rel="nofollow">https://app.roll20.net/forum/permalink/7330244/</a> It's a roll20 bug. If an action button inside a repeating section is also contained inside an element with position: relative assigned to it., the button doesnt work. I changed the CSS of every position: relative item to position: static just to check, and the button started working. So to get this working you'll have to find which item with position: relative is causing the issue and figure out how to change the style so things keep working and looking right.
1614410297
vÍnce
Pro
Sheet Author
GiGs said: I've found the issue in an old post, first discovered by Scott C:&nbsp; <a href="https://app.roll20.net/forum/permalink/7330244/" rel="nofollow">https://app.roll20.net/forum/permalink/7330244/</a> It's a roll20 bug. If an action button inside a repeating section is also contained inside an element with position: relative assigned to it., the button doesnt work. I changed the CSS of every position: relative item to position: static just to check, and the button started working. So to get this working you'll have to find which item with position: relative is causing the issue and figure out how to change the style so things keep working and looking right. I thought this sounded familiar... :-)
1614417006
Richard W.
Pro
Sheet Author
API Scripter
Compendium Curator
Wow, thanks a million! This is a massive help and imagine the little bug that found its way in there... Looks like the two of you discussed it way back then as well :) I will first off clean up the CSS from any relative positioning, and make sure the button works. Then I will review and implement the fix you included. I hope with this fixed and all lessons learnt, I can continue developing. Lots of clean up to do, more tabs to work on and so on, but should also release a first version at some stage (we are currently playing the game so would be nice to have this sheet available). Again, thanks for the quick help and massive help / extremely appreciated! Best Regards, Richard W
1614425773
Richard W.
Pro
Sheet Author
API Scripter
Compendium Curator
Just did the following:&nbsp; - Removed the encapsulating position:relative &nbsp;around the repeating section, and the button now (miraculously) works! - Updated the pskill sheetworker with IDs, and thus removing the console error - Updated the repeating-armor sheetworker to remove the sheet load event, removing further errors Again, many thanks to @GiGs!
1614450246
GiGs
Pro
Sheet Author
API Scripter
Great!