Search code examples
gwtcelltable

Overriding Celltable Column getCellStyleNames method returns null


I tried to override the getCellStyleNames(Context context, T object) method of Column. But its not working.

I tried to return super.getCellStyleNames(), but it returns null.

What is the problem? What am I supposed to do to fix this problem?

I am using GWT 2.6.rc1.

TextColumn<ContactInfo> firstNameColumn = new TextColumn<ContactInfo>(
            ) {
        @Override
        public String getValue(ContactInfo object) {
            return object.getFirstName() ;
        }

        @Override
        public String getCellStyleNames(Context context, ContactInfo object) {
            Window.alert("X ::: "
                    + super.getCellStyleNames(context, object));
            return "cellTableCell1";
            // object.getAge() % 2 == 0 ? "cellTableCell2"
            // : "cellTableCell1";
            // return "styleName";
        }
    };

Thanks In Advance, Bennet.


Solution

  • After a discussion in chat we discovered the issue: the style name "cellTableCell1" was declared inside the table CSS resource, therefore the name was obfuscated. Getting the name from the CSS resource solved the issue.