Question

I'm using vaadin's TreeTable. Is there a way to remove or hide the dropdown arrow on the first level objects that do not have any children and still have the objects correctly positioned vertically?

UPDATE

Final solution if anyone is interested:

I add a FieldFactory to the table

protected class TableFactory extends DefaultFieldFactory{
    private static final long serialVersionUID = 1L;

    private MyTreeTable table;
    public TableFactory(MyTreeTable table){
        this.table = table;
    }

    @Override
    public Field createField(Container container, Object itemId,
            Object propertyId, Component uiContext) {
        Field field = super.createField(container, itemId, propertyId, uiContext);

        if(itemId instanceof TaskHeadRow){
            if(((TaskHeadRow)itemId).getTask() instanceof SystemTask){
                table.setChildrenAllowed(itemId, false);
            }
        }

        return field;
    }   
}
Was it helpful?

Solution

The arrow is not show if you define for the item:

treetable.setChildrenAllowed("myitemid", false);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top