Actor Item not updating but the world item will update

Ok, So I feel like I am doing something wrong.. I am using Appv2 for a new system I am designing. I am using the boilerplate v12 setup. I have a selectOptions that looks like this
<select name="abilityType" class="abilityType">
{{selectOptions abilityOptions selected=system.abilityTypeValue localize=true}}
</select>
<select name="abilityType" class="abilityType">
{{selectOptions abilityOptions selected=system.abilityTypeValue localize=true}}
</select>
In my Item sheet I have a _onChangeForm that looks like this.
_onChangeForm(formConfig, event) {
if (event.target.name === "abilityType") {
// Do what you need here
let value = event.target.value;
this.item.update({ "system.abilityTypeValue": value });
}
}
_onChangeForm(formConfig, event) {
if (event.target.name === "abilityType") {
// Do what you need here
let value = event.target.value;
this.item.update({ "system.abilityTypeValue": value });
}
}
The item will change if its a world item but if its on an actors sheet it won't change at all. system.abilityTypeValue is just a string value and abilityOptions is { a: "Species", b: "Character Class", c: "NPC" } Am I doing something wrong?
2 Replies
Forien
Forien4mo ago
Hard to say without more context, but is there a reason why you make your own handlers for changes instead of using DocumentSheetV2's built in handler? all you need to do is to have <select name="system.abilityTypeValue" ... and it will update on its own (assuming you also have "submit on change" set to true
Grimwood_Games
Grimwood_GamesOP4mo ago
Yeah I had it set to that but its not changing Has to be with my datamodel.. thanks for the help

Did you find this page helpful?