0

I have an iWidget that is deployed outside the Connections environment. This iWidget is working in WebSphere Portal 8, the iWidget Wrapper. The iWidget can be added to a community and the initial text is loaded.

The onView() or other events are never invoked, resulting in the iWidget displaying the initial message and the 'div' never being replaced. I have change the src of the javascript in different ways, the ./javascript one, being the latest.

Firebug shows a succesful retrieval of the js (widget.xml) through the communities/proxy context root.

This is the iWidget XML:

<iw:iwidget id="365DocsWidget" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"     xmlns:iw="http://www.ibm.com/xmlns/prod/iWidget" supportedModes="view edit" mode="view" lang="en" iScope="365DocsWidgetScope" sandbox="false" allowInstanceContent="true"><iw:itemSet id="pref"><iw:item id="documentlist" value="https://fire3ice.sharepoint.com/sites/demo4if/_api/Web/Lists(guid'cca56100-1f15-461b-92f3-d1da80ba1ca8')"/></iw:itemSet><iw:resource src="./javascript/365DocsWidget.js" /> <iw:content mode="view"><![CDATA[<div id="ROOT_DIV">Hello World, last time this widget was updated:  2013-01-04 16:07:17</div>]]></iw:content><iw:content mode="edit"><![CDATA[<div id="EDITMODE_DIV">Hello Edit World</div><div><input type="button" name="selectDocumentList" value="selectDocumentList" onclick="iContext.iScope().changeDocumentList()" /> </div> ]]></iw:content></iw:iwidget>

The widget.xml is publically accessible here: https://eog-fire-ice.appspot.com/365DocsWidget.jsp

mpjjonker
  • 917
  • 1
  • 6
  • 28

3 Answers3

1

This might be caused by the Javascript resource for the iWidget not being recognised as Javascript and therefore not being loaded. Can you set a Content-Type of application/javascript on the response for the JS file?

BrianOG
  • 11
  • 1
  • Thanks BrianOG, I'll check it out and report back here. – mpjjonker Jan 10 '13 at 06:44
  • This is what FireBug shows me: Cache-Control max-age=15724800,s-maxage=15724800,public, public, max-age=600 Connection Keep-Alive Content-Encoding gzip Content-Language nl-NL Content-Length 1368 Content-Type application/x-javascript Date Thu, 10 Jan 2013 09:28:40 GMT Etag "VRJ_mg" Expires Thu, 11 Jul 2013 09:28:40 GMT, Thu, 10 Jan 2013 09:38:40 GMT Keep-Alive timeout=10, max=84 Server IBM_HTTP_Server X-LConn-Auth true X-UA-Compatible IE=EmulateIE7 But if you could take a look at the publicly available widget here : https://eog-fire-ice.appspot.com/365DocsWidget.jsp – mpjjonker Jan 10 '13 at 09:31
  • @BrainOG, The widget (including javascript) is hosted here [link](https://eog-fire-ice.appspot.com/365DocsWidget.jsp) – mpjjonker Jan 10 '13 at 09:35
  • It gets worse a similar problem occurs with open social gadgets in the embedded experience. The experience demonstrated here [youtube embedded experience](https://www.youtube.com/watch?v=KRO7dPlOD4Y) no longer works after applying CR2 on Connections 4 – mpjjonker Jan 10 '13 at 20:10
1

I've also seen this when I have a typo in the JavaScript file. Please go through the JavaScript file and make sure there are no missing commas or semi-colons.

Luis
  • 11
  • 1
  • thanks for your reply. But when the iwdiget/javascript works in the iWidget wrapper of WebSphere Portal 8, is not that enough proof that – mpjjonker Jan 10 '13 at 06:43
  • continued from previous reply: is that not enough proof that the widget is ok ? – mpjjonker Jan 10 '13 at 09:32
0

There is a mismatch between your xml and js.

  1. The iScope in your xml is "365DocsWidgetScope"
  2. The Object declared in your js is "J365DocsWidgetScope" (in https://eog-fire-ice.appspot.com/javascript/365DocsWidget.js)

replace "J365DocsWidgetScope" to "365DocsWidgetScope" should be able to solve the problem.

Urumchi
  • 26
  • 3