vaadin / framework

Vaadin 6, 7, 8 is a Java framework for modern Java web applications.
http://vaadin.com/
Other
1.78k stars 729 forks source link

addSortHandler not working in vaadin8 #9538

Closed WilliamAnthony closed 4 years ago

WilliamAnthony commented 7 years ago

Vaadin 8.0.5 I used the following example code in vaadin7, but it's not working after upgrade to vaadin8

package com.nanosoft.nanolib.ui.extension.gridautoresize.client;

import com.google.gwt.user.client.*;
import com.vaadin.client.*;
import com.vaadin.client.extensions.*;
import com.vaadin.shared.ui.*;
import com.vaadin.client.widget.escalator.*;
import com.vaadin.client.widget.grid.sort.*;

@SuppressWarnings("serial")
@Connect(com.nanosoft.nanolib.ui.extension.gridautoresize.gridAutoResize.class)
public class gridAutoResizeConnector extends AbstractExtensionConnector implements SortHandler<Object> {
    private com.vaadin.client.widgets.Grid<Object> _grid;

    @SuppressWarnings("unchecked")
    @Override
    protected void extend(ServerConnector target) {
        _grid = (com.vaadin.client.widgets.Grid<Object>) ((ComponentConnector) target).getWidget();

        _grid.addSortHandler(this);
    }

    @Override
    public void sort(SortEvent<Object> event) {
        _grid.recalculateColumnWidths();
    }
}

the sort method is not executed.

hesara commented 7 years ago

The only potential issue I noticed is that now the client side Grid is effectively of type Grid<JsonObject> rather than Grid<Object>, which might or might not be related to this.

Otherwise, I'd recommend trying to debug the client side class using SuperDevMode and Chrome (and making sure assertions are enabled). That way, you can put a breakpoint in both methods and see if they are called at appropriate times.

stale[bot] commented 6 years ago

Hello there!

It looks like this issue hasn't progressed lately. There are so many issues that we just can't deal them all within a reasonable timeframe.

There are a couple of things you could help to get things rolling on this issue (this is an automated message, so expect that some of these are already in use):

Thanks again for your contributions! Even though we haven't been able to get this issue fixed, we hope you to report your findings and enhancement ideas in the future too!

stale[bot] commented 4 years ago

The issue was automatically closed due to inactivity. If you found some new details to it or started working on it, comment on the issue so that maintainers can re-open it.