Rock Mobile Docs

Please login to access all of the features of the Community Site.

Callback

Mobile1.0

Some blocks, currently just the Content block, support what is called Callbacks. You can learn more about these in the Advanced: Dynamic Content and the Developer chapters. But, for our purposes here, you can think of these as an API call back to the server's logic for the block.

If the CommandParameter is a plain string, then it is used as the name of the callback function to be queried on the server. If you need to pass any parameters to that function then CommandParameter should point to an instance of the CallbackParameters object.

Note

A callback runs a block action on the Content block, so the person must be able to view both the page and the block. If they can't, the block's content is replaced with an error message.

Properties

PropertyTypeDescription
NamestringThe name of the callback to be called on the server. (Required Field)
ParametersList<Parameter>Any parameters that will be passed to the callback function.
ValidatorValidatorOptional reference to a validator that will be executed before sending the command to the block. If the validator fails then the command is not sent.

Examples

<Button Text="Tap"
    Command="{Binding Callback}"
    CommandParameter="CallbackName" />
<Button Text="Tap"
    Command="{Binding Callback}">
    <Button.CommandParameter>
        <Rock:CallbackParameters Name="CallbackName">
            <Rock:Parameter Name="GroupId"
                Value="18" />
        </Rock:CallbackParameters>
    </Button.CommandParameter>
</Button>

See Content for the block that handles these callbacks.