Re: AjaxEditableLabel ... but how to get the changed value?

2009-05-26 Thread Carl-Eric Menzel
On Tue, 26 May 2009 16:27:18 +0200
Dorothée Giernoth  wrote:

> Now I want to write the changed information from these labels back
> into the database after the content has changed. Wouldn't be too much
> of a problem if I knew how to retrieve the changed value from the
> label. I really have no clue how to do that!

Override the onSubmit() method, like this (untested, but you get the
gist):

cell.add(new AjaxEditableLabel(cell.newChildId(), new Model(...)) {
  protected void onSubmit(AjaxRequestTarget target) {
super.onSubmit(target);
String value = getDefaultModelObject();
// persist value here...
  }
});

Alternatively, if you keep a reference to the model you pass to the
AjaxEditableLabel, you can read its contents at some other point.

Grüße
Carl-Eric

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



AjaxEditableLabel ... but how to get the changed value?

2009-05-26 Thread Dorothée Giernoth
I know this must be a stupid question for all the not-wicket-newbies, but I 
can't seem to find a solution.
I have a RepeatingView with AjaxEditableLabels that contain information from 
database:

cell.add(new AjaxEditableLabel(cell.newChildId(), 
 new Model(list.get(j;

Now I want to write the changed information from these labels back into the 
database after the content has changed. Wouldn't be too much of a problem if I 
knew how to retrieve the changed value from the label. I really have no clue 
how to do that!

Hope someone can shed some light! Maybe just a tiny code fragment, that could 
help me. Thanx in advance!

- dg

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org