Lazy loading commands - delayed actions - async enabled

Hello OTEX community. We are thinking about the principle of delayed commands in context of enabled: method.

It is said that command can be enabled only synchronosly - see the "documentation" here - yourProject\lib\src\csui\utils\commands\commands.md.

So what is happening when you click "more" button and you see three dots working. We call this lazy actions and after a while some other commands are displayed.

I randomly checked what commands are they but it seems that the behaviour is not related to command model itself. Example. If I click "more" on a folder - download command will appear after three loading dots disappear. But the same command "download" is imidietly visible when i open the menu for a file. So this means that the definition of lazy action is not in the command itself.

Do you know how this behaviour works?

We wanted to use it to asynchronosly enabled commands but it seems that it is not possible this way.

Why async validation ? Well, you want for examle to check user groups, permission for a file and more info which is not available in "status" object.


Tagged: