Uploaded image for project: 'Tapestry'
  1. Tapestry
  2. TAPESTRY-956

TableColumns and TableValues: impossible to assign different styles to different columns

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 4.0.1
    • 4.1.1
    • Contrib
    • None
    • win xp, jdk15, tomcat 5.0.28

    Description

      I tried setting different column styles using solution proposed by MindBridge.

      I have the following in my .page file:

      <component id="tableValues" type="contrib:TableValues">
      <binding name="column" value="currColumn"/>
      <binding name="class" value="currColumnClass"/>
      </component>

      The problem is that although the currColumn gets correctly initialized with every column, the "getCurrColumnClass" method gets called just once, only for the first column, so every <td> tag gets the same "class"!

      The solution works with Tapestry 3.0, so I have modified the following method of TableValues (copied from version 3.0):

      public String getValueClass()

      { IBinding objClassBinding = getBinding("class"); if (objClassBinding != null) return objClassBinding.getObject().toString(); else return getTableColumn().getColumnName() + TABLE_VALUE_CSS_CLASS_SUFFIX; // if (isParameterBound("class")) // return getCellClass(); // // return getTableColumn().getColumnName() + TABLE_VALUE_CSS_CLASS_SUFFIX; }

      This way it works for me.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ogbo Oleg Bondarenko
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: