You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Gonzalo Aguilar Delgado <ga...@aguilardelgado.com> on 2017/03/07 10:36:00 UTC
PubSub from Javascript with Wicket.Event is possible?
Hello,
Is it possible to send events that are managed inside Javascript without
reaching the server?
Instead of using a dedicated PubSub library I pretend to use the
functionality inside Wicket to perform pubsub on javascript.
My problem is that only examples I can find is like this, where a
publish is done, but there are no arguments. Data or anything I want to
send.
Wicket.Event.publish(Wicket.Event.Topic.AJAX_HANDLERS_BOUND);
So. Is it possible to do that way?
Something like is what I want. How should I do it?
Wicket.Event.publish("/customevent/newdata", JSON.stringify(dataObject));
Thank you in advance.
Re: PubSub from Javascript with Wicket.Event is possible?
Posted by Sven Meier <sv...@meiers.net>.
Hi,
you can just pass any arguments to #publish, Wicket does it too:
Wicket.Event.publish(topic.AJAX_CALL_BEFORE, attrs);
Have fun
Sven
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/PubSub-from-Javascript-with-Wicket-Event-is-possible-tp4677256p4677257.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org