A2v10 Platform documentation
UK


BindCmd Binding

Represents a special object that describes a command that will be executed in response to some user action (for example, pressing an on-screen button). Almost always specified as a markup extensions.

Note that an object has quite a lot of properties, but many of them are only used for a specific command.

Properties

Name Type Description
Command Command By default. The command being executed. Possible commands are described below.
Argument Object Command argument. Almost always binding (Bind).
Data Object Additional data for the command. Almost always binding (Bind).
Url String URL for external command.
CommandName String Only for the Execute command. Command name in template (template.commands).
SaveRequired Boolean Save the model before executing the command.
ValidRequired Boolean The command requires the model to be in a valid state.
Confirm Confirm Ask the user for confirmation before executing the command.
NewWindow Boolean Open in a new window.
UpdateAfter Object Always binding. An object or array to update after performing any actions.
ReloadAfter Boolean Refresh the model after executing the command.
Export Boolean Whether to export instead of display. Not compatible with Print.
Print Boolean Whether to print instead of display.
FileAction Enum Action for the File command.
Action Enum Action for the Dialog command.

Commands

Open - open the form

Navigates to the specified URL with the specified argument.

Arguments:

  • Url - The path to the form. Required.
  • Argument - Command argument. Required.
  • NewWindow - Open in a new window.
  • UpdateAfter - Binding to an element that will probably be updated when performing any actions. It only makes sense if the form is opened in a new window.
Clear - clear

Clears the argument object.

Arguments:

  • Argument - Binding to an array or an object to be cleared. In fact, the command just calls the $empty method of the associated object or array.

Note that the control associated with this command will not be displayed if the object or array is already empty. Additional binding of the If property is not required.

Close - close

Closes the current form or dialog. The command has no arguments.

CloseOk - close

For dialogues only. Closes the current dialog with the answer true. The command has no arguments.

Reload, Refresh - refresh

Updates the current model or its part. If an argument is set, then only the part of the model is updated. Updating part of the model is used for "lazy arrays".

Arguments:

  • Argument - Binding to the array to update. Not required.
Requery - refresh

Reloads the entire form from the server (including reloading the markup). The command has no arguments.

Print - print

Prints the current page. The command has no arguments. Note that the current page image is actually printed. Some elements (for example Taskpad) are not printed. You can use the Print property of the UIElement object to further control the visibility of elements when printing.

Dialog - dialog

Displays the dialog and performs the specified action.

Arguments:

  • Action - action. Possible values:
    • Edit - edit the item specified by the argument. After the dialog is closed, the item will be updated.
    • EditSelected - edit the selected collection item. The collection is specified by the command argument. After the dialog is closed, the selected item will be refreshed.
    • Show - display the item set by the argument.
    • ShowSelected - show the selected item of the collection. The collection is specified by the command argument.
    • Browse - select the item given by the argument. The item is replaced with the one selected in the dialog.
    • Append - create a new item and add it to the collection. The collection is specified by an argument.
    • New - create a new item.
    • Copy - create a copy of the given item. The item is specified by an argument.
  • Argument - Binding to an item or collection.
  • Data - Additional data for calling the dialog. They will be parameters of the procedure for loading the dialog model.
  • URL - URL to the dialog from the dialogs section of the model.json description file.
  • SaveRequired, ValidRequired, ReloadAfter - additional command conditions.
File - working with files (binary objects, blobs)

Displays, downloads, or prints an attachment (blob). It can be a card, a file, etc. Learn more about working with binary objects.

Arguments:

  • FileAction - action with the file. Possible values:
    • Show - display data on the page.
    • Download - load data as a file.
    • Print - print file data.
  • Argument - Binding to a property that will set the ID of the blob.
  • URL - The URL to the action from the files section of the model.json file.
Download - download

Allows the user to upload a static file. Static files associated with the application must be placed in a special folder called _files.

Arguments:

  • Url - path to the static file. The path is specified relative to the _files.