Table - Refresh Generated Column

Hi all…
Im using a Table, with some Generated Column:


        getGrid().addGeneratedColumn("jobEstado", new JobEstadoGenerator());
        getGrid().addGeneratedColumn("dataInicio", new ColumnGenerators.DateColumnGenerator());
        getGrid().addGeneratedColumn("dataTermino", new ColumnGenerators.DateColumnGenerator());
        getGrid().addGeneratedColumn("ultimaExecucao", new jobUltimaExecucao());
        getGrid().addGeneratedColumn("proximaExecucao", new jobProximaExecucao());

Sometimes I refresh the container (Or setting the Container on grid, or using the container refresh method (CriteriaContainer). I can see the database querys on the grid Data, but the Querys that is made to compose the generated querys was not made. It is made only on the frist load of the grid, or when a Item is added.
How can I refresh the generated columns?

Here, a code from a generated Column:


private class jobUltimaExecucao implements Table.ColumnGenerator {
        @Override
        public Component generateCell(Table source, Object itemId, Object columnId) {
            String jobName = (String) source.getItem(itemId).getItemProperty("jobName").getValue();
            if(jobName != null) {
                JobDetailController controller = new JobDetailController();
                if(controller.existsJobName(jobName)) {
                    TriggerController tgController = new TriggerController();
                    Trigger t = tgController.findById(jobName + "_tgr");
                    if(t.getPrevFireTime() <= 0) {
                        return new Label("--");
                    }
                    else {
                        return new Label(new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").format(new java.util.Date((Long)t.getPrevFireTime())));
                    }
                }
            }
            return new Label("--");
        }
    }

Many thanks by help!

This is odd.
This example
worked previously quite well so that if you edit a value, the generated columns are calculated immediately after leaving the TextField.

The example is rather old and it could be that the behavior of GeneratedColumn has changed intentionally…or unintentionally…at some point. I’ll have to check this later.

Ah yes, this was changed a while back. See
this thread
and ticket
#2823
. It means a bit more work in the column generators.