Hi,
i am using a subclass of AjaxEditableLabel.
This one works fine so far but I have one Problem.
If the value of the label is < 0 the markup should change.
I tried it this way with no effect.
public class MyAjaxEditableLabel extends AjaxEditableLabel{
protected void onSubmit(AjaxRequestTarget target)
{
[...]
if(position.getValue()[index] < 0)
{
this.getLabel().add(new AttributeModifier("class", true,
new Model("negativ")));
}
else{
this.getLabel().add(new AttributeModifier("class", true,
new Model("positiv")));
}
this.getLabel().setVisible(true);
this.getEditor().setVisible(false);
target.addComponent(MyAjaxEditableLabel.this);
}
}
In my css - stylesheet the class "negativ" and "positv" are defined.
So if the value of the label changes to < 0 nothing happens.
Any suggestions?
Fabian