Hi all,

I made a new project in wicket-stuff(sourceforge) called 
wicket-contrib-push.
This project allows pushing of events on server side in a simulated bus 
between server and all client. This pushing has 2 implementations : 
 * The first based on Xavier Hanin work which is based on timerBehavior 
and simulates a bus with an EventStore (see 
http://www.nabble.com/server-side-triggered-page-refresh-%28aka-push%29-tf3321420.html#a9234009
 
and 
http://www.nabble.com/Pushing-data-to-the-Ajax-client-in-wicket--tf3354017.html#a9327668)
 * The second one using cometd(www.cometd.org) and dependant of 
wicket-contrib-dojo


The way to publish and listen to events is the following (with cometd 
and timer implementation):

//Somewhere I publish a new event. It can be for example in on click of 
a ajax link or elsewhere :
IPushPublisher publisher = new IPushPublisher("aBusChannel");
IPushEvent event = new IPushEvent()
event.add("akey", "myvalue");
publisher.publish(event);

//My page can be aware of event in aBusChannel :
IPushBehavior behavior = new IPushBehavior("aBusChannel"){
    public abstract void onEvent(String channel, Map<String, String> 
datas, IPushTarget target){
       //Triggered when event is publish by publisher
       //IPushTarget has the sapme prototype as AjaxRequestTarget
    }
}


WDYT?, Any comments, feelings?


PS : sources are available on svn :
https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/branches/wicket-1.3/wicket-contrib-push
https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/branches/wicket-1.3/wicket-contrib-push-examples

--
Vincent Demay
http://www.demay-fr.net/blog




-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to