The GWT documentation clearly states that java thread utiilties may not
be used because javascript does not support threads.
However, does anyone knows a way to block a method execution for user
input ? More precisely, I'm currenly trying to do something like this :
/**
* opens a user dialog and returns the entered value
*/
public String showInputDialog(String message) {
d = ... // open a DialogBox
// WAIT FOR DIALOG CLOSE
// something like wait() in java
// ... and without 'while (true) like' stuff
// return entered value (for example)
return d.getValue();
}
Is there a GWT or javascript solution to do that ? or is it actually
impossible due to javascript restrictions ?
A solution should be to implement some continuation pattern (like
GWT/RPC for example) ... but I would like to avoid this if possible.
Thx
blambeau
public String showInputDialog(String message) {
d = ... // open a DialogBox
d.addPopupListener(new PopupListener() {
public void onPopupClosed(PopupPanel sender, boolean
autoClosed) {
// Your code here ...
}
});
}