0

There are two listeners:

table.addListener(new ItemClickListener() {
    public void itemClick(ItemClickEvent event) {
        // fireEvent(...);
    }
});

table.addListener(new Table.ValueChangeListener() {
    public void valueChange(final ValueChangeEvent event) {
        // do something
    }
});

I want to fire an event from the first listener to call the second.

In one listener, I want to update the data source for the table by clicking on the row; in the second listener, I want to restore the cursor on the selected row.

How can I do it?

2 Answers2

0

If you change a column value of a row, then second listener is fired. To do so, you can change the column then you can regain its value in the second listener.

olyanren
  • 1,448
  • 4
  • 24
  • 42
0

You shouldn't be trying to manually trigger events. If you have code in the second listener that needs to be called, you should abstract it out into a third method.

It's difficult to understand exactly what you want, however. I would suggest adding more details to your question.

Dusty J
  • 721
  • 6
  • 12