I am working with a wicket page where i need to allow a backend process to instruct a component on a page to refresh. I don't want to refresh the entire page, just a single component, so i am guessing that i'm in Ajax territory.
I have found a few different Ajax timers like AjaxSelfUpdatingTimerBehaviour but i really would like an actual push, as the changes should be fairly instantaneous and i would require some high-frequency timers.
Does anyone know of a good way to achieve this?
Edit 1
I have been looking at the Wicket Websocket implementation. I can see the WebSocket behaviours looks promising, but the only server-push method i can find is something like this:
IWebSocketConnectionRegistry registry = new SimpleWebSocketConnectionRegistry();
Application application = Application.get(applicationName);
IWebSocketConnection wsConnection = registry.getConnection(application, sessionId, pageId);
if (wsConnection != null && wsConnection.isOpen()) {
wsConnection.send("Asynchronous message");
}
But i don't see any way to update a component in a typesafe way like the Ajax Behaviours like target.add(component). Can someone elaborate or point me in the right direction? Google is not being my friend.