I found this very weird behavior in Gwt.
Ok, I have a simple TestPresenter.java that have 2 buttons. Button 1 get
data from DB and return value via Asyncallback method. Button 2 is to
retrive that value from a private inner class.
private String test1;private String test2;private
AsyncCallback<GetArticleResult> getArticleCallback=new
AsyncCallback<GetArticleResult>(){@Override
public void onFailure(Throwable caught) {
// TODO Auto-generated method stub
loadingPresenter.hide();
}
@Override
public void onSuccess(GetArticleResult result) {
test1=result.getVal();
test2="123";
}};private class InlineHTMLContextMenuHandler implements
ContextMenuHandler {
@Override
public void onContextMenu(ContextMenuEvent event) {
System.out.println(test1);
System.out.println(test2);
}}
Now, i click the Button 1 first & it get Data from DB ok, then I click the
button 2. Then i get the output:test1=Null; test2="123"; when debugging the
test1 show real value, not null. For test1 variable, If i access it from a
method normally then it will be fine but if accessing it from private inner
class then I can't get its value.
What wrong? this so weird?
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.