Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
The following code
AjaxEditableLabel label = new AjaxEditableLabel("someid");
label.setModel(...);
will throw an NullPointerException.
The reason is...
public final Component setModel(IModel model)
{ super.setModel(model); *** getLabel().setModel(model); **** getEditor().setModel(model); return this; }getLabel() returns null because the label is not initialized.
I suggest the following fix:
protected final Component getLabel()
{ return label; }should be changed to
protected final Component getLabel()
{
if (label == null)
return label;
}
this is similar to getEditor() which already initializes the component if it is null...