Friday Jan 12, 2007
Friday Jan 12, 2007
Hi,
Today I had a hard time getting a mashup portlet to work with Google MAPs API. The first issue was that the body tag with onload event handler would not work inside a portlet when using IE 6.0 browser. It worked fine for the Firefox 2.0 browser. For example if you were to stick in a code like the following inside the view.jsp, the onload event would not be called and the load function will not be activated.
It is because, the IE browser rejects a second body tag appearing inside the portlet, when parsing the portal desktop page. The portal desktop page made up of multiple portlets will have its own portlets container 'body' tag. It took me sometime to figure this out.
After fixing that , I ran into another problem where the IE browser would throw an "Operation aborted" error message. A timeout has to be added to the function call, so that function call was made after a set time period. This ensured that the portlet page was parsed before bringing in map content from Google. Following reference helped - http://mapki.com/wiki/FAQs#Browser_Problems. Again this wasn't a problem with the Firefox browser.
setTimeout('load()',500);