cancel
Showing results for 
Search instead for 
Did you mean: 

White spaces truncated while displaying data in sap.m.StandardListItem

Hi SAPUi5 experts,

I am facing one issue while displaying the data in StandardListItem which is bounded in a SelectDialog.

I am getting below data as output of odata read call which is correct (including white spaces in ZzPuom value).

I have set this data into a json model and bounded that to a SelectDialog. But the data is getting displayed with truncating multiple spaces into one.

However, i tried binding the same data to a sap.ui.Table and there i got data displayed including spaces.

Kindly help with your views to get the correct binding in List as well.

Thank you in advance.

Accepted Solutions (1)

Accepted Solutions (1)

mariusobert
Developer Advocate
Developer Advocate

Hi Happy,

this is related to the CSS definition of the control/aggregation. You can fix your issue by adding a custom css class to the listitem template and override the property:

    white-space: pre;

Regards,

Marius

0 Kudos

Hi Marius,

Thank you so much for your comment. It worked. 🙂

Best Regards,

Happy Chhillar

Answers (1)

Answers (1)

jorge_cabanas
Participant
0 Kudos

Hi,

I checked it in SAPUI5 SDK but SelectDialog and sap.ui.Table seem have the same behaviour with blank spaces in my case 😞

Could you provide the binding code? The xml view? I don't know.. something else

Kind regards,
Jorge.

0 Kudos

Hi Jorge,

I debugged it further and found that if i am using Input control in sap.ui.Table then it is working fine. But if i am replacing Input control with a Text control then again white spaces is getting truncated. So, seems like it is working fine only with Input control.

Please find below the SelectDialog and binding code below:

SelectDialog code:

Binding Code: