Hi Angelo,

If we use boolean type for "cssClass", maybe we don't need a set method.

private boolean cssClass = false;

public String getRowClass() {
        cssClass = !cssClass;
        return (cssClass ? "" : "zebra");
}

Marcus



Angelo Chen wrote:

In your tml you define a css class:

    <style type="text/css">
       .zebra {
           background-color: silver;
       }
   </style>

  <table t:type="grid" .... rowClass="rowClass" />

then in your page class, you put something like this:

 private int row = 0;

 public String getRowClass() {
       if (row % 2 != 0) {
           return "";
       } else
           return "zebra";
   }

in a setter, inc the row:

 public void setCurrentCmt(Comment currentCmt) {
       row++;
       this.currentCmt = currentCmt;
 }

Reply via email to