I have 2 problem
1 → Below show how I created table
tblRecivedTask = new Table("Recived requests");
tblRecivedTask.setImmediate(true);
tblRecivedTask.setSelectable(true);
tblRecivedTask.setNullSelectionAllowed(false);
tblRecivedTask.setHeight("200px");
tblRecivedTask.setWidth("600px");
tblRecivedTask.addContainerProperty(TASK_PROPERTY_TASK_NAME, String.class, "");
tblRecivedTask.addContainerProperty(TASK_PROPERTY_REF_NO, String.class, "");
tblRecivedTask.addContainerProperty(TASK_PROPERTY_FROM, String.class, "");
tblRecivedTask.addContainerProperty(TASK_PROPERTY_RECIVED_TIME, String.class, "");
tblRecivedTask.addContainerProperty(TASK_PROPERTY_APPROVED_TIME, String.class, "");
After that I added data to table below show that
for (int x = 0; x < 5; x++) {
String y = Integer.toString(x);
tblRecivedTask.addItem(new Object[]{y, y, y, y, y}, x);
}
Object[] recivedVisbleColum = {TASK_PROPERTY_TASK_NAME, TASK_PROPERTY_REF_NO, TASK_PROPERTY_FROM, TASK_PROPERTY_RECIVED_TIME};
tblRecivedTask.setVisibleColumns(recivedVisbleColum);
above way show table data and hide columns
but if I change order like below way
Object[] recivedVisbleColum = {TASK_PROPERTY_TASK_NAME, TASK_PROPERTY_REF_NO, TASK_PROPERTY_FROM, TASK_PROPERTY_RECIVED_TIME};
tblRecivedTask.setVisibleColumns(recivedVisbleColum);
for (int x = 0; x < 5; x++) {
String y = Integer.toString(x);
tblRecivedTask.addItem(new Object[]{y, y, y, y, y}, x);
}
Table didn’t show any data but colums hide why is that how can i solve this problem ?
2 - >
I’m using refresher to load data to table if i use hide columns data not visible, if i remove it work perfectly how can i solve this problem below show that code
@Override
public void run() {
try {
while (true) {
if (running) {
// synchronize with the application, to avoid concurrent
// edits on the label's value.
synchronized (MyApplication.this) {
tblRecivedTask.removeAllItems();
int u = x++;
for (int a = 0; a < 5; a++) {
String y = Integer.toString(a);
tblRecivedTask.addItem(new Object[]{y, "a", y, u, y}, a);
}
Object[] recivedVisbleColum = {TASK_PROPERTY_TASK_NAME, TASK_PROPERTY_REF_NO, TASK_PROPERTY_FROM, TASK_PROPERTY_RECIVED_TIME};
tblRecivedTask.setVisibleColumns(recivedVisbleColum);
}
}
sleep(SLEEP_TIME_IN_MILLIS);
}
} catch (Exception e) {
e.printStackTrace();
}
}
How can I solve those issues ?