Since a div
is not a form element, it doesn't get submitted when you post a form. So you have two options:
- in
onInput
fill a hidden form element with the content and submit that using a form - send the content to the server using Ajax
Both require you to do some magic using a (Ajax)Behavior.
You can use Wicket's HiddenField to create the hidden field, and in onInput
perform the update of the HiddenField's value.
You can encapsulate this by creating your own ContentEditableFormComponent
by using FormComponentPanel as a starting point.