Skip to content

Button: click, submit and reset behavior

Reference · Advanced · App Connect

Choose whether a button runs a page action, submits a form or resets controls.

Choose whether a button runs a page action, submits a form or resets controls.

  • An App Connect page; a named form when the values will be submitted.

A page-action button, a submit button and a reset button have different effects even when styled identically.

ID identifies the button for bindings and actions. In the App Connect runtime the default type is button.

Control or value Meaning and use
buttonUse with a Click Dynamic Event, for example products → Load. It does not submit the enclosing form by itself.
submitSubmits the enclosing form through its normal submit/validation behavior. Avoid also calling Submit from its Click event, which can create duplicate attempts.
resetRestores the enclosing form’s initial control values. It does not remove a database record or roll back the last request.

Form-control data is directly under its component name, for example titleInput.value. It is not titleInput.data.value.

Control or value Meaning and use
Set ValueChanges the current control value. A later change to its bound Value can replace it and also change the form-reset default. Set Value emits Updated when the value changes; it does not simulate a user Changed event.
DisablePass true to disable and false to enable. Disabled controls are omitted from normal form submission. Read Only, where the input type supports it, prevents editing while leaving the value eligible for submission.
FocusMoves keyboard focus to the control. Give the field a visible label and a useful place in the form’s focus order.
ValidateInvokes the App Connect validation helper. Load the validation extension for this action; client validation does not replace the endpoint’s validation.
value / disabled / focusedCurrent value and UI state. Text-based controls expose strings, including most number-input reads. Convert intentionally before arithmetic.
invalid / validationMessageClient validation state/message. Render a useful field error when invalid, and handle server field errors on the form too.
Changed / UpdatedChanged accompanies user input/change handling when the value changes. Updated also accompanies programmatic value updates. Do not make an Updated handler unconditionally write a different value back into the same field.

The inherited Set Value action changes the button’s value property, not its visible text content. Edit the button text or bind its text for a changing caption. Focus and Disable can help guide a user through a request; Validate is inherited and normally belongs on the relevant input/form.

Example: prevent repeated form submissions

Section titled “Example: prevent repeated form submissions”

Put a button of Type submit inside saveForm. Bind Disabled to saveForm.state.executing and give it the caption Save. Check that it disables during the request and enables when the attempt ends. Show a success message from the form’s Success event, not from the button’s Click event.

Use the related workflow to connect these controls to data and a verified submit result.

You can configure the control, use its actual value shape and verify the example without confusing page state with a submitted or saved value.