TreeTable - Strings look like TextFields

See the attachment.

Concerning the Tree Table. Mechanically, the treetable is working well.

Using Valo Theme.

My issue is, when there is no value to put in a cell (Row-Column) or (Item-Property), there should be nothing in that cell, the scroll-bar should be complete and not have a box - and I think the box is a TextField - sure looks like a TextField. But it’s not defined as a TextField.

In the attachment, I “Red Out” business stuff. In a blue X, I have marked where a Text Field seems to appear, but should not.

The Product ID and Name will never change, they are a string, so should be against the row background, not in a field. Entry and Result are text fields and do require operator input.
. . . .
treeTable.addContainerProperty(“Product ID”, String.class, “”);
treeTable.addContainerProperty(“Name”, String.class, “”);
treeTable.addContainerProperty(“Entry”, TextField.class, null);
treeTable.addContainerProperty(“Result”, TextField.class, null);
. . . .
Object objItemID = treeTable.addItem();
Item item = treeTable.getItem(objItemID);

        // ID
        Property<String> propID = item.getItemProperty("Product ID");           

        // Name
        Property<String> propName = item.getItemProperty("Name");           

There are no more properties being set for ‘item’. They are defined as String but appear as TextField. The two ‘columns’ are not defined in the ITEM, but the TextField occurs.

The program creates a new row (a child), for Quantity ordered. It’s string too, but has a TextField.
On the child rows, (QTY, SN Required, Lot Required), these too are string but show as Text Field.
And on the Child rows, there is no ID information so nothing is put into the item property.

I’m confused how I’m getting the visual.


The String columns (properties) are shown as TextFields if the TreeTable has been put in editable mode with setEditable(true). That’s probably not what you want if you want to have the ID and name columns read-only and have components as property types in the two other columns.

I don’t know what the meaning of your columns exactly are, but another (and perhams more common) solution would be to have regular value types (not components) for all the columns, set the TreeTable as editable, and set the fields in the ID and name columns as read-only in the TableFieldFactory. Simply returning null in the TFF makes a column show read-only text labels instead of editable TextField components.

Okay! I’ll dive deeper into your suggestions. Thank-you. Will advise.