I have a simple table [form:tabView:remTNtableID], with a list of strings CFSnumbers
, and when I click a button I call getTelephoneNumbers()
to fill it, which takes a while.
I'd like to have the table show "Loading.." while waiting, and for that purpose I cleared the list, added "Loading.." to the list, and called RequestContext.getCurrentInstance().update("form:tabView:remTNtableID").
But the table is not updated immediately, "Loading.." is not seen, and only when the getTelephoneNumbers()
call ends is the table updated.
What's up? How can I force the table to be re-rendered immediately?
private List<String> CFSnumbers;
@PostConstruct
public void init() throws GuiException {
CFSnumbers = new ArrayList<String>();
}
public void getTelephoneNumbers() throws GuiException {
CFSnumbers.clear();
CFSnumbers.add("Loading..");
RequestContext.getCurrentInstance().update("form:tabView:remTNtableID");
try {
...
CFSnumbers = ...
RequestContext.getCurrentInstance().update("form:tabView:remTNtableID");
} catch (Exception e) {
CFSnumbers.clear();
RequestContext.getCurrentInstance().update("form:tabView:remTNtableID");
}