mardi 26 janvier 2021

Freemarker how to display selected checkbox on UI page

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 aren't selected:

enter image description here

Despite the fact that at Preview mode it is exactly selected!

Couldn't understand what is missed there?

How to solve this issue?




Aucun commentaire:

Enregistrer un commentaire