Two button click for the same button with a label change

Progress Stepper Form Submission

Hi, I am trying to create a form in steps with a conditionally rendered next/save and back buttons to help the user progress through the form. Currently, the stepper logic and conditional rendering of the label of the button is working fine, but I can not get the save function to trigger on the last button click. I am using to different workflows to trigger the different behaviors desired based on the stepper index.

Desired behaviors:
1)when the button is clicked & stepper’s(the repeating group) current index (which is managed by custom state) is less than the stepper’s steps(custom state):count
→ current step +1

2)when the button is clicked & stepper’s current index is the stepper’s steps:count
→ implement save function

  1. The button label is managed by the button’s Label property and the conditions are based on the stepper’s current step and whether it is the last step or not.

The error occurs as soon as I am on the las step and click the save button. The debugger shows the trigger to increment the currentStep fail, and as soon as I click the next function an alert appear informing me that the page has been updated and needs to be refreshed to be up to date. The second trigger to implement the save function never runs.

Here’s some additional context.


First, you can remove the conditions on the actions if they’re the exact same as the event condition. They’re redundant. If the event as a whole fails, then the actions won’t run.

If nothing happens on the final trigger, check your conditions on the button to see if you have something making it “not clickable.”

There is nothing making the buttons not clickable. The button trigger to check if the currentStep is less than stepsLabels:count runs while the other does not, and then the alert appears.

I am currently using a state to manage whether to init the saving function. With this set up, both button triggers fire, but the trigger for watching the state change only fires when I have the breakpoint box checked.

This topic was automatically closed after 70 days. New replies are no longer allowed.