Giter VIP home page Giter VIP logo

gridfastnavigation's Introduction

Published on Vaadin  Directory Stars on Vaadin Directory

GridFastNavigation Add-on for Vaadin 8

Do you like the Grid but would want it to appeal more to old Excel jockeys? Then this add-on is for you! GridFastNavigation is a compnent extension for Vaadin Grid, which uses the unbuffered editing mode and alters its keyboard controls to provide a faster editing experience.

Online demo

Todo

Download release

Official releases of this add-on are available at Vaadin Directory. For Maven instructions, download and reviews, go to https://vaadin.com/directory/component/gridfastnavigation-add-on

JavaDoc

JavaDoc can be found online at

https://vaadin.com/directory/component/gridfastnavigation-add-on/api

Building and running demo

git clone https://github.com/thinwire/GridFastNavigation.git mvn clean install cd GridFastNavigation-demo mvn jetty:run

To see the demo, navigate to http://localhost:8080/

Development with Eclipse IDE

For further development of this add-on, the following tool-chain is recommended:

  • Eclipse IDE
  • m2e wtp plug-in (install it from Eclipse Marketplace)
  • Vaadin Eclipse plug-in (install it from Eclipse Marketplace)
  • Chrome browser

Importing project

Choose File > Import... > Existing Maven Projects

Note that Eclipse may give "Plugin execution not covered by lifecycle configuration" errors for pom.xml. Use "Permanently mark goal resources in pom.xml as ignored in Eclipse build" quick-fix to mark these errors as permanently ignored in your project. Do not worry, the project still works fine.

Debugging server-side

If you have not already compiled the widgetset, do it now by running vaadin:install Maven target for GridFastNavigation-root project.

If you have a JRebel license, it makes on the fly code changes faster. Just add JRebel nature to your GridFastNavigation-demo project by clicking project with right mouse button and choosing JRebel > Add JRebel Nature

To debug project and make code modifications on the fly in the server-side, right-click the GridFastNavigation-demo project and choose Debug As > Debug on Server. Navigate to http://localhost:8080/ to see the application.

Debugging client-side

Debugging client side code in the GridFastNavigation-demo project:

  • run "mvn vaadin:run-codeserver" on a separate console while the application is running
  • activate Super Dev Mode in the debug window of the application or by adding ?superdevmode to the URL
  • You can access Java-sources and set breakpoints inside Chrome if you enable source maps from inspector settings.

Release notes

Version 2.6.4

  • Adjust timing of the focus and selectAll calls.

Version 2.6.3

  • Fix editor column resizing in multiselect mode

Version 2.6.1

  • Fixed possible issue when there is empty data set in grid

Version 2.6.0

  • Do not change row if Alt Shift or Ctrl pressed (see issue #102)
  • Added getKeyCode to EditorOpenEvent (see issue #101)
  • Added isUserOriginated to CellFocusEvent and EditorOpenEvent (see issue #99)

Version 2.5.6

  • Fixed column sizing issues in when using Frozen columns.

Version 2.5.5

  • Fixed NPE in when using Frozen columns.

Version 2.5.4

  • Fixed timing issue if editRow(row,col) was called during Grid is updating after dataProvider.refreshAll()

Version 2.5.3

  • Added some error handling

Version 2.5.2

  • Added method to open Editor at row X in column Y
  • Fix: Disabled column styles were not applied dynamically

Version 2.5.1

  • Grid froze when last column was not editable, fixes issue #98

Version 2.5.0

  • Fixed typo in method name, fixes issue #97
  • Fixed hidden column compensation logic, fixes issue #96
  • Codebase maintenance

Version 2.4.8

  • Add-on also now supports custom editor widgets extending the base set of editors

Version 2.4.7

  • Fixed editor cell resizing logic to work also with multiselect mode.

Version 2.4.6

  • Added option to enable selected style in Editor on selected row
  • Fixed bug in cell focus event not triggered when moving left in multiselect Grid, fixes issue #95

Version 2.4.5

  • Fixed missing implementation of CellEditEvent#getOldData(), see issue #91

Version 2.4.4

  • Fixed CellFocusEvent#wasRowChanged() and CellFocusEvent#wasColumnChanged() to work correctly

Version 2.4.3

  • Added feature: shift+space will select / deselect the row when editor is open, see issue #90

Version 2.4.2

  • Fixed bug: In edit events item and row index were not correct or in sync in certain corner cases

Version 2.4.1

  • Made OffsetHelper serializable, to address issue #86
  • Fixed JavaDocs

Version 2.4.0

  • Added support for NativeSelect, ColorPicker and TextArea
  • Improved setFocusedCell(..) to address issue #77

Version 2.3.10

  • Improvement: issue #82 add helper to deal with custom selection models that change internal column calculation
  • Added fault checkign to setFocusedCel due issue #77 and setChangeColumnOnEnter methods
  • Improved JavaDocs

Version 2.3.9

  • Fix: Grid scroll bar width was not taken into account in Editor resizing

Version 2.3.8

  • Further improvement to row validation mode

Version 2.3.7

  • Improvement to row validation mode

Version 2.3.6

Version 2.3.5

Version 2.3.4

  • Fixed bug: Problem with sorting, edit event did not return right item (issue #76).
  • Improvement: Home/End key behavior can be disabled with setHomeEndEnabled(false) (issue #75)
  • New feature: Move focus programmatically with setFocusedCel(row,col) (issue #68)
  • Updated demo

Version 2.3.3

  • Fixed bug: Client side exception occurred when there were hidden columns (issue #74).

Version 2.3.2

  • Added convenience method disableAllColumns() in EditorOpenEvent (issue #27)
  • Fixed bug: Editor opening was jammed if there were no editable columns

Version 2.3.1

  • Fixed bug: Tabing out of bounds caused client side exception.

Version 2.3.0

  • Added preliminary support for hidden columns, fixes issue #71
  • Minor improvements in setRowValidation(true) mode
  • Updated demo

Version 2.2.4

  • Fix bug: Clicking outside Grid when setRowValidation(true) closed editor

Version 2.2.3

  • Improvements to full row validation (see issues #69 and #51), with setRowValidation(..) API

Version 2.2.2

  • Making possible to have full row validation (see issues #69 and #51)
  • Updated demo

Version 2.2.1

  • Fixing issue #67: ESC-Click combination froze editor

Version 2.2.0

  • Fixed issue #65: Column indeces where off by one with multiselect model, and column disabling did not work
  • Changed behavior, FastNavigation will no longer force Editor to be enabled

Version 2.1.20

  • Fixed issue #64: RowEditEvent fired after ESC-key

Version 2.1.19

  • Fixed issue #63: Numpad input was not filttered properly

Version 2.1.18

  • Fixed serialization issue
  • Made EditorWidgets.registerHandler(..) public so that it is possible to add your custom editor widget handlers, and added java docs.
  • Fix: Selection of the ComboBox textfield was missing

Version 2.1.17

  • Fix: Do not fire ClickOutEvent if ComboBox or DateField is open.

Version 2.1.16

  • Returned disableColumns(..) to EditorOpenEvent. It can be used to disable additional columns from editing.

Version 2.1.15

  • Fix, clickOutListener did not work if FastNavigation was not instantiated with dispatchEditEventOnBlur=true parameter (issue: #54)

Version 2.1.14

  • Fix, disabled columns / readonly fields detection logic was flawed (see: issue #55)
  • Fixing internal columns handling (see: issue #50)
  • Fix, Internal method to get item for events, did NPE with empty DataProvider (see: issue #56)

Version 2.1.13

  • Bugfix, cursor up/down did not open ComboBox in IE11

Version 2.1.12

  • Fixing issue #52

Version 2.1.11

  • Added possibility to add save shortcuts (see: issue #49)
  • setSaveWithCtrlS(true) -> CTRL+S does save and close editor

Version 2.1.10

  • Solving issue #42: Clarifying setOpenEditorWithSingleClick(true) JavaDoc. Using it will prevent Grid's item click event and selection event getting the click.

Version 2.1.9

  • Changed getItem() in selected events to use DataCommunicator, requires Vaadin 8.2+

Version 2.1.8

  • Added ClickOutListener

Version 2.1.7

  • Changed widgetset.xml filename, Fixed issues #40, #41

Version 2.1.6

  • Modified CellFocusEvent and RowFocusEvent to return -1 if focus is in Header/Footer
  • Updated JavaDocs

Version 2.1.5

  • Added getItem() to RowFocusEvent and CellFocusEvent
  • Minor bugfix, there was regression in fix for issue #35

Version 2.1.4

  • Added getItem() CellEditEvent and RowEditEvent (experimental)
  • Fixed issue #37: Enter now saves the value when closing the editor in the last cell
  • Fixed issue #35: Listeners should be able to be used automatically now.
  • DeleteButtonRenderer deprecated, it is now maintained in Grid RenderersCollection add-on.
  • Updated the demo.

Version 2.1.3

  • Added support for closing Editor and dispatching event when clicking outside of Grid.

Version 2.1.2

  • DeleteButtonRenderer, made it boolean type, so that property underneath controls whether the button is enabled or not

Version 2.1.1

  • Fixed DeleteButtonRenderer: Html content mode support in client side was missing
  • Demo updated

Version 2.1.0

  • Added DeleteButtonRenderer
  • Demo updated

Version 2.0.0

  • First version for Vaadin 8
  • Features on par with version 0.5.7
  • Demo updated

Issue tracking

The issues for this add-on are tracked on its github.com page. All bug reports and feature requests are appreciated.

Contributions

Contributions are welcome, but there are no guarantees that they are accepted as such. Process for contributing is the following:

  • Fork this project
  • Create an issue to this project about the contribution (bug or feature) if there is no such issue about it already. Try to keep the scope minimal.
  • Develop and test the fix or functionality carefully. Only include minimum amount of code needed to fix the issue.
  • Refer to the fixed issue in commit
  • Send a pull request for the original project
  • Comment on the original issue that you have implemented a fix for it

License & Author

Add-on is distributed under Apache License 2.0. For license terms, see LICENSE.txt.

GridFastNavigation is written by Patrik Lindstrรถm, Tatu Lund and Johannes Tuikkala and maintained by the Tatu. Vaadin 8 migration initial work was contributed by Brett Sutton.

Major pieces of development of this add-on has been sponsored by multiple Support and Prime customers of Vaadin. See vaadin.com/support and Development on Demand for more details.

gridfastnavigation's People

Contributors

bsutton avatar dependabot[bot] avatar tatulund avatar thevaadinman avatar wbadam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gridfastnavigation's Issues

Quick-Delete value

It might be useful if a user could quick-delete a cell-value by pressing del or backspace. The former could delete+autocommit the value whereas the later deletes the value and starts the edit-mode. Just as Excel does.

IndexOutOfBoundsException with RowFocusListener and empty Grid

More a minor annoyance ^^
Issue only occurs, if you have an empty grid with the initialized extension and an added RowFocusListener.
If you change the selectionMode of the grid, an IndexOutOfBoundsException is thrown, when component is rendered.

Throws exception

final Grid<String> grid = new Grid<>();
grid.addColumn(String::length).setCaption("length");

final FastNavigation<String> fastNavigation = new FastNavigation<>(grid);
grid.setSelectionMode(Grid.SelectionMode.MULTI); // after constructor

fastNavigation.addRowFocusListener(event -> log.info("{}", event.getRow()));
grid.setItems(Collections.emptyList());
//        grid.setItems(Collections.singleton("say hello"));

Works fine

final Grid<String> grid = new Grid<>();
grid.addColumn(String::length).setCaption("length");

grid.setSelectionMode(Grid.SelectionMode.MULTI); // before constructor
final FastNavigation<String> fastNavigation = new FastNavigation<>(grid);

fastNavigation.addRowFocusListener(event -> log.info("{}", event.getRow()));
grid.setItems(Collections.emptyList());
//        grid.setItems(Collections.singleton("say hello"));

This all happens at client side when FocusTracker#notifyFocusMoved is called. I don't know the exactly reason, but currentRow is set to 0 in that case.

So the serverRPC#getItemAt(0) in FastNavigation tries to load the first item of an empty collection.

        registerRpc(new FastNavigationServerRPC() {

        	private T getItemAt(int rowIndex) { // << is 0 in that case
        		T myBean = null;
        		if (rowIndex >= 0) {
        			myBean = g.getDataCommunicator().fetchItemsWithRange(rowIndex, 1).get(0);
        		}
        		return myBean;
        	}

Quit edit mode, when clicking on selection check box

In a Grid with multi select set on you get this selection checkboxes on the left. But if you're in edit mode, you can't select an row anymore, you have to quit edit mode first.

What do you think about quitting edit mode automatically, when clicking on a selection check box? Like when clicking outside the grid.

Widgetset compilation every time

Hi,
Since I added your addon to my project, my widgetset gets compiled every single time I build the project. This didnt happened before (and should not happend). Can you take a look at this? Its quite annoying and time consuming.
Im using Vaadin 8.1.6.
Thanks!

Widgetset compilation exception

An internal compiler exception occurred
com.google.gwt.dev.jjs.InternalCompilerException: Unexpected error during visit.
at com.google.gwt.dev.js.ast.JsVisitor.translateException(JsVisitor.java:482)
at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:469)
at com.google.gwt.dev.js.ast.JsModVisitor$NodeContext.traverse(JsModVisitor.java:153)
at com.google.gwt.dev.js.ast.JsModVisitor.doAccept(JsModVisitor.java:176)
at com.google.gwt.dev.js.ast.JsVisitor.accept(JsVisitor.java:109)
at com.google.gwt.dev.js.ast.JsInvocation.traverse(JsInvocation.java:88)
at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:467)
at com.google.gwt.dev.js.ast.JsModVisitor$NodeContext.traverse(JsModVisitor.java:153)
at com.google.gwt.dev.js.ast.JsModVisitor.doAccept(JsModVisitor.java:176)
at com.google.gwt.dev.js.ast.JsVisitor.accept(JsVisitor.java:109)
at com.google.gwt.dev.js.ast.JsVars$JsVar.traverse(JsVars.java:64)
at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:467)
at com.google.gwt.dev.js.ast.JsModVisitor$ListContext.traverse(JsModVisitor.java:80)
at com.google.gwt.dev.js.ast.JsModVisitor.doAcceptWithInsertRemove(JsModVisitor.java:197)
at com.google.gwt.dev.js.ast.JsVisitor.acceptWithInsertRemove(JsVisitor.java:121)
at com.google.gwt.dev.js.ast.JsVars.traverse(JsVars.java:104)
at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:467)
at com.google.gwt.dev.js.ast.JsModVisitor$ListContext.traverse(JsModVisitor.java:80)
at com.google.gwt.dev.js.ast.JsModVisitor.doAcceptWithInsertRemove(JsModVisitor.java:197)
at com.google.gwt.dev.js.ast.JsVisitor.acceptWithInsertRemove(JsVisitor.java:121)
at com.google.gwt.dev.js.ast.JsBlock.traverse(JsBlock.java:53)
at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:467)
at com.google.gwt.dev.js.ast.JsModVisitor$NodeContext.traverse(JsModVisitor.java:153)
at com.google.gwt.dev.js.ast.JsModVisitor.doAccept(JsModVisitor.java:176)
at com.google.gwt.dev.js.ast.JsVisitor.accept(JsVisitor.java:109)
at com.google.gwt.dev.js.ast.JsFunction.traverse(JsFunction.java:181)
at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:467)
at com.google.gwt.dev.js.ast.JsModVisitor$NodeContext.traverse(JsModVisitor.java:153)
at com.google.gwt.dev.js.ast.JsModVisitor.doAccept(JsModVisitor.java:176)
at com.google.gwt.dev.js.ast.JsVisitor.accept(JsVisitor.java:109)
at com.google.gwt.dev.jjs.impl.GwtAstBuilder$AstVisitor.processNativeMethod(GwtAstBuilder.java:3230)
at com.google.gwt.dev.jjs.impl.GwtAstBuilder$AstVisitor.endVisit(GwtAstBuilder.java:1577)
at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.traverse(MethodDeclaration.java:360)
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.traverse(TypeDeclaration.java:1360)
at com.google.gwt.dev.jjs.impl.GwtAstBuilder.processImpl(GwtAstBuilder.java:3916)
at com.google.gwt.dev.jjs.impl.GwtAstBuilder.process(GwtAstBuilder.java:3954)
at com.google.gwt.dev.javac.CompilationStateBuilder$CompileMoreLater$UnitProcessorImpl.process(CompilationStateBuilder.java:129)
at com.google.gwt.dev.javac.JdtCompiler$CompilerImpl.process(JdtCompiler.java:384)
at org.eclipse.jdt.internal.compiler.Compiler.processCompiledUnits(Compiler.java:546)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:458)
at com.google.gwt.dev.javac.JdtCompiler.doCompile(JdtCompiler.java:1092)
at com.google.gwt.dev.javac.CompilationStateBuilder$CompileMoreLater.compile(CompilationStateBuilder.java:325)
at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:548)
at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:479)
at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:465)
at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:423)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:222)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:202)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:143)
at com.google.gwt.dev.Compiler.compile(Compiler.java:204)
at com.google.gwt.dev.Compiler.compile(Compiler.java:155)
at com.google.gwt.dev.Compiler.compile(Compiler.java:144)
at com.google.gwt.dev.Compiler$1.run(Compiler.java:118)
at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:55)
at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:50)
at com.google.gwt.dev.Compiler.main(Compiler.java:125)
Caused by: java.lang.ClassCastException: com.google.gwt.dev.jjs.ast.JClassType cannot be cast to com.google.gwt.dev.jjs.ast.JInterfaceType
at com.google.gwt.dev.jjs.impl.ReferenceMapper.get(ReferenceMapper.java:160)
at com.google.gwt.dev.jjs.impl.ReferenceMapper.createMethod(ReferenceMapper.java:246)
at com.google.gwt.dev.jjs.impl.ReferenceMapper.get(ReferenceMapper.java:110)
at com.google.gwt.dev.jjs.impl.GwtAstBuilder$AstVisitor$JsniReferenceCollector.endVisit(GwtAstBuilder.java:315)
at com.google.gwt.dev.js.ast.JsNameRef.traverse(JsNameRef.java:113)
at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:467)
... 54 more
at GridViolators.java(38): [email protected]::getBody()
com.google.gwt.dev.js.ast.JsNameRef
at GridViolators.java(38): [email protected]::getBody()()
com.google.gwt.dev.js.ast.JsInvocation
at GridViolators.java(38): conBody = [email protected]::getBody()()
com.google.gwt.dev.js.ast.JsVars$JsVar
at GridViolators.java(38): var conBody = [email protected]::getBody()()
com.google.gwt.dev.js.ast.JsVars
at GridViolators.java(33): {
var cfh = [email protected]::cellFocusHandler;
var row = [email protected]::rowWithFocus;
var contWithFocus = [email protected]::containerWithFocus;
var escallator = [email protected]::getEscalator()();
[...]
}

