Gwt CellTable上的复合单元格宽度

Gwt CellTable上的复合单元格宽度,gwt,cell,celltable,Gwt,Cell,Celltable,我有一个复合单元格,工作正常,它有一个textinputcell和一个button单元格。但是,当显示时,它会将buttoncell置于文本输入单元格下,如图所示: 以下是使用hascells实现我的compositecel: final HasCell<ObjetoDato,String> celda1=new HasCell<ObjetoDato,String>(){ TextInputCell celda; @Override publi

我有一个复合单元格,工作正常,它有一个textinputcell和一个button单元格。但是,当显示时,它会将buttoncell置于文本输入单元格下,如图所示:

以下是使用hascells实现我的compositecel:

final HasCell<ObjetoDato,String> celda1=new HasCell<ObjetoDato,String>(){
    TextInputCell celda;

    @Override
    public Cell<String> getCell() {
        celda=new TextInputCell();
        
        return celda;
    }

    @Override
    public FieldUpdater<ObjetoDato, String> getFieldUpdater() {
        return null;
    }

    @Override
    public String getValue(ObjetoDato object) {
        //new Scripter(object,actual.getComportamiento(),true);
        return object.getValor(actual.getNombreCampo());    
    }

    
    
};                        
HasCell<ObjetoDato,String> celda2=new HasCell<ObjetoDato,String>(){
    ButtonCell celda;

    @Override
    public Cell<String> getCell() {
        celda=new ButtonCell();
        
        return celda;
    }

    @Override
    public FieldUpdater<ObjetoDato, String> getFieldUpdater() {
        return new FieldUpdater<ObjetoDato, String> (){
            
            @Override
            public void update(int index,ObjetoDato object, String value) {
                new Seleccionador(actual.getClaseRelacion(), actual.getNombreCampo(),object.getValor(actual.getNombreCampo()), object.getIdRelacion(actual.getNombreCampo()), object,tabla,object,actual.getComportamiento());
            
            }
        };
    }

    @Override
    public String getValue(ObjetoDato object) {
        
        return "...";
    }
    
    
};
//Composite
List<HasCell<ObjetoDato,?>> celdas = new LinkedList<HasCell<ObjetoDato,?>>();
celdas.add(celda1);
celdas.add(celda2);
CompositeCell<ObjetoDato> cell = new CompositeCell<ObjetoDato>(celdas);

Column<ObjetoDato,ObjetoDato> columna = new Column<ObjetoDato,ObjetoDato>(cell) {
        @Override
                public ObjetoDato getValue(ObjetoDato object) {
                    return object;
                }
};

//columna.setCellStyleNames("columna3puntos");
tabla.agregarColumna(columna,actual.getCaption());
final HasCell celda1=新的HasCell(){
TextInputCell-celda;
@凌驾
公共单元getCell(){
celda=新文本输入单元格();
返回塞尔达;
}
@凌驾
公共字段更新程序getFieldUpdater(){
返回null;
}
@凌驾
公共字符串getValue(对象JetToDato对象){
//新的脚本编写器(对象,实际的.getComportamiento(),true);
返回object.getValor(实际的.getNombreCampo());
}
};                        
HasCell celda2=新的HasCell(){
纽顿塞尔塞尔达;
@凌驾
公共单元getCell(){
celda=新按钮cell();
返回塞尔达;
}
@凌驾
公共字段更新程序getFieldUpdater(){
返回新的FieldUpdater(){
@凌驾
公共void更新(int索引、ObjetoDato对象、字符串值){
新的selectionador(actual.getClaseRelacion(),actual.getNombreCampo(),object.getValor(actual.getNombreCampo()),object.getIdRelacion(actual.getNombreCampo()),object,tabla,object,actual.getComportamiento());
}
};
}
@凌驾
公共字符串getValue(对象JetToDato对象){
返回“…”;
}
};
//复合材料
List celdas=new LinkedList();
celdas.add(celda1);
celdas.add(celda2);
CompositeCell单元=新CompositeCell(celdas);
Column columna=新列(单元格){
@凌驾
公共ObjetoDato getValue(ObjetoDato对象){
返回对象;
}
};
//columina.setCellStyleNames(“columna3puntos”);
tabla.agregarColumna(columna,actual.getCaption());

您可能想看看render()方法是如何实现的。如果您的内部单元格使用块元素,如
。它将垂直显示。因此,您可以将其更改为
。或者可以将style=“float:left;”添加到div的CSS中。我有一些和你相似的东西。但我的是一个2行表的自定义单元格,有1列,如下所示:

+----+
|    |
+----+
|    |
+----+
+----+     +----+   +----+
|    |     |    |   |    |
+----+     +----+   +----+
|    |     |    |   |    |
+----+     +----+   +----+
我使用了一个单元格列表来保存这些自定义单元格的数量。CellList的问题在于它垂直显示它们。因此,我必须覆盖单元格列表,使其水平显示。我修改了CellList的模板,使其具有float:left,并且我的单元格开始水平渲染,如下所示:

+----+
|    |
+----+
|    |
+----+
+----+     +----+   +----+
|    |     |    |   |    |
+----+     +----+   +----+
|    |     |    |   |    |
+----+     +----+   +----+

问题到底是什么?我想你想把它排成一行,对吗?您是否可以设置CellTable.setWidth(“100%”,true)?这将设置固定布局,但它是。。。让我们说太固定了吧。之后,您可以设置所有列的宽度。那么你可以这样做吗?如果它损坏了你的设计太多,那么这可能不是办法