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.