Let's follow up this discussion at the Neptune Community

(this forum will be kept in read-only mode)

Checkbox, swithces with boolean value

Hi Folks

I am currently upgrading an old bsp form to sapui5.
I have a number of boolean fields on the table but the checkbox accepts true and false. is there a way to convert true and false to X or '' and vice versa. I had a look at the formatter but it doesn't seem to be getting fired.
I can't see where this is being attached in chrome in the sources section.
var inMainFormCA_LAPTOP = new sap.m.CheckBox("inMainFormCA_LAPTOP",{activeHandling:true,editable:true,enabled:true,selected:"{/CA_LAPTOP}",text:"Laptop",textDirection:"LTR",visible:true});

The underlying table for the form cannot be changed.



Hi Darren

Usage of the Data Type DDBOOL_D in your table will automatically convert x/space to true/false. If it is possible to change the Data Type in your table it will save you some time.

If not you need to declare a new internal table using DDBOOL_D and move data from your table into the new internal table. Recommended solution, since you then have a different UI table vs DB table.


Ole Andre 

1 person likes this

Excellent, thank you Ole Andre, this works perfectly

Login or Signup to post a comment