Variable dynamic event on:update not working

Wappler Version : 2.4.3
Operating System : Mac OSX Mojave v10.14.5

I have a variable on my page var1 whose value is set by five buttons. As I click on each button, the variable gets values 1, 2, 3, 4, 5 and gets nicely displayed in the paragraph.

Now, as you can see in the below screenshot, I also have a dynamic event on the variable, so every-time I click any of the buttons and value changes, I should also get an alert on my browser.

This event is not triggering and seems to be broken. I’m not sure if I’m doing anything wrong here, but looks like a bug to me.

Yes I think this is bug and I have same problem

1 Like

@Teodor @patrick, until this bug is fixed, are you able to advise of any workaround (code-level) to get variable value_on_update event to work…

I have a couple of these on my site and nothing is working… really need to get over this to make any progress… Thanks in advance.

Seems that the variable component doesn’t have an updated event, will add it. As a workaround you could use a hidden input field.

Here is the update with the updated event added to the variable component, you may already test it out.

dmxAppConnect.zip (17.0 KB)

1 Like

Hi @patrick, unfortunately, with the updated app connect js you provided, on-update event is getting triggered only once when the variable is first time initialised, further updates to the variable’s value doesn’t trigger the on-update event.

Meanwhile, I’m struggling to use the workaround method of updating a hidden input field (from my javascript) to in-turn update a variable with a JSON value (instead of a single text value), I added the details in my previous reply (above). Please help me out with this, irrespective of this on-update bug getting fixed.

variable_value_updated_1.php.zip (1.3 KB)

Here is a new update, now it should also trigger the updated event when new value is set.

dmxAppConnect.zip (17.0 KB)

@Akayy
Could you please post different questions in separate topics. Mixing different topics in a same thread makes it difficult for us to track what the issue/question is.

2 posts were merged into an existing topic: Setting a hidden field value with JSON from Javascript and use update event

Just did, thanks!

1 Like

Fixed in Wappler 2.4.5

1 Like

Works like a charm, thank you to both you and Patrick. Cheers!

This topic was automatically closed after 2 days. New replies are no longer allowed.