Switches not allow dynamic value based on his own state - App Connect 2

Wappler 6 Beta 12 | Windows | Nodejs | Beta Channel

Hi,
I don’t know if it about optimizations by the new App Connect 2, but in App Connect 1 this was possible:

<div dmx-repeat:repeat1="5">
    <div class="row">
      <div class="form-check form-switch">
        <input dmx-bind:id="'inpt_'+$index" dmx-bind:name="'inpt_'+$index" class="form-check-input" type="checkbox" role="switch" id="flexSwitchCheckDefault" value="1" dmx-bind:value="checked?1:0">
        <label class="form-check-label" for="flexSwitchCheckDefault">Default switch checkbox input</label>
      </div>
      <input id="text1" name="text1" type="text" class="form-control" dmx-bind:value="flexSwitchCheckDefault.value">
    </div>
    <div class="container" dmx-show="flexSwitchCheckDefault.checked">
      <div class="row">
        <div class="col text-center">
          <img src="/assets/images/avatar-1.jpg">
        </div>
      </div>
    </div>
  </div>

This behaviour only occur inside a repeat:
Inside a repeat with switch options, the switch declare it value based on if checked or not, so, checked?1:0
If I add log(checked?1:0) in browser console it start normally with 0, but after click in the switch it change to 1 and then back to 0 inmediately and in the UI the switch remain in initial position, not change because the condition after click inmediately back to initial state.
After the first click the switch back to works normally change it value to 1 and 0 as expected.

0
1
0

In App Connect 1 this works normally. Start with 0 and after click change to 1, switch again and back to 0. Normal behaviour.

By this reason I had to change the way in how I used the switches, now looks like its better to call the switch directly by his property checked in the Dynamic Event. The 0 is not any more an option for conditions.

I think your logic on how switches work is flawed.

See this post for explanation on how to do it correctly

Hi Brian, thanks for answer, however, that’s not the point of all this. I’m not saying that I use switches to use it in a form to update data in a database.
Im using switches as conditional region, if user toogle switch to “1” content show up, if 0 it stay hidden, that’s how works in App Connect 1 using dynamic value inside the switch with checked?1:0.

Currently is not possile to use dynamic value based on attribute of checked inside the switches inside a repeat.
Outside a repeated the checked?1:0 works normally.

For this reason I had to do this:

So, in App Connect 1 it works but App Connect 2 not, and I would like to know if this is a bug or not and if checked?!:0 will be back to works as before or new App Connect 2 won’t allow to do that.

So you are using a switch as a toggler
Have you viewed this thread which may help