Hello!
We implemented a little AJAX based counter which shows the user how long a
file is locked.
It counts down the time from for example 60 seconds to 0 seconds.
On the same page are some Form elements.
In Opera everything is fine, in Firefox it seems that the whole page is
updated every second or the content of the form elements. You cant mark text
in the textbox, the mark vanishs after the next update. You cant write text
in the box because after an update the cursor moves to the end of the text.
In IE everything seems fine, the only bug is if you click in the textbox the
page is scrolled down to the top of the textbox.
We have the following class:
public class LockCountdown extends Label
and added:
add(new AbstractAjaxTimerBehavior(Duration.seconds(1)){
private static final long serialVersionUID = 1L;
private final LockCountdownModel model =
(LockCountdownModel) getModel();
@Override
protected void onTimer(AjaxRequestTarget target) {
if (model.isDone()) {
// stop the self update
stop();
}
target.focusComponent(null);
target.addComponent(getComponent());
}
});
In the getObject() Method of the model the time is calculated.
The line target.focusComponent(null); was a tip from irc channel, but has no
effect.
Thanks for help :)
--
View this message in context:
http://www.nabble.com/Ajax-self-updating-label-cause-browser-problems-tp20252882p20252882.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]