0
votes

I have a CellTree which uses an EditTextCell as part of a CompositeCell for its child. I've noticed that sometimes when I'm editing a node and I click into another one, this cell switchs to edition mode but the first don't quit it.

After debuging CellTree Class I discovered that sometimes the onBlur event is not forwarded to the node being edited when it loses the focus.

Any help would be much appreciated.

1

1 Answers

0
votes

Make sure that you have this line in the constructor

super("click", "keyup", "keydown", "blur");

And this in the event handler

...
else if ("blur".equals(type)) {
        // Commit the change. Ensure that we are blurring the input element and
        // not the parent element itself.
        EventTarget eventTarget = event.getEventTarget();
        if (Element.is(eventTarget)) {
            Element target = Element.as(eventTarget);
            if ("input".equals(target.getTagName().toLowerCase())) {
                commit(context, parent, viewData, valueUpdater);
            }
        }
    }

Take a look at the last answer of this post EditTextCell FieldUpdater width