com.google.gwt.dev.js.ast.JsBlock
at GridViolators.java(33): function(grid){
var cfh = [email protected]::cellFocusHandler;
var row = [email protected]::rowWithFocus;
var contWithFocus = [email protected]::containerWithFocus;
var escallator = [email protected]::getEscalator()();
[...]
}

com.google.gwt.dev.js.ast.JsFunction
at GridViolators.java(33): public static final native int getFocusedRow(Grid<?> grid);
org.eclipse.jdt.internal.compiler.ast.MethodDeclaration

Ability to add save shortcuts

I can add shortcuts to close the editor. But unfortunately that discards the changes I made. I'd like to have a addEditorSaveShortcut(..).

Deleting a row cause grid ui to lock.

I've just made a pull request which enhances the demo grid with a delete button on each row.

I've added the button for two reasons:

  1. to show what I think is a good base line for a demo (add/delete and edit rows)
  2. to demonstrate a bug I'm coming across in multiple situations.
    I finding very easy to hang the grid ui.
    The grid stops responding to clicks so you can edit any more.

To reproduce this run up the demo grid app.
Starting from the bottom delete the bottom two rows.
After you have deleted the two rows the UI will lock up.

I do note a number of errors in the chrome console that whilst need fixing probably arn't the problem.

This error occurs when you click delete the first time.
com.vaadin.client.communication.MessageHandler
SEVERE: Error performing server to client RPC calls
java.lang.IndexOutOfBoundsException: No such logical index: 4
at Unknown.Eg(org.vaadin.patrik.demo.DemoWidgetSet-0.js)
at Unknown.Gg(org.vaadin.patrik.demo.DemoWidgetSet-0.js)
at Unknown.Drd(org.vaadin.patrik.demo.DemoWidgetSet-0.js)

