Updating multiple records of a Dataset connected to repeater is not working

I have a repeater that is connected to a dataset with Read-Write mode . The repeater has some visible and some hidden fields all connected to the respective fields of the dataset. I would like to save the changes made by the user on any of the repeater rows. I tried the following code as per the discussion https://www.wix.com/corvid/forum/community-discussion/save-and-refresh-repeater.
it is not working .Only the first row of the repeater if changed by the user is saved. The other rows that are updated by the user are not saved.
I tried connecting a button to the dataset to submit the changes. It is not working either.
I am not able to get the $w(‘#Dataset’).save and $w(‘#dataset’).refresh to work
here is the code for saving the changes for the repeater items.

export async function SubmitButton_click(event) {
    console.log("Updating");
    let result = await $w('#OrderItemsDataset').save()
                        .catch( (err) => {
                         let errorMsg = err;
                         console.log(errorMsg);
                        });
    result = await ResetPage();
 return;
}

export async function ResetPage (){
     let Result = await $w('#OrderItemsDataset').refresh()
                .catch( (err) => {
                 let errorMsg = err;
                 console.log(errorMsg);
                 return false;
                                });
 return true;
}

While working on this issue I noticed that if value of an input field is changed in code and not changed by the user the value is not updated in the table. not sure if this is related to the Save issue.
Other fields input by the user get updated. but only for the first row of repeater.
Please suggest a workaround.

You are correct. If the value of an input field is changed in code and not changed by the user the value is not updated. You need to use the dataset setFieldValue or setFieldValues functions to update the field(s) in the dataset item.

That helps ,thanks Yisrael.
But the $w ( ‘#OrderItemsDataset’ ). save () updates only one record particularly the first row of the repeater.
If the 2, 3 row are edited, they are not updated.
So I set up a array to store the item ids of the changed rows. Used this itemId array in the forItems function of the repeater to create update the records and do a bulk update, when the submit button ,is clicked.
This is one method I could think of. Please let me know if there is a better way to do update the changed rows of the repeater.