Skip to main content

updating accodion with message sent by publishing.

4 replies [Last post]
moralbarometer
Offline
Joined: 2009-05-24

Hi All,
I having been trying to development a web 2.0 application and came accross jmaki framework. Thanks to those who lead this engineering. I understand subscription and publishing concept as backend developerand wanted to really really use this feature offered by jmaki for frontend development.
1) how can a publsih a message to a topic such that the lister should update itself with this message. I mean i have a message M and want to publish to topic T and only to a pannel BAR1 of an accordion to be updated with M. ie jmaki.publish(/T/select,M,BAR1).
The pannel is not update if it was loaded using include. I want it to load the include page if only its directly selected but its content should come from topic T. That is my idea but if i publish the message and the page was loaded into the pannel the message doesn't replace the page loaded on the pannel. More so i need some documentation and examples on such complex scenarios.

Thousand of thanks in advance.

Ivo

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
gmurray71
Offline
Joined: 2003-07-31

HI Ivo,

Thank you for your interest in jMaki. The publish/subscribe mechanism is pretty straightforward once you get the hang of it. It appears you are doing a more advanced case and hopefully we can get your working.

The panel you are loading came from the same domain/server correct?

My suspicion is that the panel had iframe : true?

If so the messages are prepended with /global/T/select.

On the receiving end (subscriber) you can use */T/select or /global/T/select to catch the messages.

A good way to see what is going on under the covers / debug these kinds of issues is to turn on jMaki publish / subscribe logging.

This can be done by placing the following JavaScript after your first widget which includes the jmaki.js

As far as docs go the best place right now I would say is :

http://blogs.sun.com/enterprisetechtips/entry/working_with_jmaki_events

As you encounter more questions please feel free to ask and we will try to get your questions answered.

-Greg

moralbarometer
Offline
Joined: 2009-05-24

Hi Greg,
Thanks so much for your prompt reply. I found out this Link: http://wiki.java.net/bin/view/Projects/JMakiDrawerDataModel#3_1_Publish_... .
The last two examples at the end of the page show update with static and dnamic(use of url) content. This is exactly what i want.
in my case something like : jmaki.publish("/T/select", { targetId : "bar", value : new url or content});
As shown below the "id =bar" pannel receives published information but content is not update. Have no idea if iframe is used.

[b]Accordion[/b]:
[i]
value="{ items :
[
{id : 'bar',label :'Info Board', include : 'jspPages/leftmenu/transport.jsp'},

{id : 'bar1',label :'test', include : 'jspPages/test.jsp', lazyLoad : true} ]}"/>[/i]

[b]publishing:[/b]

[i]jmaki.publish("/global/infoboard/select", { targetId : "bar", value : "hallo i am testing"});[/i]

Why are no such examples for individual widgets like dojo.accordion?

moralbarometer
Offline
Joined: 2009-05-24

Hi Greg,
found out iframe attribute. its not used. Do i have to sent to true?

moralbarometer
Offline
Joined: 2009-05-24

Hi Greg,
thanks it all works now very well