GWT:如何将可滚动的 TextInputCell 添加到 CellArea?

问题描述 投票:0回答:1

我是 GWT 的新手,正在更改现有的 GWT 项目。我有一张桌子是:

private final CellTable<Thing> samplesTable
和几列,其中之一是:
private final Column<Thing, String> nameColumn

我像这样实例化 nameColumn:

nameColumn = new Column<Thing, String>(new TextInputCell()) { methods }

这很好用,但是 TextInputCell 不可滚动。我想让文本输入成为一个可滚动的框,所以我尝试将 TextInputCell 更改为 TextArea 并进行转换:

nameColumn = new Column<Thing, String>((Cell<String>) new TextInputCell())

但当然失败了。我在 GWT 文档中搜索了可滚动的文本框,这些文本框也是单元格,但找不到任何内容。

这个CellTable中的其他对象都是Cell类型的,所以我不能改变表格类型。我怎样才能最好地获得单元格中的可滚动文本区域以添加到 CellTable?

非常感谢

java gwt
1个回答
0
投票

我在How to add multiple lines of text in GWT celltable EditTextCell?中找到了解决方案

代码需要整理一下,但它可以工作。它使用 SafeHtmlTemlpate 所以让你的头脑了解它 - 我找到的最好的资源是“GWT In Action”

© www.soinside.com 2019 - 2024. All rights reserved.