Hi,
I have a FlexTable that has a Select in one of its columns. The table is initially loaded from the database when the page is loaded in the browser. At that time, the Select doesn't have anything selected because the database doesn't have a value for that column. So the text "Nothing Selected" is shown in the Select. I am trying to make sure that no message is shown in that case. I have tried adding an Option with an empty key and value to the Select and calling setValue("") on the Select. But that doesn't work. I have also tried to use a non empty value such as "-1" for the Option and that doesn't work either. I have found a class org.gwtbootstrap3.extras.select.client.ui.SelectOptions which contains this constant "NONE_SELECTED_TEXT". It corresponds to the attribute "none-selected-text" in Bootstrap, which is used for doing exactly what I am trying to do, from what I understand. But that option is not being used by SelectBase. So I would like to know if there's a way to use that constant or if there's some other way to accomplish what I am trying to do. Here's how I am adding Options to the Select
private Select getFilterSelect() {
Option op;
Select sel;
sel = new Select();
op = new Option();
op.setText("");
op.setValue("");
sel.add(op);
for (DictionaryDO data : filterList) {
op = new Option();
op.setText(data.getEntry());
op.setValue(data.getCode());
sel.add(op);
}
return sel;
}
Here's how I am setting the Select's value in the table:
filterSel = getFilterSelect();
filterSel.setValue("");
table.setWidget(i+1, 2, filterSel);
As I mentioned earlier, the table is a FlexTable.
Thanks,
Alankar