I'm trying to get a state of a server variable using a callback. Obviously, the state is always false
. How can I get the state from the server? Or another question, which options do I have to get anything from the server side?
public static void testCallback(){
AsyncServiceRegistry.getUserService().isState(new AsyncCallback<Boolean>() {
@Override
public void onFailure(Throwable caught) {}
@Override
public void onSuccess(Boolean result) {
ApplicationContext.setState(result);
}
});
boolean state = ApplicationContext.getState();
if (state) {
System.out.println(true);
//do smth if true
} else {
System.out.println(false);
//do smth if false
}
}