Code:
VerticalFieldManager myMgr=new VerticalFieldManager();
myMgr=displayInfo();
add(myMgr);
In above code, displayInfo() calls webmethod, populates the list with database values, adds the list in manager and returns manager which contains that list.
I assigned return value of displayInfo() to the another manager. And after that I added the manager to the screen.
This portion works fine for me.
I want to refresh the list in the manger in every 3 seconds. So, I tried to populate the manager with new values and invalidate the manager. But their is problem in assigning the return value of displayInfo() in the manager.
myMgr=displayInfo(); line throws exception [IllegalArgumentException] in code below.
Code:
UiApplication.getUiApplication().invokeLater(new Runnable() {
public void run() {
myMgr=displayInfo();
myMgr.invalidate();
}
},3000,true);
}