myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Palaszewski (JIRA)" <>
Subject [jira] Created: (TOMAHAWK-913) Layout of DataTable with groups + alternating rowStyles looks really bad
Date Wed, 28 Feb 2007 17:55:57 GMT
Layout of DataTable with groups + alternating rowStyles looks really bad

                 Key: TOMAHAWK-913
             Project: MyFaces Tomahawk
          Issue Type: Improvement
          Components: Extended Datatable
    Affects Versions: 1.1.3, 1.1.5-SNAPSHOT
            Reporter: Paul Palaszewski
            Priority: Minor


I'm using Extended Data Tables and wanted to use the column's groupBy. Now all normal tables
of this project have rowStyles with alternating row-background-colors, so I tried to apply
them also on the grouped data. It looks really bad, since the generated row-span messes up
the layout.

The rowGroupStyle does not help - it's only useable as group separator style, therefor I think
the name is a litte bit confusing - but that's another issue.

I suggest, that the rowStyles should work on groups rather than on rows. Tried to patch HtmlTableRenderer
accordingly and works fine for me:

        int currentRowSpan=-1;
        int currentRowInfoIndex=-1;
        int groupCount = 0; // added by PP

        TableContext tableContext=htmlDataTable.getTableContext();
                groupEndReached = false;
                groupCount++; // added by PP 
            rowInfo.setGroupIndex(groupCount); // added by PP

        String rowStyleClass;
        String rowStyle;
        if (uiData instanceof HtmlDataTable)
            HtmlDataTable datatable = (HtmlDataTable) uiData;
            rowStyleClass = datatable.getRowStyleClass();
            rowStyle = datatable.getRowStyle();
// added by PP            
            TableContext tableContext = datatable.getTableContext();
            if (tableContext != null && tableContext.getRowInfos() != null &&
tableContext.getRowInfos().size() > rowStyleIndex) {
	            RowInfo rowInfo = (RowInfo) tableContext.getRowInfos().get(rowStyleIndex);
	            if (rowInfo.getGroupIndex() >= 0) rowStyleIndex = rowInfo.getGroupIndex();

RowInfo added
	private int _groupIndex = -1;

	public int getGroupIndex() {
		return _groupIndex;
	public void setGroupIndex(int groupIndex) {
		_groupIndex = groupIndex; 

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message