Joldz ๐Ÿ”ฎJ
Windmillโ€ข15mo agoโ€ข
2 replies
Joldz ๐Ÿ”ฎ

Stepper Component Question

I'm having trouble understanding how to do error checking when trying to advance the next step in the stepper but still allowing the user to go backwards. My script attached to the stepper component looks like this.
def main(stepIndex: int,month:int, year:int,preview_df_exists:list):
    if stepIndex == 0:
        if not month or month == 0 or not year:
            raise Exception("Please Enter a Month and Year.")
    elif stepIndex == 1:
        if not preview_df_exists:
            raise Exception("Please Upload a file ")


I see no way for me to know whether or not the Next or the Previous button is clicked within the stepper component itself. The On Next and On Previous event handlers are for triggering other scripts and cannot be referenced by the stepper component itself. I have thought of many ways to hack this functionality together but nothing has worked so far. Do you have any suggestions for how I can allow users to move backwards freely but when proceeding, make the validations in the script above?
Was this page helpful?