Problem with conditional dynamic event

Wappler Version : 2.2.7
Operating System : Windows 10

Expected behavior

What do you think should happen?

Using conditional dynamic events should be possible whether or not there are multiple actions for each event.

Actual behavior

What actually happens?

If there is more than one action in the default event, nothing happens and a “Parse Error” appears in the developer console.

How to reproduce

If I click a button, I might want different things to happen depending on some condition. I can do something like this:
dmx-on:click="theCondition? defaultAction() : alternativeAction()"
and it works fine.

Frequently, there would be more than a single action. This works for the alternative action (as in this example), eg:
dmx-on:click="theCondition? defaultAction() : alternativeAction1() ; alternativeAction2() ; "

However if I use more than one action in the default event, an error occurs. Eg:
dmx-on:click="theCondition? defaultAction1() ; defaultAction2() : alternativeAction() "

It may be a syntax issue but I’ve tried putting brackets round various parts of the code but I can’t get it to work.

Community Page
Last updated: