我正在以 html 表格格式返回从 csv 文件生成的列表:
<span class="gwt-HTML">
<div id="productList">
nullnullnullnullnull
<table cellspacing="0">
<tbody>
<tr>
<th>Type Name</th>
<th>Class Name</th>
<th>Sub Class Name</th>
<th>Minor Class Name</th>
<th>Country Origin</th>
<th>SKU</th>
ETC..
注意到奇怪的 nullnullnullnullnull 出现了吗?将 html 转换为小部件后会发生这种情况:
SimplePanel pnl = new SimplePanel();
HTML res = new HTML(result);
pnl.add(res);
RootPanel.get("tableData").add(pnl);
结果变量是 html 字符串:
<div id="productList">
<table cellspacing="0">
<tbody>
<tr>
<th>Type Name</th>
<th>Class Name</th>
<th>Sub Class Name</th>
<th>Minor Class Name</th>
<th>Country Origin</th>
<th>SKU</th>
...etc
我已经检查以确保结果字符串不包含空值。有人知道为什么会这样吗?很奇怪...