cancel
Showing results for 
Search instead for 
Did you mean: 

Tick checkbox dynamically

Former Member
0 Kudos

Hello all,

I am fetching data from ODATA service and showing it frontend page.I have 1 checkbox in front page.In table 1 field contains value of that checkbox.

for selected checkbox it contains X value.

now m fetching this field value with the odata service.

var url = "proxy/sap/opu/odata/SAP/Z_HR_USR_CREATION_SRV";

  var oModel = new sap.ui.model.odata.ODataModel(url,true);

  var form = this.getView().byId("SimpleForm1");

  form.setModel(oModel);

  form.bindElement("/ZhrUserSet('"+usr+"')");

This is the code to fetch value in frontend.its contains value for checkbox as well.now depending on that value how to show checkbox selected or deselected.

please help

Accepted Solutions (1)

Accepted Solutions (1)

santhu_gowdaz
Active Contributor
0 Kudos

use expression binding-

selected="{= ${checkbox} === 'X' }"

Expression Binding - User Interface Add-On for SAP NetWeaver - SAP Library

Former Member
0 Kudos

hi santhosh thanks for rpl

I tried it like this  selected="{= ${UPPL} === 'X' }" but its not working. UPPl is my ODATA property.

santhu_gowdaz
Active Contributor
0 Kudos

"UPPl " Typo "UPPL" ?? check it. it should work if you are getting that property data as X then it will selected.

Former Member
0 Kudos

Thank you very much sir.

Answers (0)