Dynamic Table Cells

The idea is to:
click the text in a cell
have a text box appear there (with the current value)
edit that value
loose focus on the text box
have the cells inner html turn back into text showing the new value

I can’t seem to find a way to make a single cell turn into a text field.

I can’t find a way to attach a listener on the cell itself. I would settle for a listener on the column but I don’t see that either.

What I understand is that the table needs to be rebuilt to show a class change on a column (ie. from String.class to TextField.class). Repaint won’t work for this case. Is this so?

My company is trying to decide if we are going to use this. I’ve been appointed to provide a proof of concept. Any help here would be great.

Thanks so much
-Robert

Sorry I can’t help but I’m trying to solve the same problem…

Use PopupView as follows. This will show the text as clickable and a popup will appear when you click. The “selector” object is what is displayed when clicked. In this example the popup is a selection box, you could just use a TextField if you need to capture text (or whatever editing component or layout you want).

        platformSelect.setPropertyDataSource(prop);
        platformSelect.setWriteThrough(true);
        platformSelect.setImmediate(true);
        final ListSelect selector = platformSelect;
        PopupView popup = new PopupView(new PopupView.Content() {

            @Override
            public String getMinimizedValueAsHTML() {
                return platformItemDisplayString(prop.getValue());
            }

            @Override
            public Component getPopupComponent() {
                return selector;
            }
        });
        popup.setHideOnMouseOut(true);
        return popup;

In order to use this in a table, you need to define a Table.ColumnGenerator; in the generateCell() method you will invoke this code.