Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3116

Re: Text wrap in ObjectAttribute in ObjectListItem in sap ui5

$
0
0

Hi Lindsay,

 

Text wrapping for ObjectAttribute in ObjectListItem was supported till 1.24 version and that too for maxLines:2. For current version it supports maxLines:1 if you place it in a Object List Item.

See this example which uses 1.24: JS Bin - Collaborative JavaScript Debugging . As you can see it shows only 2 lines and after that the text is not wrapped.

 

For Object attributes, the text characters should not be more. But still if there is a hard requirement to display more characters in the object attribute, then we have to check a work around for it.


Yes, indeed there is a work around for this.

See this sample: JS Bin - Collaborative JavaScript Debugging

Code that will increase the max lines of Object Attribute -

list.addEventDelegate({
onAfterRendering: function(oEvent) {
//Get the ObjectAttributes placed in the list  var oObjectAttributes = $('#oList').find('.sapMObjectAttributeDiv');  $.each(oObjectAttributes, function(index, item) {    var oObjectAttributeID = sap.ui.getCore().byId(oObjectAttributes[index].id);
//Set the Max Lines value depending on your requirement    oObjectAttributeID.getAggregation("_textControl").setProperty("maxLines", 10);   });  }
}, list);

Regards,

Sai Vellanki.


Viewing all articles
Browse latest Browse all 3116

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>