title: SAPUI5: ObjectAttribute Wrap Text
body: <p>I am attempting to display a wrapped long text in an ObjectAttribute in an SAP UI5 application:</p>
  
  <pre><code>&lt;List id="__listObjectAttributes" noDataText="Drop list items here" headerText="Shipping Information" items="{Shipments}"&gt;
      &lt;items&gt;
          &lt;ObjectListItem id="__listItemShipments" title="{ShipmentTxt}"&gt;
              &lt;attributes&gt;
                  &lt;ObjectAttribute id="__attributeShipmentId" title="Shipment #" text="{Id}"/&gt;
                  &lt;ObjectAttribute id="__attributeShipmentCode"   title="Shipment Code" text="{ShipCd}"/&gt;
                  &lt;ObjectAttribute id="__attributeShipmentLongText" title="Long Text" text="{LongText}" binding="{ShipmentLongText}"/&gt;
              &lt;/attributes&gt;
          &lt;/ObjectListItem&gt;
      &lt;/items&gt;
  &lt;/List&gt;
  </code></pre>
  
  <p>The problem is, when the list is displayed the text is truncated instead of wrapped.  <strong>I've been looking for ways to wrap the text in an ObjectAttribute</strong>, but to no avail. </p>
  
  <p>I have found articles that say both "you can do it" and "you can't do it".</p>
  
  <p>Possible:  <a href="https://archive.sap.com/discussions/thread/3589475" rel="nofollow noreferrer">https://archive.sap.com/discussions/thread/3589475</a></p>
  
  <p>Not possible:  <a href="https://experience.sap.com/fiori-design-web/object-list-item/" rel="nofollow noreferrer">https://experience.sap.com/fiori-design-web/object-list-item/</a></p>
  
  <p>If it is not possible to add this information to an ObjectAttribute, does anyone know a way to display the same information in a list that will accept wrapped text?</p>
  
  <h2>Solution</h2>
  
  <p>@Ran Hassid's answer was correct!  Using a CustomListItem in combination with a SimpleForm was the best solution.  Here is the code I ended up going with:</p>
  
  <pre><code>&lt;List id="__listObjectAttributes" noDataText="Drop list items here" headerText="Shipping Information" items="{Shipments}"&gt;
      &lt;items&gt;
          &lt;CustomListItem id="__listItemShipments"&gt;
              &lt;content&gt;
                  &lt;form:SimpleForm id="__formShipmentList" editable="true" layout="GridLayout" labelMinWidth="100"&gt;
                      &lt;form:content&gt;
                          &lt;!--Id--&gt;
                          &lt;Label id="__labelShipmentId" text="Id"/&gt;
                          &lt;Text id="__textShipmentId" text="{Id}"/&gt;
                          &lt;!--Shipment Code--&gt;
                          &lt;Label id="__labelShipmentCode" text="Shipment Code"/&gt;
                          &lt;Text id="__textShipmentCode" text="{ShipCd}"/&gt;
                          &lt;!--Long text--&gt;
                          &lt;Label id="__labelShipmentLongText" text="LongText"/&gt;
                          &lt;Text id="__textShipmentLongText" text="{Longtext}" binding="{ShipmentLongText}"/&gt;
                      &lt;/form:content&gt;
                  &lt;/form:SimpleForm&gt;
              &lt;/content&gt;
          &lt;/CustomListItem&gt;
      &lt;/items&gt;
  &lt;/List&gt;
  </code></pre>
  
  <p>Then I added the sap.ui.layout.form to the mvc:View to simplify the code:</p>
  
  <pre><code>&lt;mvc:View xmlns="sap.m" xmlns:mvc="sap.ui.core.mvc" xmlns:semantic="sap.m.semantic" xmlns:form="sap.ui.layout.form" controllerName="shipments.controller.ShipmentDetail"&gt;
  </code></pre>