You can override and extend Grid like this:

package com.poi.egh.turntable.ui.components;

/**
 * Grid component to be used in ProjectX.
 * 
 * Provides the following extensions to the Tapestry TurntableGrid:
 * <ul>
 * <li>class="odd" for all odd rows</li>
 * </ul>
 * 
 * @author Christian K&ouml;berl
 */
public class ProjectXGrid extends 
org.apache.tapestry.corelib.components.Grid
{
        private int rowIndex = 1;

        @Override
        public String getRowClass()
        {
                return rowIndex++ % 2 != 0 ? "odd" : "";
        }
}

-- 
Chris

Reply via email to