Monday, 25 July 2016

XPages Tip: XPages Extlib DataView Control sets “display:none;” style when Extra Column has Empty Value

Last week I came across an very annoying problem with the DataView from the OpenNTF XPages Extension Library. In a new XPages Application the DataView from the XPages Extension Library (Release 16) is used to display the data. The DataView contains a Summary Column, a Category Column and some Extra Columns. In the DataView some of the Extra Columns have no default values and are, if no values are entered in these fields, 'empty' Columns. The XPages Application uses Bootstrap 3 as Application Theme.



The problem with the empty Extra Columns in the DataView from the OpenNTF XPages Extension Library is that these Columns are rendered with the style="display:none;". This also means that the values of the remaining Columns shift in the DataView.



Below an example of the DataView from the XPages Extension Library in case
one or two Extra Columns are included with an 'empty' value. The values of the remaining Extra Columns shift in the DataView.



There are some 'solutions' available for instance by adding a Custom Converter to the Extra Columns and replace the empty value by a space. My preference goes out to a CSS solution which needs to be implemented only once in the XPages Application by adding the following line in a styleSheet (custom.css):

.table > tbody > tr > td   {
display: table-cell !important;
}

The final result is that the empty Extra Columns are displayed in the DataView and the
Extra Columns not shift anymore.



Perhaps this can be solved in a future release of the XPages Extension Library.

1 comment:

  1. Hi Johny, Thanx for pasting this. I have found this problem today as well :-)

    ReplyDelete