[EMAIL PROTECTED] wrote the following on 7/14/2005 2:21 AM:
1. Have 2 classes in CSS.

2. within iterate write:
<tr class='<bean name="...." property="listRowClass" />' >
                <td> <html:......................></td>
                ..................
                ................
</tr>

3. In the corresponding form:

 public String getListRowClass() {
      if ( "oddRow".equals(listRowClass))
          listRowClass = "evenRow";
      else
          listRowClass = "oddRow";

      return listRowClass;
  }

Short & sweet isn't it?

Well, I'm not sure it is. You are missing some things in the code above. For one, where is your logic for setting the property "listRowClass" to "oddRow" or "evenRow" ? That has to be taking place somewhere?

Second, I think it's a very bad idea to do this in a form bean. For one, I rarely even am using my form beans for display purposes. I use the List of value objects (or maps if I'm going the map route). Second, you are going to have to duplicate that code above in every form bean which is a waste. Sure you can provide a helper method to do it, but how is that better than creating a true tag or tag file?

I am curious where you logic is to set up "listRowClass" with the appropriate value?

--
Rick

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to