Beispiel #1
0
  private FlowPanel createRandomNamePanel(String priceDesc) {
    final FlowPanel randomName = new FlowPanel();
    AsyncCallback callback =
        new AsyncCallback() {
          public void onFailure(Throwable caught) {
            GWT.log("Problem while getting random name", caught);
          }

          public void onSuccess(Object result) {
            randomName.add(new Label((String) result));
            LightBox lightBox = new LightBox(new WinnerPopup((String) result));
            lightBox.show();
          }
        };
    RaffleServiceGwtRemoteAsync service = RaffleServiceGwtRemote.App.getInstance();
    service.getRandomName(priceDesc, callback);
    return randomName;
  }