I'd like to create a new component, EditableLabel.
(There's AjaxEditableLabel, but I don't like the way it behaves - changing from <span> to <input> and back.)
I'd like it to be AJAX-enabled - onchange, at least. But the user should be able to leave out AJAX. Ideally, he would decide by (not) adding a Behavior.
My implementation is CSS-based - it's an input all the time, only changing it's appearance. This is done via JavaScript, to make it usable without AJAX, too.
So far, I have tried
Using
AbstractAjaxBehaviorwithrequestCycle.scheduleRequestHandlerAfterCurrent(new TextRequestHandler("text/plain", "UTF-8", ret));in onRequest(), and the text field sends itsvaluewhenever appropriate (enter pressed, focus lost, ...)The problem here is that I can't use AjaxRequestTarget. This approach is rather for simple server-client communication, like auto-complete.
Using simply a
TextFieldwithAjaxFormComponentUpdatingBehavior("update").The problem is that it clashes with my JavaScript event handlers.
What would be the right approach to this? I assume there's some way I should code the javascript event handlers in wicket, so they would not make CSS changes dependent on server response (i.e. not re-rendering what server sends), but Wicket would make the JS so that events would not clash.
Any examples around this topic welcome.
IAjaxCallDecoratorthe way to achieve this in < 6 ? - Xavi López