>-----Original Message----- >From: Chris Geer [mailto:[email protected]] >Sent: Friday, May 11, 2012 4:07 PM >To: [email protected] >Subject: PubSub-2 - switching views > >In working with the pubsub-2 feature I've come across another "error". It >seems that if you include the pubsub-2 feature you get an error generated >when you switch between home and canvas view. The following method >generates an error because both home and canvas view use the same >containerId. > >OpenAjax.hub.ManagedHub.prototype.addContainer = function( container ) >{ >this._assertConn(); >var containerId = container.getClientID(); >if ( this._containers[containerId] ) { >throw new Error(OpenAjax.hub.Error.Duplicate); >Uncaught Error: OpenAjax.hub.Error.Duplicate >Uncaught Error: OpenAjax.hub.Error.Duplicate >} >this._containers[containerId] = container; >} > >This doesn't seem to break functionality (I only noticed it because I was >running in Chrome with "break on all errors" turned on) but I'm wondering >if there might be side effects in the future. Should we be unregistering >from the hub prior to switching views and allowing the new view to >re-register or is this ok by design?
This is managed by Shindig common container. IMO the right thing to do would be similar to what you suggest. Check to see if the site exists and either remove the existing one and re-add it or append something to the ID to make it unique. I will start a discussion over on their list... > >You can recreate this running vanilla rave with the pubsub sample gadgets >by just maximizing them. This problem doesn't exist with open-views popups >because they each get a unique gadget id. > >Chris
