Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

TextField cursor reset mid-editing

$
0
0
Hi,

I was wondering if there's a way around the following problem - at least a
slightly more elegant one than I came up with!

When one adds an AjaxFormUpdatingBehavior("onkeyup") to a TextField, if
during the update the source TextField is added to the AjaxRequestTarget the
resulting behaviour is a TextField which periodically resets it's
cursor/caret position to zero (depending on the Behavior's throttle
settings). This is obviously problematic during typing.

In my particular case, the TextField in question is within a container
alongside the label, suffix and a bunch of status indicators (a super-field
of sorts). These all react to changes in the textfield content. When I'm
updating from outside it's not a problem but when the update comes from
within as a result of an onKeyUp update, I add the container to the
AjaxRequestTarget in order to get all the sub-components updated and thus
end up with the aforementioned cursor issue.

I have worked around this by performing partial updates in this specific
case (all the siblings minus the offending textfield) and appending some
JQuery to the AjaxRequestTarget in order to update the container css class
but it's hardly ideal...

Any thoughts?

Thanks,

CN

Viewing all articles
Browse latest Browse all 5648

Trending Articles