Tuesday, May 31, 2016

Long text in ADF output text component

When longer texts are displayed in a column of ADF table, it is not entirely visible. One has to stretch the column width or hover over the cell to view the entire text.



This can be avoided in two ways:

1. Convert the outputText component to inputText and make the read only property as true.
    Set the 'rows' property of inputText to more than 1 (depending on the text you have)
    If we have set the rows to 3 and text is much longer, scroll bar would appear.
                           
                         

2. By setting inline style for the outputText, we can achieve the desired.
  
     inlineStyle="white-space: pre-wrap; word-wrap:break-word; display:inline-block;"
     noWrap="true"
     styleClass="AFStretchWidth"

                      

    Either of the methods avoid text wrap issues in ADF tables.