Package com.google.gwt.user.client.rpc

Examples of com.google.gwt.user.client.rpc.AsyncCallback


   }

   /** Now lets actually go to the server, using a callback - its called Ajax for a reason ! */
   private void askServer(String text)
   {
      getService().askIt(text, new AsyncCallback()
      {
         public void onFailure(Throwable t)
         {
            Window.alert(t.getMessage());
         }
View Full Code Here


        keepAlive = true;

        alert("received callback for (" + topicName + "," + data + ")");

        if (callbacks.containsKey(topicName)) {
            AsyncCallback callback = (AsyncCallback) callbacks.get(topicName);

            try {
                Object dataToSend = data;

                if (data.startsWith("$JSONSTART$") && data.endsWith("$JSONEND$")) {
                    dataToSend = JSONParser.parse(data.substring("$JSONSTART$".length(), data.length() - "$JSONEND$".length()));
                }

                callback.onSuccess(dataToSend);
            } catch (JSONException e) {
                callback.onFailure(e);
            }
        } else {
            alert("received event for a not subscribed topic: '" + topicName + "'");
            alert("current topics are: " + callbacks.keySet());
        }
View Full Code Here

    // Set "loading" status
    status.setText(FrameworkLocale.messages().loading());
    setButtonsEnable(false);

    // Loading data row
    rowLoader.GetData(new AsyncCallback() {

      public void onFailure(Throwable caught) {
        if (!isHidden()) {
          status.setText(FrameworkLocale.messages().error());
          throw new AsyncCallbackFailureException(FrameworkLocale
View Full Code Here

      // Here we can add empty row for nice data loading visualisation.
    }
   
    showStatusPanel(FrameworkLocale.messages().loading());
   
    dataSource.selectCount(params, new AsyncCallback() {
      public void onFailure(Throwable caught) {
        if (!parentWindow.isHidden()) {
          pager.setErrorMessage(FrameworkLocale.messages().asyncerror_loadrowscount());
          throw new AsyncCallbackFailureException(FrameworkLocale.messages().asyncerror_loadrowscount(), caught);
        }
      }
      public void onSuccess(Object result) {
        if (!parentWindow.isHidden()) {
          pager.setTotalCount(((Integer)result).intValue());
          pager.refresh();
        }
      }
    });
   
    dataSource.select(params,  new AsyncCallback() {
      public void onFailure(Throwable caught) {
        if (!parentWindow.isHidden()) {
          showStatusPanel((FrameworkLocale.messages().asyncerror_loadrows()));
          throw new AsyncCallbackFailureException(FrameworkLocale.messages().asyncerror_loadrows(), caught);
        }
View Full Code Here

  public RemoteLogger() {
    service = (RemoteLoggerServiceAsync) GWT.create(RemoteLoggerService.class);
    final ServiceDefTarget target = (ServiceDefTarget) service;
    target.setServiceEntryPoint(GWT.getModuleBaseURL() + "gwt-log");

    callback = new AsyncCallback() {
      public void onFailure(Throwable ex) {
        if (failure == null) {
          failure = new RuntimeException(
              "Remote logging will be suspended due to communication failure with "
                  + GWT.getTypeName(service) + " at " + target.getServiceEntryPoint(), ex);
View Full Code Here

       
        Context.getInstance().addDetailExecution("Seteando atributos previos para el reporte 2");
        params.putAll(Context.getInstance().getTaskGrid().getStore().getLoadConfig().getProperties());
        Context.getInstance().addDetailExecution("Invocando servicio setea atributos para el reporte");
        params.put(ServiceNameConst.SERVICIO, ServiceNameConst.SET_PARAMS_ON_SESSION);
        DispatcherUtil.getDispatcher().execute(params, new AsyncCallback() {

          @Override
          public void onFailure(Throwable caught) {
            DialogFactory.error("Fallo intentando setear informacion para el reporte.");
          }
View Full Code Here

       
        Context.getInstance().addDetailExecution("Seteando atributos previos para el reporte 2");
        params.putAll(Context.getInstance().getTaskGrid().getStore().getLoadConfig().getProperties());
        Context.getInstance().addDetailExecution("Invocando servicio setea atributos para el reporte");
        params.put(ServiceNameConst.SERVICIO, ServiceNameConst.SET_PARAMS_ON_SESSION);
        DispatcherUtil.getDispatcher().execute(params, new AsyncCallback() {

          @Override
          public void onFailure(Throwable caught) {
            DialogFactory.error("Fallo intentando setear informacion para el reporte.");
          }
View Full Code Here

    Context.getInstance().addDetailExecution("ObjectiveWindow 10");
    fldUser.setStore(new ListStore<ModelData>());
    Map params = new HashMap<String, String>();
    params.put(ServiceNameConst.SERVICIO, ServiceNameConst.LIST_USERS);
    DispatcherUtil.getDispatcher().execute(params,
        new AsyncCallback() {

          @Override
          public void onFailure(Throwable caught) {
            Context.getInstance().addDetailExecution("ObjectiveWindow 11");
            Info.display(
View Full Code Here

  public void desbloquear() {
    if (actual != null) {
      Map params = new HashMap<String, String>();
      params.put(ParamsConst.ID, actual.get(ParamsConst.ID));
      params.put(ServiceNameConst.SERVICIO, ServiceNameConst.UNLOCK);
      DispatcherUtil.getDispatcher().execute(params, new AsyncCallback() {

        @Override
        public void onFailure(Throwable caught) {
          DialogFactory
              .error("No se ha podido desbloquear el objetivo.");
View Full Code Here

    fldUser.setFieldLabel("Responsable");
    fldUser.setEnabled(Boolean.FALSE);
    fldUser.setStore(new ListStore<ModelData>());
    Map params = new HashMap<String, String>();
    params.put(ServiceNameConst.SERVICIO, ServiceNameConst.LIST_USERS);
    DispatcherUtil.getDispatcher().execute(params, new AsyncCallback() {

      @Override
      public void onFailure(Throwable caught) {
        Context.getInstance().validateUserExpired(caught);
        DialogFactory
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.rpc.AsyncCallback

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.