在一个表中,有两列,每一列都有一个下拉列表。
final Table archivesTable = new Table();
archivesTable.setTableFieldFactory(new TableFieldFactory() {
@Override
public Field createField(Container container, Object itemId,
Object propertyId, Component uiContext) {
Select sel = new Select();
try (SSEConnector c = CisApplication
.generateSseConnector((SseConnection) sseSetupSelect
.getValue())) {
for (String s : c.getListOfArchives())
sel.addItem(s);
} catch (Exception e) {
e.printStackTrace();
}
System.out.println("yes 2");
return sel;
}
});
archivesTable.addGeneratedColumn("reportName",
new Table.ColumnGenerator() {
@Override
public Object generateCell(Table source, final Object itemId, Object columnId) {
reportSelect = new Select();
try (SSEConnector c = CisApplication
.generateSseConnector((SseConnection) sseSetupSelect
.getValue())) {
for (String s : c.getListOfArchives())
reportSelect.addItem(s);
} catch (Exception e) {
e.printStackTrace();
}
System.out.println("yes 3");
return reportSelect;
}
}
);
正如我们所看到的,我希望表中第一列中第一个“选择”的任何值更改都会影响表中第二列中第二个“选择”中的值。如何?