Saturday 10 December 2011

Highlight alternate rows in WebSphere portlet factory (WPF)

Often, there is a need to highlight alternate rows when displaying the data using page automation builders like data page builder. Highlighting alternate rows also provide better visual presentation for your page and increases readability of the data table.

IBM WebSphere portlet factory provides a very simple technique to add attributes to alternate rows in data table.


You can build this functionality into an HTML template. On any XML node for which an alternating attribute is desired, simply prefix the attribute name with sequence_ (with the underscore) and list the different values for the attribute in a comma-separated list.

For example, in a

tag, to alternate between the HTML class names OddRow and EvenRow, add the following: 

< tr sequence_class="OddRow,EvenRow">
.........

</tr>

This would highlight the alternate rows in the data table. Similarly we, can add any attribute for alternate rows in a data table using page automation builders.