Update Grid not working

Hello,

I am trying to do something simple where I am listening for a new “tick” , with it I recalculate the column “PL” inside of my grid.
However I can see in the console how the ticks are coming but the grid never refresh the content. Should not be refreshed automatically with getDataProvider? any way I am creating a new grid instance all the time, why It never change ? ideas?

  @JmsListener(destination = "tick-channel", containerFactory = "jmsFactory")
  public void receiveMessage(final Tick tick) {
    positions(tick.getClose());
  }
  
  /**
   * @param price price
   */
  private void positions(final BigDecimal price) {
    positionGrid.setItems(
        positionRepository
            .findAllBySideIsInOrderByCreatedDateDesc(
                EnumSet.of(
                    ESide.BUY,
                    ESide.SELL
                )
            )
    );

    positionGrid.setColumns();
    positionGrid.addColumn(p -> formatter.format(p.getQuantity())).setHeader("Quantity").setSortable(true);
    positionGrid.addColumn(p -> formatter.format(p.getCost())).setHeader("Cost").setSortable(true);
    positionGrid.addColumn(p -> {
      LOGGER.info(formatter.format(positionService.calculatePL(p, price)));
      return formatter.format(positionService.calculatePL(p, price));
    }).setHeader("PL").setSortable(true);
    positionGrid.addColumn(p -> format.format(p.getLastModifiedDate())).setHeader("Last update").setSortable(true);
    positionGrid.getDataProvider().refreshAll();
  }

The grid is added before into a layout.addComponent:

    layout = new SplitLayout();
    layout.setSizeFull();
    layout.setOrientation(SplitLayout.Orientation.HORIZONTAL);
    layout.addToPrimary(tradingView);
    layout.addToSecondary(positionGrid);

Have you enabled Push in your UI with @Push annotation?

Tatu Lund:
Have you enabled Push in your UI with @Push annotation?

Thanks for that! yes that was the problem. Now the fronted has this error, I need to investigate

TypeError: Cannot read property 'parentNode' of null

Are you using Vaadin 11/10? Have you checked this https://github.com/vaadin/vaadin-grid/issues/1189 ?

Tatu Lund:
Are you using Vaadin 11/10? Have you checked this https://github.com/vaadin/vaadin-grid/issues/1189 ?

I use vaadin 11, I also check with vaadin 10 but the error continues and annotation @Push