Package com.google.web.bindery.requestfactory.shared

Examples of com.google.web.bindery.requestfactory.shared.SimpleFooRequest


    req.simpleFooRequest().getSimpleFooWithSubPropertyCollection().with(paths).fire(
        new Receiver<SimpleFooProxy>() {
          @Override
          public void onSuccess(SimpleFooProxy response) {

            SimpleFooRequest context = req.simpleFooRequest();
            driver.edit(response, context);

            SimpleFooBarNameOnlyEditor subeditor = editor.selfOneToManyField.getEditors().get(0);
            // test context is correctly set in CompositeEditor subeditors
            assertSame(context, subeditor.ctx);

            context.persistAndReturnSelf().using(response).with(paths).to(
                new Receiver<SimpleFooProxy>() {
                  @Override
                  public void onSuccess(SimpleFooProxy response) {
                    assertEquals("EditorBarTest", response.getSelfOneToManyField().get(0)
                        .getBarField().getUserName());
View Full Code Here


    req.simpleFooRequest().findSimpleFooById(1L).with(driver.getPaths()).fire(
        new Receiver<SimpleFooProxy>() {
          @Override
          public void onSuccess(SimpleFooProxy response) {

            SimpleFooRequest context = req.simpleFooRequest();
            driver.edit(response, context);
            editor.userName.setValue("One");
            context.persistAndReturnSelf().using(response).with(driver.getPaths()).to(
                new Receiver<SimpleFooProxy>() {
                  @Override
                  public void onSuccess(SimpleFooProxy response) {
                    assertEquals("One", response.getUserName());
                    // just testing that it doesn't throw (see issue 5752)
View Full Code Here

        // Set up driver in read-only mode
        driver.edit(response, null);
        assertNotNull(editor.delegate.subscribe());

        // Simulate edits occurring elsewhere in the module
        SimpleFooRequest context = req.simpleFooRequest();
        Request<SimpleFooProxy> request = context.persistAndReturnSelf().using(response);
        SimpleBarProxy newBar = context.create(SimpleBarProxy.class);
        newBar = context.edit(newBar);
        newBar.setUserName("newBar");
        response = context.edit(response);
        response.setBarField(newBar);
        response.setUserName("updated");

        request.fire(new Receiver<SimpleFooProxy>() {
          @Override
View Full Code Here

    req.simpleFooRequest().findSimpleFooById(1L).with(driver.getPaths()).fire(
        new Receiver<SimpleFooProxy>() {
          @Override
          public void onSuccess(SimpleFooProxy response) {

            SimpleFooRequest context = req.simpleFooRequest();
            driver.edit(response, context);
            context.persistAndReturnSelf().using(response).with(driver.getPaths()).to(
                new Receiver<SimpleFooProxy>() {
                  @Override
                  public void onSuccess(SimpleFooProxy response) {
                    fail("Expected errors. You may be missing jars, see "
                        + "the comment in RequestFactoryTest.ShouldNotSucceedReceiver.onSuccess");
View Full Code Here

    fooCreationRequest().fire(new Receiver<SimpleFooProxy>() {
      @Override
      public void onSuccess(SimpleFooProxy returned) {
        returned = checkSerialization(returned);
        SimpleFooRequest context = simpleFooRequest();
        Request<Void> editRequest = context.persist().using(returned);
        new FailFixAndRefire<Void>(returned, context, editRequest).doVoidTest();
      }
    });
  }
View Full Code Here

      /* cannot reuse a successful request, mores the pity */
    }
  }

  private Request<SimpleFooProxy> fooCreationRequest() {
    SimpleFooRequest context = simpleFooRequest();
    SimpleFooProxy originalFoo = context.create(SimpleFooProxy.class);
    final Request<SimpleFooProxy> fooReq = context.persistAndReturnSelf().using(originalFoo);
    originalFoo = context.edit(originalFoo);
    originalFoo.setUserName("GWT User");
    return fooReq;
  }
View Full Code Here

    simpleFooRequest().findSimpleFooById(999L).with("selfOneToManyField").fire(
        new Receiver<SimpleFooProxy>() {
          @Override
          public void onSuccess(SimpleFooProxy fooProxy) {
            fooProxy = checkSerialization(fooProxy);
            SimpleFooRequest context = simpleFooRequest();
            Request<SimpleFooProxy> updReq =
                context.persistAndReturnSelf().using(fooProxy).with("selfOneToManyField");
            fooProxy = context.edit(fooProxy);
            List<SimpleFooProxy> fooProxyList = fooProxy.getSelfOneToManyField();
            final int listCount = fooProxyList.size();
            fooProxyList.add(fooProxy);
            updReq.fire(new Receiver<SimpleFooProxy>() {
              @Override
View Full Code Here

    delayTestFinish(DELAY_TEST_FINISH);
    simpleFooRequest().findSimpleFooById(999L).fire(new Receiver<SimpleFooProxy>() {
      @Override
      public void onSuccess(SimpleFooProxy fooProxy) {
        fooProxy = checkSerialization(fooProxy);
        SimpleFooRequest context = simpleFooRequest();
        Request<SimpleFooProxy> updReq = context.persistAndReturnSelf().using(fooProxy);
        fooProxy = context.edit(fooProxy);
        fooProxy.getNumberListField().add(100);
        updReq.fire(new Receiver<SimpleFooProxy>() {
          @Override
          public void onSuccess(SimpleFooProxy response) {
            response = checkSerialization(response);
View Full Code Here

    delayTestFinish(DELAY_TEST_FINISH);
    simpleFooRequest().findSimpleFooById(999L).fire(new Receiver<SimpleFooProxy>() {
      @Override
      public void onSuccess(SimpleFooProxy fooProxy) {
        fooProxy = checkSerialization(fooProxy);
        SimpleFooRequest context = simpleFooRequest();
        Request<SimpleFooProxy> updReq = context.persistAndReturnSelf().using(fooProxy);
        fooProxy = context.edit(fooProxy);

        fooProxy.setNumberListField(null);
        updReq.fire(new Receiver<SimpleFooProxy>() {
          @Override
          public void onSuccess(SimpleFooProxy response) {
View Full Code Here

    delayTestFinish(DELAY_TEST_FINISH);
    simpleFooRequest().findSimpleFooById(999L).fire(new Receiver<SimpleFooProxy>() {
      @Override
      public void onSuccess(SimpleFooProxy fooProxy) {
        fooProxy = checkSerialization(fooProxy);
        SimpleFooRequest context = simpleFooRequest();
        Request<SimpleFooProxy> updReq = context.persistAndReturnSelf().using(fooProxy);
        fooProxy = context.edit(fooProxy);
        final int oldValue = fooProxy.getNumberListField().remove(0);
        updReq.fire(new Receiver<SimpleFooProxy>() {
          @Override
          public void onSuccess(SimpleFooProxy response) {
            response = checkSerialization(response);
View Full Code Here

TOP

Related Classes of com.google.web.bindery.requestfactory.shared.SimpleFooRequest

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.