SEVERE: Warning: your widget set seems to be built with a different version than the one used on server. Unexpected behavior may occur.

com.vaadin.client.communication.MessageSender
SEVERE: Trying to start a new request while another is activeUab @ org.vaadin.patrik.demo.DemoWidgetSet-0.js:5970TGd @ org.vaadin.patrik.demo.DemoWidgetSet-0.js:5508SGd @ org.vaadin.patrik.demo.DemoWidgetSet-0.js:3491YGd @ org.vaadin.patrik.demo.DemoWidgetSet-0.js:3084aHd @ org.vaadin.patrik.demo.DemoWidgetSet-0.js:2116aGb @ org.vaadin.patrik.demo.DemoWidgetSet-0.js:4622WFb @ org.vaadin.patrik.demo.DemoWidgetSet-0.js:5498VFb @ org.vaadin.patrik.demo.DemoWidgetSet-0.js:4461m$c @ org.vaadin.patrik.demo.DemoWidgetSet-0.js:5362f_c @ org.vaadin.patrik.demo.DemoWidgetSet-0.js:5981(anonymous function) @ org.vaadin.patrik.demo.DemoWidgetSet-0.js:5612Sh @ org.vaadin.patrik.demo.DemoWidgetSet-0.js:2469Vh @ org.vaadin.patrik.demo.DemoWidgetSet-0.js:5128(anonymous function) @ org.vaadin.patrik.demo.DemoWidgetSet-0.js:3588
org.vaadin.patrik.demo.DemoWidgetSet-0.js:5970 Fri Aug 04 22:04:32 GMT+1000 2017 com.vaadin.client.communication.MessageSender
SEVERE: No active requestUab @ org.vaadin.patrik.demo.DemoWidgetSet-0.js:5970TGd @ org.vaadin.patrik.demo.DemoWidgetSet-0.js:5508SGd @ org.vaadin.patrik.demo.DemoWidgetSet-0.js:3491YGd @ org.vaadin.patrik.demo.DemoWidgetSet-0.js:3084aHd @

