The recent change to models broke AjaxEditableLabel.

The reason is that model, obtained thorugh AjaxEditableLabel.getModel() is used as model for label (and textfield). If you set a CompoundPropertyModel to labels' parent, the model returned by AjaxEditableLabel.getModel() implements IInheritableModel . So the label and textfield try to get property 'label' and 'editor' from the bean (which is of course not there).

The workaround is to make

AjaxEditableLabel.getParentModel()

like this:
        final IModel<T> m = getModel();

        // we are going to use the model for label and text field
        // so we have to wrap it to a modal that does not implement
        // IInheritableModel, otherwise it would fail
        return new IModel<T>()
        {
            private static final long serialVersionUID = 0L;

            public void detach()
            {
                m.detach();
            }
            public T getObject()
            {
                return m.getObject();
            }
            public void setObject(T object)
            {
                m.setObject(object);
            }
        };

The question is, whether this is correct?

-Matej

Reply via email to