[Building Sakai] Refresh portal window, notify a tool to refresh

Tania Tritean TTritean at loi.nl
Tue Mar 1 00:29:11 PST 2011


Hello,

2-3 weeks ago I posted some questions about portal and I found out the answers:

1. Problem: I am using sakai 2.6.2 and I want to open a tool from another tool.
In tool A I have a link that should open tool B(maybe from another site).
How can I do this?

At the moment I am using
developerHelperService.getToolViewURL(toolregId, localView, params,
                                                            locationReference);
And open the url in the parent frame with a js function (because I don't want to have the entire portal opened in the portal's iframe).

But this is causing a UI flicker that is ugly.

Fix for this: I used the same service to get the url to the tool, and then used a js method from headscript.js to reload portal, script that won't generate the flickering any more.
portalWindowRefresh(url);

2. Problem:  I am in tool A  and I want that on some event from here, a tool B to be rerendered without making the tools dependent.
Fix: I used the courier behavior (a little part from it).
a. In tool B I registered the tool as a 'courier' just in javascript

window.paret.courier=window; (I am inside of a tool B that is in an iframe)
...//rendering the page in tool B
//for courier updating the second time
window.parent.courierRunning = false;

b. In tool A when the event is triggered I call a js method from headscript.js
updCourier(true, false);

The problem with this solution is that I can not register 2 listener tools, because updCourier function is not taking in account that I can have more courier windows.


Hope this will help somebody in the future.

If there is a better solution for those problems please let me know.

Regards,
Tania


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20110301/6b902650/attachment.html 


More information about the sakai-dev mailing list