go-back

This action is used to return to the previous page. Most jigs include this action automatically as an arrow to the left of the title of the jig. This action can be used in a list of actions, such as swipeable and rightElement, or used together with another action, where go-back is called after the main action and returns the user to the previous page.

Configuration options

A go-back action can be set up in various ways:

  1. As a separate action or in the action list

  2. As a swipeable action in the left or right direction

  3. As rightElement in the list

  4. As an associated action in the action list

A go-back action associated with another action under onSuccess can only be used with dynamic data.

Examples and code snippets

go-back as an action

go-back as an action
go-back as an action

The simplest example of a go-back action is to use it as a separate action. When configured, a button will appear at the bottom which will return us to the previous page when pressed. In this case, the use of the function is unnecessary because as we can see in the screenshot there is an arrow to the left in the upper left corner. This means that this jig already has a go-back action automatically in it and the arrow has the same function as the "Go back" button below.

Examples:

See the full example using static data in GitHub. See the full example using dynamic data in GitHub.

go-back-action.jigx
actions:
  - children:
      - type: action.go-back
        options:
          title: Go back

go-back swipeable left/right

swipeable go-back
swipeable go-back

This example uses the go-back action as a swipeable property. We can choose the swipe direction left or right. After pressing the button, we return to the previous page.

Examples left: See the full example using static data in GitHub. See the full example using dynamic data in GitHub.

Examples right: See the full example using static data in GitHub. See the full example using dynamic data in GitHub.

swipeable:
    left:
        - label: Go back
          color: primary
          onPress:
            type: action.go-back
            

go-back rightElement

rightElement go-back
rightElement go-back

In this example, we use the go-back action as the rightElement in the list-item component. There is a button for each item.

Examples: See the full example using static data in GitHub. See the full example using dynamic data in GitHub

goback-right-element
rightElement: 
      element: button
      title: Go back
      onPress:
        type: action.go-back

go-back-on-success

In this example, we use the action.go-back with onSuccess to take you back to the main list after signing a form.

Examples: See the full example using static data in GitHub.

go-back onSuccess
go-back onSuccess
go-back-on-success
title: Signature
type: jig.default
description: In this example, the go-to action is associated with the
  submit-form action. After we enter the signature and press the "Sign" button,
  the submit-form action is performed and then the go-to action redirects us to
  the next page.
  
onRefresh: 
  type: action.reset-state
  options:
    state: [email protected]

onFocus: 
  type: action.reset-state
  options:
    state: [email protected]
    
actions:
  - children:
       - type: action.execute-entity
         options:
           title: Sign & go back to Actions
           provider: DATA_PROVIDER_DYNAMIC
           entity: default/form
           method: create
           data:
             signature: [email protected]
           onSuccess: 
             type: action.go-back
   
children:
  - instanceId: send-signature-go-to
    type: component.form
    options:
      isDiscardChangesAlertEnabled: false
      children:
        - instanceId: signature
          type: component.signature-field
          options:
            label: Signature required         

Last updated

Was this helpful?