When working with big forms, I need to split them into several Blocks. In the mobile screen containing those Blocks, how can I trigger the validation actions of each Block?
To trigger a Block action in a mobile screen, you need to:
- Create a top Container in the Block. This will allow you to access the Block as the parent element of the Container. In this example, the name of the top Container is Root;
var wbElement = document.getElementById($parameters.rootId).parentElement;
wbElement.validatePhone = $actions.ValidatePhoneNumber;
var wbElement = document.getElementById($parameters.BlockId);
You can only select a block "Id" runtime property in the Expression Editor if you have given the block a name. In the example above, the source block name is "PhoneNumber", but after dragging it into the consumer screen (creating a block instance) it was named "PhoneNumberBlock" in the properties editor.