Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I've found the most versatile command sequence to be</p> <pre><code>void start() { // Either get p context1.get(..).to( new Receiver&lt;P&gt; { onSuccess(P resp){p = resp;} ... }).fire(); // OR create p p = context2.create( P.class ); // Then save p req = context2.persist(p).to( new Receiver&lt;P&gt;{ /* note do not use context1 */ onViolation(...) { /*JSR 303 handler*/ }; onFailure( error ) { /* handle */ error.getMessage() }; onSuccess(X x) { /* whatever persist() returns handler */ }; } ); // drive editor with p driver.edit( p, req); } .... void onSave() { // editor ctxt = driver.flush() /* note ctxt == context2 */ if ( driver.hasErrors() ) { /*JSR 303 handler*/}; // RF ctxt.fire(); } </code></pre> <p><em>Based on the conversation excerpt below at</em> <a href="http://groups.google.com/group/google-web-toolkit/browse_thread/thread/da863606b3893132/96956661c53e1064?hl=en" rel="nofollow">http://groups.google.com/group/google-web-toolkit/browse_thread/thread/da863606b3893132/96956661c53e1064?hl=en</a> </p> <blockquote> <p><em>Thomas Broyer</em> onFailure should containg the getMessage() of the exception you threw on the server side. </p> <p>You can tweak it by providing your own ExceptionHandler to the RequestFactoryServlet (extend it and use its constructor taking an ExceptionHandler). </p> <p>onViolation will only be called if your entities do not pass JSR-303 Bean Validation, which is checked before calling any service method.</p> <p>If you want to "catch" the failure in clidnt code, you have to add a Receiver for the persist() service method:<br> context.persist(p).to(new Receiver…</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload