Html checkbox data binding

Hello support …

We have tried to build a html template including a checkbox control , we also tried to add an inline expression in html via XML data source binding to control checkbox checked or unchecked outlooks …

HTML sample code will be:

<input name="FD1012" type="checkbox" checked="{{chk02}}" disabled="disabled"/>

XML data source:

<Data>
  <chk02>checked</chk02>
</Data>

It will be OK for checkbox to set checked …

We also try to change XML as:

<Data>
  <chk02></chk02>
</Data>

It still displays checkbox with checked and does not display checkbox with unchecked …

Based on above testing results , I need your help to suggest a good way for us to add an inline expression for checkbox ( checked and unchecked ) via databinding …

thanks !!

Mason Pai 10-24-2022

Hello …

I would like to upload html & xml for your reference

Mason Pai 10-24-2022html and xml 1024.zip (337 Bytes)

@masonpai0212

An investigation ticket as HTMLNET-4081 has been logged in our issue tracking system to check the feasibility of your requirements. We will look into details of the ticket and let you know as soon as the ticket is resolved. Please be patient and spare us some time.

We are sorry for the inconvenience.

@masonpai0212

We will add in version 22.11.0 the ability to add an inline expression for checkbox ( checked and unchecked ) via databinding.

@masonpai0212

To set the “Input” element to the checked state, you need to add the “checked” attribute.
This can be done by adding an attribute to the template without assigning values to it, for example:

var htmlCode = "<input name=\"FD1012\" type=\"checkbox\" {{chkAttr}} disabled=\"disabled\"/>";

This functionality will be available from version 22.11, in version 22.10 this example will not work.

Then set the attribute to checked state:

var dataSource = "<Data>\n  <chkAttr>checked</chkAttr>\n</Data>";

To unckecked the “Input” element, you must remove the “checked” attribute.
This can be done with the help of such data:

var dataSource = "<Data>\n  <chkAttr></chkAttr>\n</Data>";

Hello …

How can I download version 22.11 ?

thanks !!

Mason Pai 11-11-2022

@masonpai0212

Its not been yet released. Once this version is published, you will receive a notification in this forum thread.

The issues you have found earlier (filed as HTMLNET-4081) have been fixed in this update. This message was posted using Bugs notification tool by avpavlysh