WARNING: EditorWidgets.enable: Widget is null

WARNING: Editor bind action is taking longer than expected (5000ms). Does your EditorHandler remember to call success() or fail()?

Entering numbers with dedicated number block results in letters instead of numbers

I have a grid with an editable column where I can enter only numbers. Now, if I focus on that cell and push '4' on my keyboard (the one above 'e' and 'r'), the grid goes automatically in edit mode and the entered '4' appears in the cell. That's cool.

Now I have a keyboard with a separated number block. If I NumLock it and do the same with the '4' on the number block. Guess what? I get a 'd' instead of '4'. Funny, isn't it?

Provide ability to dynamically add rows when on last row.

I would like the ability for the grid to add a new row if the user is on the last row but I'm not certain of the best UI/API to do this.

One thought is that if the the grid is in tab mode, where the tab key moves between columns and the enter key moves between rows.
In this mode we could allow a row listener of some sort to detect if the user hits enter when in the last row.
A callback would then allow the host application to create the new row (or at least the row entity).
The row would magically appear and we would move the cursor to the next row.

Thoughts on how whether you like the above design?

Selecting ComboBox item outside grid quits edit mode

I have a grid, extended with FastNavigation, configured with dispatchEditEventOnBlur = true. One column of the grid is edited thru a ComboBox. If this ComboBox has many items, it's possible that it's selection list overlaps the grid's border. If I select an item outside the grid's border with the mouse, the edit mode is closed and no item is selected.

