Hi,
in my testapp i'm trying to use an AjaxEditableLabel. When I put some data
in, it works fine but now comes my Problem.
My label is as Subclass of AjaxEditableLabel and so I tried to implement
the onEdit() function.
The thing is, that the displayed values might calculated by a formula in
the back.
If the user clicks on an editable Label the formula should appear instead
of the calculated value. How do i do this?
My first attemp looks like this:
protected void onEdit(AjaxRequestTarget target)
{
Position2 position = (Position2)pm.getTarget();
if(position.hasFormulas())
{
if(position.getFormula()[index] != null)
{
String output[] = position.getOutput();
output[index] = position.getFormula()[index];
}
}
target.addComponent(this);
}
The label is bound to an output property from the Position2 class.
This works fine so far. The deposited formula is displayed but not
editable any more.
What do I have to do to display the formula (if there is one) and keep it
editable?
Fabian