You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by fh...@s-und-n.de on 2007/08/24 11:09:02 UTC
AjaxEditableLabel onEdit
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
Antwort: AjaxEditableLabel onEdit (solved)
Posted by fh...@s-und-n.de.
Hi,
i solved it by myself.
I took a look at the sources and so i got the hint, what to do.
I had to switch between the editor and label from the superclass.
I think, it will work now.
Freundliche Grüße / With kind regards
Fabian Hagen
fhagen@s-und-n.de
24.08.2007 11:09
Bitte antworten an
users@wicket.apache.org
An
users@wicket.apache.org
Kopie
Thema
AjaxEditableLabel onEdit
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