Refresh repeater after clicking a button

Hi! I made this comment section with some text boxes and a button to submit the comment and I put the same data on two differents datasets: Write dataset (#dataset1) and Read dataset (#dataset2). That way, whenever I write a comment, I can see it posted on my repeater below my formulary. Well, at least sort of. I need to refresh my page in order to see the most recent comment, but I’m trying to make my repeater refresh immediatly after I click on the submit button.
I’ve already tried to use both codes avaible on wix references https://www.wix.com/corvid/reference/wix-dataset/dataset/refresh
and I also have tried this

export async function submit_click(event) {
 let $item = $w.at(event.context);
 let newValue = $item('#comment').value;
  $item('#dataset2').setFieldValue('gosc', newValue);
 await $item('#dataset2').save();
await $w("#dataset2").refresh();
}

and this code that I’ve found in some answers

export function submit_click(event) {
 let $item = $w.at(event.context);
    $item("#dataset2").refresh()
}

but none of them is working for me. Maybe is just one little thing that’s not working and I’m not seeing since I’m very new into coding, but I would be very thankful if someone point that out!

Do you have your Submit button connected to the “Submit” dataset action as in the following image:

If the button is connected to the Submit action, then the submit_click() event handler will not be triggered.

yeah, it’s already that way :confused:
also my submit button is connect to the Write dataset, so it can send the comment

@arqpet Is the Submit button connected to the Submit action as i the screenshot I posted? If so, then submit_click() won’t run.

@yisrael-wix oh I got it. So I can’t put the action of submit comment and refresh the repeater in the same button, right?