My workaround for the moment is dispatchEditEventOnBlur = false, but if you had a solution other than that, I'd be very happy :-).

How to disable editing column only in one row?

This code does not work with the plugin:

editor.addOpenListener(event -> {
    editorField.setEnabled(event.getBean().isEditingAllowed());
});

This is because the plugin resets the state of the fields

// Reset all editor widgets to enabled
for (int i = 0, l = grid.getVisibleColumns().size(); i < l; ++i) {
EditorWidgets.enable(getEditorWidgetForColumn(i));
}

How can this problem be solved?

CellEditListener won't trigger

symptom

I hope I'm wrong, but as I see there is no example for "addCellEditListener" and its usage.
I try to use it but it never trigger the event.

problem

Btw, my problem is that if I left a cell empty, when I navigate to another cell in this row, the editor filled with "null" value, even if I catch it in cell focus listener and set the value to 0 for example.

sidenote

It would be better if I can use the editor converters or null representation stuffs, but as I see I cant configure the editor fields.

Enter key row or column

Best regard.

As I can enable from the application enter key in rows or columns, I need both options. I have windows with enter key on the rows and others on the columns. Then I would need to make the settings in my application.

Thank you

Row duplication in default widgetset xml at compile time

Hi,

as you can see at this thread on Vaadin forum, there is a common bug of its widgetset builder. It searches the string "widgetset" inside the file name of your xml file, and if it doesn't find anything it duplicates this row every time:

<inherits name="org.vaadin.patrik.GridFastNavigation"/>

so could you change your xml file name to avoid this behaviour?

Thanks!

WidgetHandlers for custom widgets

Is there any reason, why EditorWidgets#registerHandler is private?

Would be much easier (less magic), if this would be public or at least package private

"Anykey" to fast-edit data does not work properly in date fields

Although the anykey initiates the edit process for a date field, the typed value does not override the existing value like it is the case with the text field. Say I want to change the date to "24." ... something, than "2" triggers the edit mode, the new value is "4". If it was a text field, the value would be "24." ... something. Maybe the date field should behave similar to the other fields?

Error while compilation widget set

Unable to find 'com/vaadin/terminal/gwt/DefaultWidgetSet.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?

Need ability to programatically close editor from server side.

I'm trying to add a method to add a new row to the grid.

The problem is that if the editor is open when I add the new row the whole UI locks up.

So I thought the best method to fix this was to close the editor from the server side.

I exposed the 'closeEditor' method via a server side rpc. But the editor still doesn't close.

What is the correct method to close the editor?

Listeners are dependent on each other

There seems to be some bugs in the way listeners are being added. Everything works ok, when you have all them in use.

CellFocusListener wont work without RowFocusListener

RowEditListener wont work without CellFocusListener and EditorOpenListener

EditorCloseListener seems not be connected.

Uneditable rows in Grid

Hi,
I need some option to deny to open editor on some rows in grid -> I need some uneditable rows in grid.

I tried some workaround with disabling all the columns on the row, but it doesn't work well. Actually the navigation over the grid crashes on row like that, or focus goes to some editor component (more accurately to the comboBox field of ExtendedTokenField https://vaadin.com/directory#!addon/extended-token-field, which I use).

I still need to be able to select that row, but without editing it.

Do you think you can help me somehow?
Thank you for your answer.
Milan

ComboBox cells missing dropdown after setvalue

vaadin 8.3.1
gridfastnavigation: 2.1.10

after setting a value for a ComboBox that is bound to a column, I can no longer select other items from the dropdown (because it wont open). It works fine when no value is set. After changing the row, the value is set and I'm no longer able to modify the value of the previous row.

Works as expected without the extension.

does not compile with Vaadin 8.1.1

