Checkbox select function not invoking check/uncheck events

Wappler Version : 6.8.0
Operating System : W11
Server Model: NodeJS

Not sure if this is an AC2 bug or just a general bug.
In action picker, there is a function called "select" for checkbox input elements.
Using this, when I check/uncheck the input from a button click, the checked/unchecked events which are defined on the input elements do not fire.

Code on button: dmx-on:click="chkShare.select(!chkShare.checked)"

hey Siddhant,

I think this is related to this thread:
Hidden input value updated from JS, not updating in dynamic binding in AC2 - #7 by patrick

The select function is a Wappler function, not custom JS.

This code (exactly like your code) works and triggers the chacked/unchecked action you describe...

<div class="d-flex w-100 px-2 justify-content-between align-items-center">
                <div class="form-group mb-3">
                    <legend class="col-sm-2 col-form-label">One checkbox</legend>
                    <div class="form-check lh-base">
                        <input class="form-check-input" type="checkbox" value="" id="input3" name="input3">
                        <label class="form-check-label" for="input3">Single checkbox</label>
                    </div>
                </div>
                <button id="btn1" class="btn btn-info" dmx-on:click="input3.select(!input3.checked)">Button</button>
            </div>

On each click of the button the checkbox is toggled (checked/unchecked)
(not the value... just the checkd attribute)

Maybe there's something else you need to check @sid...

1 Like

You don't have the checked/unchecked dynamic events configured. Checking/unchecking of checkbox works fine, events are not getting fired, which is the problem.

You are correct buddy...

No other dynamic event is triggering on button click except the updated event (that triggers twice)

Bump.

Having this issue as well. Causing a huge headache for me and I had to do some lengthly workaround in the meantime

Bump. @patrick

I checked the logs and the behavior changed a while back after some discussion about when the events should trigger. We updated it to only trigger when it was from a user interaction like we also do for the change(d) event. The updated event will always trigger after any change.

The question now is probably if a method call is a user interaction or not. In html inputs do not trigger the change even when value was changed programmatically, that would include a method call.

Related topic where the checked/uncheched event triggered on each update causing issues:

1 Like

For the Wappler's select function, I would suggest to add a boolean param (default false) to bubble/trigger events.
For dynamic binding purpose, the current setup does sound ok - every binding change should not invoke the dynamic events.
But having the option to invoke them on-demand seems necessary.

1 Like

I've added an extra argument to the select function for the checkbox and radio components. Passing true as second argument will trigger the changed, checked / unchecked events.

dmxAppConnect.zip (121.3 KB)