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

Examples of com.google.web.bindery.requestfactory.shared.SimpleFooRequest.edit()


    SimpleFooRequest context = simpleFooRequest();
    SimpleFooProxy newFoo = context.create(SimpleFooProxy.class);
    final Request<Void> fooReq = context.persist().using(newFoo);

    newFoo = context.edit(newFoo);
    newFoo.setUserName("Amit"); // will not cause violation.

    fooReq.fire(new Receiver<Void>() {
      @Override
      public void onSuccess(Void ignore) {
View Full Code Here


          @Override
          public void onSuccess(SimpleFooProxy response) {
            checkReturnedProxy(response, relationsPresent);

            SimpleFooRequest editRequest = req.simpleFooRequest();
            SimpleFooProxy editableSimpleFoo = editRequest.edit(response);
            editableSimpleFoo.setSimpleBarKeyMap( new HashMap<SimpleBarProxy, Integer>());
            editableSimpleFoo.setSimpleBarValueMap( new HashMap<Integer, SimpleBarProxy>());
            editRequest.persistAndReturnSelf().using(editableSimpleFoo).with(SIMPLE_FOO_RELATIONS).fire(
                new Receiver<SimpleFooProxy>() {
                  @Override
View Full Code Here

    delayTestFinish(DELAY_TEST_FINISH);
    SimpleFooRequest context = req.simpleFooRequest();
    SimpleFooProxy rayFoo = context.create(SimpleFooProxy.class);
    final Request<SimpleFooProxy> persistRay = context.persistAndReturnSelf().using(
        rayFoo);
    rayFoo = context.edit(rayFoo);
    // 42 is the crash causing magic number
    rayFoo.setPleaseCrash(42);
    persistRay.fire(new SimpleFooFailureReceiver(rayFoo, persistRay,
        "java.lang.UnsupportedOperationException"));
  }
View Full Code Here

    delayTestFinish(DELAY_TEST_FINISH);
    SimpleFooRequest context = req.simpleFooRequest();
    SimpleFooProxy rayFoo = context.create(SimpleFooProxy.class);
    final Request<SimpleFooProxy> persistRay = context.persistAndReturnSelf().using(
        rayFoo);
    rayFoo = context.edit(rayFoo);
    // 43 is the crash causing magic number
    rayFoo.setPleaseCrash(43);
    persistRay.fire(new SimpleFooFailureReceiver(rayFoo, persistRay, "java.lang.Exception"));
  }
View Full Code Here

        // 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");
View Full Code Here

        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

  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

    delayTestFinish(DELAY_TEST_FINISH);

    SimpleFooRequest context = simpleFooRequest();
    SimpleFooProxy rayFoo = context.create(SimpleFooProxy.class);
    final Request<SimpleFooProxy> persistRay = context.persistAndReturnSelf().using(rayFoo);
    rayFoo = context.edit(rayFoo);
    rayFoo.setUserName("Ray");

    persistRay.fire(new Receiver<SimpleFooProxy>() {
      @Override
      public void onSuccess(SimpleFooProxy response) {
View Full Code Here

      public void onSuccess(SimpleFooProxy response) {
        final SimpleFooProxy persistedRay = checkSerialization(response);
        SimpleBarRequest context = simpleBarRequest();
        SimpleBarProxy amitBar = context.create(SimpleBarProxy.class);
        final Request<SimpleBarProxy> persistAmit = context.persistAndReturnSelf().using(amitBar);
        amitBar = context.edit(amitBar);
        amitBar.setUserName("Amit");

        persistAmit.fire(new Receiver<SimpleBarProxy>() {
          @Override
          public void onSuccess(SimpleBarProxy response) {
View Full Code Here

            response = checkSerialization(response);

            SimpleFooRequest context = simpleFooRequest();
            final Request<SimpleFooProxy> persistRelationship =
                context.persistAndReturnSelf().using(persistedRay).with("barField");
            SimpleFooProxy newRec = context.edit(persistedRay);
            newRec.setBarField(response);

            persistRelationship.fire(new Receiver<SimpleFooProxy>() {
              @Override
              public void onSuccess(SimpleFooProxy response) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.