Acá va un poco de luz ( here's a little bit of light ).
public class AccountManager extends Composite implements
HasValueChangeHandlers<Integer> {
public AccountManager() {
......
......
......
......
initWidget(bar);
}
protected Integer getValue() {
return <some value>;
}
private void loadAccounts() {
AccountRemote.Util.getInstance().getAllAccount(new
DefaultCallback() {
@SuppressWarnings("unchecked")
public void onSuccess(Object result) {
if (result != null) {
accounts = (List<Account>)
result;
// Save the accounts
accountList.clear();
accountsHM.clear();
for (Account account :
accounts) {
accountList.addItem
(account.getAccountName());
// Save the accounts
accountsHM.put
(account.getAccountName(), account);
}
// Update the list of the
accounts in all clients
ValueChangeEvent.fire
(this,getValue());
}
}
});
public HandlerRegistration addValueChangeHandler(final
ValueChangeHandler<Integer> handler) {
return addHandler(handler,ValueChangeEvent.getType());