2 Replies Latest reply on Mar 2, 2010 10:08 AM by daxxy

    How to programmatically access skin property value?

    daxxy

       

      I am generating a table using

       

      <a4j:repeat>

        <tr>

          <td/><td/><td/>

        </tr>

      </a4j:repeat>

       

      (Please do not suggest switching to rich:dataTable -- I cannot use it for reasons I don't want to get into here.)

       

      I want the row colors to alternate between "generalBackgroundColor" and "alternateBackgroundColor".  I have a rowColorSelector bean to return one or the other color depending on the value of "rowIndex".

       

      From the view:

       

      <a4j:repeat rowKeyVar="rowIndex">

      <tr style="background-color: #{deviceTableStyleSelector.getStyleClass(rowIndex)}" >

       

       

      Here is the color selector bean:

       

      public class DeviceTableStyleSelector {
         
          String styleClass;


          public String getStyleClass(Integer index) {
              if (index == null ) {
                  return null;
              }
              if (index % 2 == 1) {
                  return Skin.additionalBackgroundColor;
              }
              else {
                  return Skin.generalBackgroundColor;
              }
          }


      }

       

      Apparently :-) Skin.additionalBackgroundColor does not return the string that represents the color.  Rather it returns the string "additionalBackgroundColor".

       

      How do I get the string that represents the actual color?  BTW -- I am using Seam.  Is there something I need to inject here? If so, what?