Unbuffered Grid and Editor Save Listener

I am trying to capture when a row is updated in an event. In buffered mode, there is no issue as the save button calls the Save Listener, but in Unbuffered mode it doesn’t seem to be called.

I have tried attaching a valueChangelistener to the Binded field and that does work except I can’t seem to find a way to get the full row of the record that is being changed as I need the ID field to be able to change the underlying data.

Any suggestions on how I can either get the Editor saveListener to be called or how am I able to get thr full row record from the ValueChangeListener of the binded field?

Thanks

One alternative would be to use https://vaadin.com/directory/component/gridfastnavigation-add-on

It adds number of useful things with unbuffered editor, also the events you need.

Thanks! This is exactly what I need. I have been beating my head against a wall fr this!

Ok. Is there something else I need to do to enable this? I have the following code:

FastNavigation fastNavigation = new FastNavigation<>(orderGrid, false, true);

fastNavigation.addRowEditListener(event -> {
SalesOrder salesOrder = (SalesOrder) event.getItem();
int i = 0;
});

fastNavigation.addCellEditListener(event -> {
Object test = event.getItem();
int i = 1;
});

fastNavigation.addEditorCloseListener(event -> {
int i = 0;
});

Is there something else I need to do to bind this to the grid? None of the events are firing.

Did you recompile the widgetset?

I did a vaadin:update-widgetset but it didnt seem to change anything. Sorry new to having to do this.

Ok. When I go to compile it im getting an issue and failure with the gwt.

com.google.gwt.dev.jjs.InternalCompilerException: Error constructing Java AST
[INFO]
  at com.google.gwt.dev.jjs.impl.GwtAstBuilder.translateException(GwtAstBuilder.java:3980)
[INFO]
  at com.google.gwt.dev.jjs.impl.GwtAstBuilder$AstVisitor.endVisit(GwtAstBuilder.java:1569)
[INFO]
  at org.eclipse.jdt.internal.compiler.ast.MessageSend.traverse(MessageSend.java:1021)
[INFO]
  at org.eclipse.jdt.internal.compiler.ast.LocalDeclaration.traverse(LocalDeclaration.java:307)
[INFO]
  at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.traverse(MethodDeclaration.java:347)
[INFO]
  at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.traverse(TypeDeclaration.java:1379)
[INFO]
  at com.google.gwt.dev.jjs.impl.GwtAstBuilder.processImpl(GwtAstBuilder.java:3916)
[INFO]
  at com.google.gwt.dev.jjs.impl.GwtAstBuilder.process(GwtAstBuilder.java:3954)
[INFO]
  at com.google.gwt.dev.javac.CompilationStateBuilder$CompileMoreLater$UnitProcessorImpl.process(CompilationStateBuilder.java:129)
[INFO]
  at com.google.gwt.dev.javac.JdtCompiler$CompilerImpl.process(JdtCompiler.java:384)
[INFO]
  at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:470)
[INFO]
  at com.google.gwt.dev.javac.JdtCompiler.doCompile(JdtCompiler.java:1092)
[INFO]
  at com.google.gwt.dev.javac.CompilationStateBuilder$CompileMoreLater.compile(CompilationStateBuilder.java:325)
[INFO]
  at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:548)
[INFO]
  at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:479)
[INFO]
  at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:465)
[INFO]
  at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:423)
[INFO]
  at com.google.gwt.dev.Precompile.precompile(Precompile.java:222)
[INFO]
  at com.google.gwt.dev.Precompile.precompile(Precompile.java:202)
[INFO]
  at com.google.gwt.dev.Precompile.precompile(Precompile.java:143)
[INFO]
  at com.google.gwt.dev.Compiler.compile(Compiler.java:204)
[INFO]
  at com.google.gwt.dev.Compiler.compile(Compiler.java:155)
[INFO]
  at com.google.gwt.dev.Compiler.compile(Compiler.java:144)
[INFO]
  at com.google.gwt.dev.Compiler$1.run(Compiler.java:118)
[INFO]
  at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:55)
[INFO]
  at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:50)
[INFO]
  at com.google.gwt.dev.Compiler.main(Compiler.java:125)
[INFO]
 Caused by: java.lang.NoSuchMethodError: org.eclipse.jdt.internal.compiler.ast.MessageSend.binding()Lorg/eclipse/jdt/internal/compiler/lookup/MethodBinding;
[INFO]
  at com.google.gwt.dev.jjs.impl.GwtAstBuilder.isUncheckedGenericMethodCall(GwtAstBuilder.java:4203)
[INFO]
  at com.google.gwt.dev.jjs.impl.GwtAstBuilder.access$1400(GwtAstBuilder.java:250)
[INFO]
  at com.google.gwt.dev.jjs.impl.GwtAstBuilder$AstVisitor.endVisit(GwtAstBuilder.java:1562)
[INFO]
  ... 25 more
[INFO]
    [ERROR]
 at MultiWordSuggestOracle.java(215): toRealSuggestions.get(candidate)
[INFO]
       org.eclipse.jdt.internal.compiler.ast.MessageSend

Ok, that error does not originate from this add-on.

Looks like you have for example dependency conflict with JDT versions due using e.g. JasperReports https://vaadin.com/forum#!/thread/16402419/16402938

Thanks again! Thats exactly what it was. Even was caused by JasperReports as I am using that as well.

Sorry to bother you agan but having an issue and not sure if its me or a bug in FastNavigation.

I have this line that is supposed to add an editable field to the grid. It works find when not using FastNavigation but as soon as I enable FN it stops allowing me to edit the one field. The checkbox fields work fine, but the the textfield.

orderGrid.addColumn(SalesOrder::getQtyDone).setCaption("Done").setWidth(80).setEditorComponent(qtyDone, SalesOrder::setQtyDone);

Thats the code for the column.

This is the FN code:

FastNavigation fastNavigation = new FastNavigation<>(orderGrid, false, true); What am I missing here?