Search |
||
jMaki publish/subscribe and debuggingPosted by arungupta on May 21, 2007 at 11:37 AM PDT
So far you've been playing with jMaki and
created some Web
and/or Rails
applications. Let's say you've gone a step ahead and some
widgets in your application use jMaki's publish/subscribe
mechanism to talk with each other. Some jMaki widgets,
such as Menu and Dynamic Container are pre-configured to
publish and subscribe to the same topic. So if you develop a simple
menu-based application then it'll work without adding any
glue code. Another example is Yahoo GeoCoder publishing and Yahoo Maps
and Google Maps subscribing. This allows you to drop all three widgets
together on the same page and if you enter a city and state in
GeoCoder, the coordinates will show up in both the maps. So
far so good, but what if you are writing custom publish and
subscribe code and it's not working. Lets see how we can debug that.
Let's say there is a Yahoo Calendar and Data Table widget in the page. The Data Table displays stock tickers by pulling the data from quote servers for the current date. You'd like to modify the application such that whenever a date is selected in the Calendar widget, the Data Table refreshes itself by pulling quotes for that date. The Calendar widget already publishes an event to " /yahoo/calendar/onSelect" topic. All you need to
do is modify 'component.js' in Web pages, resources, yahoo,
dataTable subtree and listen to that topic. For that, you add the
following statement:
on line 172 of ' On '
Now any date selected in the calendar is printed on the page. The ' We created a simple, yet powerful example, demonstrating jMaki publish/subscribe mechanism. The mechanism is simple so it should just work even if there are custom
widgets and they publish events to their own topic. But this is software so in
all likelihood don't be surprised if it does not :) But jMaki at least provide a
way to debug that situation. Open '
Happy debugging! All jMaki Web applications can be deployed on GlassFish or Rails applications can be WARed and then deployed on GlassFish. »
Related Topics >>
Web Applications Comments
Comments are listed in date ascending order (oldest first)
|
||
|
|