Have following data passed from backend:
ALL_CONFIGS: {callDigitalIo=true, controllerId=1, numberPlatesHashSalt=..., numberPlatesShouldBeHashed=false, parkingStatusShouldBeChecked=true}
Where boolean params should be displayed like input
element with type=checkbox
.
Here is how I handle it on UI page (.ftl
):
<div>
<label class="col-form-label">
Parking Status Should Be Checked:
<input type="checkbox" class="form-check-input ml-2"
id="parkingStatusShouldBeChecked" name="parkingStatusShouldBeChecked"
<#if parkingStatusShouldBeChecked??>checked="checked"</#if>
/>
</label>
</div>
However, checkboxes are all selected:
Number Plates Should be Hashed
should not be selected.
How to select only true
variables?
question from:
https://stackoverflow.com/questions/65906345/freemarker-how-to-select-checkboxes-on-ui-send-by-backend 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…