gwt单元列表编辑单元 cellllist-cellllist=new-cellllist(new-ItemCell());

gwt单元列表编辑单元 cellllist-cellllist=new-cellllist(new-ItemCell());,list,gwt,cell,edit,List,Gwt,Cell,Edit,其中: CellList<Device> cellList = new CellList<Device>(new ItemCell()); 静态类ItemCell扩展了AbstractCell{ @凌驾 公共void呈现(上下文上下文、设备、安全HtmlBuilder生成器){ 如果(设备==null){ 返回; } appendHtmlConstant(“device.getId()”); appendHtmlConstant(“device.getName()”);

其中:

CellList<Device> cellList = new CellList<Device>(new ItemCell());
静态类ItemCell扩展了AbstractCell{
@凌驾
公共void呈现(上下文上下文、设备、安全HtmlBuilder生成器){
如果(设备==null){
返回;
}
appendHtmlConstant(“device.getId()”);
appendHtmlConstant(“device.getName()”);
}
}

现在,我想做一个“编辑”按钮,当我按下它时,我想看到可编辑的选定项目。我怎么做?请回答,谁知道呢。

使用EditTextCell或ActionCell


签出或>>

使用EditTextCell或ActionCell


签出或>>

我遵循了简单的老方法


我用了一个单元格列表和一个附在上面的表格。每次单击一行时,该行的数据都会加载到表单中。您现在可以通过此表单删除或编辑所选行

我遵循了简单的老方法


我用了一个单元格列表和一个附在上面的表格。每次单击一行时,该行的数据都会加载到表单中。您现在可以通过此表单删除或编辑所选行

谢谢你,温丁先生。但我有一个CellList,而不是CellTable,CellList中的addColumn()方法是什么?谢谢你,wingdings先生。但我有一个CellList,而不是CellTable,CellList中的addColumn()方法是什么?
static class ItemCell extends AbstractCell<Device> {
    @Override
    public void render(Context context, Device device, SafeHtmlBuilder builder) {
        if(device == null) {
            return;
        }
        builder.appendHtmlConstant("<div>device.getId()</div>");
        builder.appendHtmlConstant("<div>device.getName()</div>");
    }
}

addColumn(new EditTextCell(), "Name", new GetValue() {
            @Override
            public String getValue(IData contact) {
                return contact.getName();
            }
        }, new FieldUpdater() {
            @Override
            public void update(int index, IData object, String value) {
                try {
                    pandingChanges.add(new FirstNameChange(object, value));
                } catch (Exception e) {
                }

        }
    });