Skip to Content
avatar image
Former Member

How to bindProperty to a checkbox

I am executing the following code:

new sap.ui.commons.form.FormElement({

                      label: new sap.ui.commons.Label({

                          text: oBundle.getText(

                              "UI_SERVICE_MODEL_ID"),

                          layoutData: new sap.ui.commons.form.GridElementData({

                              hCells: "5"

                          })

                      }),

                      fields: [new sap.ui.commons.CheckBox().bindProperty("checked", "/validation"),]

                  }),

but the property binding is not working. It is unchecked always.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Oct 30, 2015 at 08:04 AM

    Hi Archana,

    Are you doing aggregation binding for form?

    If so try like this -


    fields: [new sap.ui.commons.CheckBox().bindProperty("checked", "validation")

    Regards,

    Sai Vellanki.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Sai Vellanki

      Hi Sai,

      That was the problem. Somehow the values were not set in the model and hence it was not binding.

      It is working fine now.

      Thanks,

      Archana

  • Oct 30, 2015 at 08:02 AM
    Add comment
    10|10000 characters needed characters exceeded