Delay to dmx functions

Hi All,

There seems to be a delay to dmx functions, which is preventing certain behaviours/actions being implemented. For example, for conditional field (dmx-if), I am unable to chain them (i.e. have a conditional field be conditional on another object in a conditional field). Any way to get around this please? I need to have multiple conditional areas on my page.

It’s similar with class toggle as well. my javascript doesn’t detect the class being “activated” until the next action (i.e. doesn’t work when I run the javascript from the same object that has the class toggle, only if I trigger the javascript on the next object). I managed to get around it for my use case by activating it on the next object. However, the first issue I haven’t figured out a way to get around.

Any ideas? Is this normal behaviour for dmx functions?

UPDATE 1: I managed to figure out a workaround, by triggering an action to update a variable and linking the conditional region to that variable instead. However, this is a bit clunky and introduces more code. Would it be possible to make the dmx function update immediately in future Wappler releases?

It is normal behaviour for actions to be executed upon receiving a trigger. No trigger, no action.

Triggers include, on page load, on mouse click, on value changed etc.

The workaround you have identified is unfortunately the only option we have found since the newer app connect releases.
Earlier the app connect itself was a bit inefficient, which caused things to seem to work sequentially, even though it was never so.
With updates in the last year, app connect has become better in terms of efficiency, but we have experienced the same “timing issues” (as we call it) as you are seeing because of that.

There is always some workaround that we figure out, but the result is verbose extra code and even using JS at times.

The problem itself is not very common so not sure what the team can do here.

1 Like

Thanks @sid, this is exactly the problem I run into. Run into it multiple times, and I do seem to find a solution after a few hours of looking at it, but like you said I have to use verbose extra code or some custom JS to help with the behaviour I want. Additionally, it’s quite situational and it’s just more code to maintain and make sure it’s all running smoothly.