Hi here.
I have a class that extends AjaxEditableLabel. The overriden methods
newEditor and newLabel look as following:
protected FormComponent newEditor(MarkupContainer parent, String
componentId, IModel model){
RTextField editor =
(fieldType == null) ?
editor = new RTextField(componentId, model,
String.class){
protected void onComponentTag(ComponentTag tag)
{
super.onComponentTag(tag);
add(new
SimpleAttributeModifier("class", "e0"));
}
} :
new RTextField(componentId, model, fieldType){
protected void onComponentTag(ComponentTag tag)
{
super.onComponentTag(tag);
add(new
SimpleAttributeModifier("class", "e0"));
}
};
editor.setOutputMarkupId(true);
editor.setVisible(false);
editor.add(new EditorAjaxBehavior());
return editor;
}
protected Component newLabel(MarkupContainer parent, String componentId,
IModel model){
RLabel label = new RLabel("label", model)
{
private static final long serialVersionUID = 1L;
protected void onComponentTagBody
(MarkupStream markupStream, ComponentTag openTag)
{
if (getModelObject() == null) {
replaceComponentTagBody(markupStream,
openTag, defaultNullLabel());
}
else
{
super.onComponentTagBody(markupStream,
openTag);
}
}
};
label.setOutputMarkupId(true);
label.add(new LabelAjaxBehavior("onclick"));
return label;
}
Note that if the model, on newLabel, is null, then it uses
defaultNullLabel(), which defaults to the "..." string. I believed that I
could override that method to print whatever I wanted to, including the
empty string "". However, if a have something like
@Override
protected String defaultNullLabel() {
return "" ;
}
the cell that was meant to be editable, after clicking in and then clicking
out, become NOT EDITABLE!
Any help?
--
View this message in context:
http://www.nabble.com/defaultNullLabel%28%29-tf4904412.html#a14046749
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]