Hi, How can I have a submit button at the last page of my dynamic form? I am using local!page to determine the page. Currently, the buttons are a!buttonWidget and saves into my local variable. However, on the last page, I'd like a submit button that submits the from. Please take a look at my code and see what you think.
load( local!page: 1, a!formLayout( label: "Formname", contents: { choose( local!page, rule!CHR_SC_EmployeeDetails( lead: ri!employee ), rule!CHR_SC_EmployeeJobDetails( lead: ri!jobInfo ), rule!CHR_SC_NewEmplyeeDone( lead: "" ) ) }, buttons: a!buttonLayout( primaryButtons: { a!buttonWidget( label: "Back", value: local!page - 1, saveInto: local!page, style: "NORMAL" ), a!buttonWidget( label: "Next", cancelbuttonlabel: "BACK", value: local!page + 1, saveInto: local!page, style: "PRIMARY" ) } ) ) )
Discussion posts and replies are publicly visible
For simplicity's sake I'd encourage you to use separate button components for "Next" and "Submit" buttons in your use case. Abbreviated, it would be something like this:
a!buttonWidget( label: "Next", ... showWhen: not(local!isOnLastPage) ), a!buttonWidget( label: "Submit", ... showWhen: local!isOnLastPage )