[ERROR] An internal compiler exception occurred
com.google.gwt.dev.jjs.InternalCompilerException: Error constructing Java AST
at com.google.gwt.dev.jjs.impl.GwtAstBuilder.translateException(GwtAstBuilder.java:3980)
at com.google.gwt.dev.jjs.impl.GwtAstBuilder.getInternalCompilerException(GwtAstBuilder.java:4387)
at com.google.gwt.dev.jjs.impl.GwtAstBuilder.createMembers(GwtAstBuilder.java:4079)
at com.google.gwt.dev.jjs.impl.GwtAstBuilder.processImpl(GwtAstBuilder.java:3912)
at com.google.gwt.dev.jjs.impl.GwtAstBuilder.process(GwtAstBuilder.java:3954)
at com.google.gwt.dev.javac.CompilationStateBuilder$CompileMoreLater$UnitProcessorImpl.process(CompilationStateBuilder.java:129)
at com.google.gwt.dev.javac.JdtCompiler$CompilerImpl.process(JdtCompiler.java:384)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:470)
at com.google.gwt.dev.javac.JdtCompiler.doCompile(JdtCompiler.java:1092)
at com.google.gwt.dev.javac.CompilationStateBuilder$CompileMoreLater.compile(CompilationStateBuilder.java:325)
at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:548)
at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:479)
at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:465)
at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:423)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:222)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:202)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:143)
at com.google.gwt.dev.Compiler.compile(Compiler.java:204)
at com.google.gwt.dev.Compiler.compile(Compiler.java:155)
at com.google.gwt.dev.Compiler.compile(Compiler.java:144)
at com.google.gwt.dev.Compiler$1.run(Compiler.java:118)
at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:55)
at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:50)
at com.google.gwt.dev.Compiler.main(Compiler.java:125)
Caused by: java.lang.NoSuchMethodError: org.eclipse.jdt.internal.compiler.lookup.MethodBinding.isDefaultMethod()Z
at com.google.gwt.dev.jjs.impl.GwtAstBuilder.createMethod(GwtAstBuilder.java:4174)
at com.google.gwt.dev.jjs.impl.GwtAstBuilder.createMembers(GwtAstBuilder.java:4069)
... 21 more
[ERROR] at OverflowEvent.java(30): public interface OverflowEvent extends Event
org.eclipse.jdt.internal.compiler.ast.TypeDeclaration

RowEditListener not working

Version: 0.2.1

Back in "the olden days" (Version 0.1.x) there was but one event listener, the FastNavigationListener. One of it's features was "only propagate update events, be silent if the user is just 'skipping rows'".

Nowadays there are many event listeners for all kinds of purposes. Which I think is a good thing. Alas, the one dedicated to "actual updates", the RowEditListener appears to be broken. Or I misunderstood it's purpose. Also entirely possible.

Check out the 0.2.1 online demo. In DemoUI:100 you add a new RowEditListener. Thus I would expect that printChangedRow() in DemoUI:168 gets triggered once I update a row ( writeOutput("Row " + rowIndex + " changed to: " + sb.toString());).
However, I never receive these events.
noupdate

I can "workaround" that issue by utilizing the EditorCloseListener BUT it can not distinguish between a "skip" and a "change". Which kind of brakes the original addon's intend :)

Pressing Enter changes columns after 2/3 rows

In the Demo Press F2 on Row 3, Col 3 and go on pressing Enter
at some point of time , cursor moves to col4 and pressing Enter again it moves to Col5 and so on.

Can you please check and let us know whether it is intended behaviour based on some condition
or is it a bug.

Disable Editor-Widgets

I'm not sure, if this is a bug, or just own disability ^^

I want to disable an editor-widget under some circumstances. I added an OpenListener to the editor to check the condition and disable the CheckBox

getEditor().addOpenListener(event -> {
            boolean enabled = !event.getBean().isRequired();
            activeCheckBox.setEnabled(enabled);
        });

But even if the CheckBox should be disabled, the EditorStateManager enables the CheckBox in the #waitForEditorOpen-> complete() Method of the Callback, because this column is not in the disabledColumns

Is there any other possibility to disable this CheckBox ?!

Support for Vaadin 7.7.7

Addon is not working in Vaadin 7.7.7. Are you going to support this version ?
I tried your demo, in pom I changed vaadin to version 7.7.7 and I got errors when i executed mvn jetty:run

Error message:

[INFO] [ERROR] Errors in 'jar:file:/C:/Users/Juraj/.m2/repository/org/vaadin/patrik/GridFastNavigation/0.2.1/GridFastNavigation-0.2.1.jar!/org/v
aadin/patrik/client/GridViolators.java'
[INFO] [ERROR] Line 47: Referencing field 'com.vaadin.client.widgets.Grid.Editor.focusedColumnIndex': unable to resolve field in class 'com.v
aadin.client.widgets.Grid.Editor'
[INFO] [ERROR] Aborting compile due to errors in some input files

vaading 8 version allows user to cursor 'off' grid.

The vaadin 8 version allows a user to use the 'UP' arrow to cursor off the top of the grid.

