Aktionen bei Jobstatus

Auf dem Formular reagieren, wenn sein Job abgesendet wird, erfolgreich ist, fehlschlägt oder endet


Start a GUI action, triggered by a job status. Such as clear, hide, show, …

Folgende Hooks stehen zur Verfügung:

  • onSubmit: wird ausgelöst, wenn das Formular abgesendet wird
  • onSuccess: wird ausgelöst, wenn der Job erfolgreich abgeschlossen wird
  • onFailure: wird ausgelöst, wenn der Job fehlschlägt
  • onFinish: wird ausgelöst, wenn der Job endet, unabhängig von seinem Status
  • onAbort: wird ausgelöst, wenn der Job abgebrochen wird

Attribute

Die Attribute einer Aktion bei Jobstatus:

Attribut Kommentare
clear
number

Clear the form
integer >= 0

This action clears the form after x seconds.

hide
number

Hide the form
integer >= 0

This action hides the form after x seconds.

show
number

Show the form
integer >= 0

This action shows the form after x seconds.

home
number

Go to Home
integer >= 0

This action navigates to the home page

reload
number

Reload form
integer >= 0

This action reloads the form (and cleans the job output)

load
string

Load a form
number_of_seconds,name_of_form

This action allows you to load another form.

new in v4.0.20: the previous jobid is sent as __previous_jobid__.
You must make sure you have this field in your form, it will be populated with the previous jobid.

This is particularly interesting to grab information from the previous job (for example, load output, …)


Beispiele

Beispiele für Aktionen bei Jobstatus, in YAML:

1) Clear and hide on submit

Die Definition, in YAML:

onSubmit:
  - clear: 0   # clear form after submit
  - hide: 2    # 2 seconds later, hide the form        

2) Go home on submit

Die Definition, in YAML:

onSubmit:
  - home: 0 

3) Load another form on success

Die Definition, in YAML:

onSuccess:
  - load: 2,Another form   # load another form after success

4) Hide, Show and Home

Die Definition, in YAML:

onSubmit:
  - hide: 0  # hide on submit
onFailure: 
  - show: 0  # show if failed
onSuccess:
  - home: 0  # go home if success