Wappler 6.8.0 | NodeJS | Docker
Looks like my quest with radio button group continues Radio selection bug
Description: I have a form, inside this form there is a form repeat which holds Radio Group with several values. Radio Group set to hold value received from Server Connect Action.
Issue: Radio Group value holds value for each repeat radio group, but visually selected only last repeat group.
Bug itself:
Data that is received from ServerConnect:
Page code:
<dmx-serverconnect id="serverconnect1" url="/api/getUsersCars"></dmx-serverconnect>
<div class="container">
<div class="row">
<div class="col">
<form id="formUsersCars">
<div is="dmx-form-repeat" id="formRepeat" dmx-bind:items="serverconnect1.data.query">
<div class="form-group mb-3" id="input1_group" is="dmx-radio-group" dmx-bind:value="selectedCarID">
<legend class="col-sm-2 col-form-label">{{first_name}}</legend>
<legend class="col-sm-2 col-form-label">Radio group value: {{value}}</legend>
<div class="form-check">
<input class="form-check-input" type="radio" value="1" id="input1_1" name="input1">
<label class="form-check-label" for="input1_1">Hombre Space</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" value="2" id="input1_2" name="input1">
<label class="form-check-label" for="input1_2">Terraza</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" value="3" id="input1_3" name="input1">
<label class="form-check-label" for="input1_3">Miata MX-5</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" value="4" id="input1_4" name="input2">
<label class="form-check-label" for="input1_4">Escort</label>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
Also tried to add {{index}} for names and id - didn't helped:
<dmx-serverconnect id="serverconnect1" url="/api/getUsersCars"></dmx-serverconnect>
<div class="container">
<div class="row">
<div class="col">
<form id="formUsersCars">
<div is="dmx-form-repeat" id="formRepeat" dmx-bind:items="serverconnect1.data.query">
<div class="form-group mb-3" id="input1_group" is="dmx-radio-group" dmx-bind:value="selectedCarID" dmx-bind:id="input1_group{{$index}}">
<legend class="col-sm-2 col-form-label">{{first_name}}</legend>
<legend class="col-sm-2 col-form-label">Radio group value: {{value}}</legend>
<div class="form-check">
<input class="form-check-input" type="radio" value="1" id="input1_1" name="input1" dmx-bind:id="input1_1{{$index}}" dmx-bind:name="input1_group{{$index}}">
<label class="form-check-label" for="input1_1">Hombre Space</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" value="2" id="input1_2" name="input1" dmx-bind:id="input1_1{{$index}}" dmx-bind:name="input1_group{{$index}}">
<label class="form-check-label" for="input1_2">Terraza</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" value="3" id="input1_3" name="input1" dmx-bind:id="input1_1{{$index}}" dmx-bind:name="input1_group{{$index}}">
<label class="form-check-label" for="input1_3">Miata MX-5</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" value="4" id="input1_4" name="input1" dmx-bind:id="input1_1{{$index}}" dmx-bind:name="input1_group{{$index}}">
<label class="form-check-label" for="input1_4">Escort</label>
</div>
</div>
</div>
</form>
</div>
</div>
</div>