The problem is that the editor isn't closed when you go up into the header.
Additionally if you cursor up again you are left in no mans land (e.g. no visual focus) and it can take a random number of down arrows to get back to the grid. (i.e. the number of down arrows doesn't equate to the no. of time you up arrowed.

The same problem exists at the bottom of the grid in that you can cursor of the bottom (need to reduce the no. of rows to easily see this).

Add support for 'action buttons'

I have a requirement to allow a user to delete rows in the grid.

I've added a 'delete' button into a cell in the grid and it almost works.
The delete button allows me to click and delete a row, the problem is that it then puts me into edit mode on the current row (that is the current row after the grid rows collapse up into the deleted row as expected).

How do I stop the row going into edit mode when I click a button.

Supporting this mode seems generically useful for any set of action buttons in a row.

Overlay of icon

image
image
First image is of a Vaadin 8.3.1 Grid without FastNavigation. Second is with FastNavigation. The trash can icon in the second the not visible.

vaadin 8 support

Whats the chance of getting vaadin 8 support for this add on?

Subsequent columns sometimes "appear" not to be marked

With this addon comes the feature that columns will be automatically "marked" so the user needs but to type in order to change any given value (instead of deleting it manually). I noticed that occasionally the next value "appears" not to be highlighted, although it actually is. I tried to capture this hiere:
invisible mark
I initiated the edit mode by "directly typing in a new value" (the 'wasd' in the picture). The second (and sometimes even the third) value will usually not be marked, although they are.
This might be confusing for some.

GWT Compiler Exception for Vaadin 8.3.x

Using Vaadin 8.3.x the gwt-compiler (2.8.2) seems to dislike the native Java-code in GridViolators.

Caused by: java.lang.ClassCastException: com.google.gwt.dev.jjs.ast.JClassType cannot be cast to com.google.gwt.dev.jjs.ast.JInterfaceType
        at com.google.gwt.dev.jjs.impl.ReferenceMapper.get(ReferenceMapper.java:160)
        at com.google.gwt.dev.jjs.impl.ReferenceMapper.createMethod(ReferenceMapper.java:246)
        at com.google.gwt.dev.jjs.impl.ReferenceMapper.get(ReferenceMapper.java:110)
        at com.google.gwt.dev.jjs.impl.GwtAstBuilder$AstVisitor$JsniReferenceCollector.endVisit(GwtAstBuilder.java:315)
        at com.google.gwt.dev.js.ast.JsNameRef.traverse(JsNameRef.java:113)
        at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:467)
        ... 54 more
   [ERROR] at GridViolators.java(38): [email protected]::getBody()
      com.google.gwt.dev.js.ast.JsNameRef
   [ERROR] at GridViolators.java(38): [email protected]::getBody()()
      com.google.gwt.dev.js.ast.JsInvocation
   [ERROR] at GridViolators.java(38): conBody = [email protected]::getBody()()
      com.google.gwt.dev.js.ast.JsVars$JsVar
   [ERROR] at GridViolators.java(38): var conBody = [email protected]::getBody()()
      com.google.gwt.dev.js.ast.JsVars
   [ERROR] at GridViolators.java(33): {
  var cfh = [email protected]::cellFocusHandler;
  var row = [email protected]::rowWithFocus;
  var contWithFocus = [email protected]::containerWithFocus;
  var escallator = [email protected]::getEscalator()();
  [...]
}

      com.google.gwt.dev.js.ast.JsBlock
   [ERROR] at GridViolators.java(33): function(grid){
  var cfh = [email protected]::cellFocusHandler;
  var row = [email protected]::rowWithFocus;
  var contWithFocus = [email protected]::containerWithFocus;
  var escallator = [email protected]::getEscalator()();
  [...]
}

      com.google.gwt.dev.js.ast.JsFunction
   [ERROR] at GridViolators.java(33): public static final native int getFocusedRow(Grid<?> grid);
      org.eclipse.jdt.internal.compiler.ast.MethodDeclaration

Single click event setting

Hi,
first, thanks for great addon.
I have some spectial requiriments for grid component.
I found double click for opening editor useful, because I use selection in the grid.
Could please make the "single click to open editor" feature optional?

I'm using GridFastNavigation version 0.5.6 for Vaadin 7.7.7.
Thank you for response.
Milan

New contributions

Hi patrick, Thanks for the improvements made. I have two new contributions:

  1. When I am in the last row I want the focus to go to the next column first row enter key.

  2. Allow summary of columns setEditable(false); By pressing the enter key to the next column.
    Example
    Add code in method initGrid
    grid.getColumn("col7").setEditable(false);

    Add code in method printChangedRow
    int sum = Integer.valueOf(ds.getItem(itemId).getItemProperty("col3").getValue().toString())
    + Integer.valueOf(ds.getItem(itemId).getItemProperty("col4").getValue().toString())
    + Integer.valueOf(ds.getItem(itemId).getItemProperty("col5").getValue().toString())
    + Integer.valueOf(ds.getItem(itemId).getItemProperty("col6").getValue().toString());

     ds.getItem(itemId).getItemProperty("col7").setValue(sum);
    

Thanks

SelectionListener on Grid not working after using FastNavigation

Hi,
if using this extension I no longer can use the itemClickListener or selectionListener from the Grid object. My application needs to know the currently selected row to be able to switch to an edit mode in which the FastNavigation is used to edit the dataset (the default vaadin behaviour using a doubleclick is driving me nuts).

So it would be nice to still have the selection event available, I also can work with an method implemented in FastNavigation itself.

using Vaadin 8.2.1 and FastNavigation 2.1.9

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.