将状态指示器添加到自定义 Web 部件
我有一个正在生成一些用户数据的自定义 Web 部件。 我已经添加了适当的代码来输出标准的存在图标和菜单,但是这表现得相当奇怪。
我的 Web 部件的渲染 html 如下:
<span>
<a href="http://mysite/Person.aspx?accountname=USERID">USERNAME</a>
<img border="0" height="12" width="12" src="/_layouts/images/blank.gif" onload="IMNRC('USEREMAIL')" id="imnUSERID" ShowOfflinePawn="1" />
</span>
显然替换了 USERID、USERNAME、USEREMAIL 等。
问题是双重的。
1) 在 IE7 中,不会检索存在信息。 菜单显示正确,但未出现图标,并且当您将鼠标悬停在间隙上时,下拉菜单不提供 IM 设置。
2) 在 IE8 RC1 中,存在信息正确返回并显示图标,但下拉列表在图标上方几英寸处呈现。 (查看此屏幕截图)
有关这些问题的任何帮助或有关向自定义 Web 部件添加状态的其他提示将是深受好评。
进度更新
- 将网页添加到 IE7 的“受信任的站点” - 没有执行任何操作 - IE8 的兼容性视图没有区别。 - 更改为 id="CSRP_id,type=sip" 根据建议将代码更改为以下内容:
<span>
<img class="PresenceImage" src="/_layouts/images/imnhdr.gif" onload="IMNRC('USEREMAIL')" name="imnmark" ShowOfflinePawn="1" id="contact_im,type=sip" />
</span>
上述更新均未成功。
I have a custom web part which is generating some user data. I have added the appropriate code to output the standard presence icon and menu however this is acting rather stangely.
The rendered html of my web part is as follows:
<span>
<a href="http://mysite/Person.aspx?accountname=USERID">USERNAME</a>
<img border="0" height="12" width="12" src="/_layouts/images/blank.gif" onload="IMNRC('USEREMAIL')" id="imnUSERID" ShowOfflinePawn="1" />
</span>
Obviously replacing USERID, USERNAME, USEREMAIL etc.
The problems are twofold.
1) In IE7 the presence information does not get retrieved. The menu displays correctly but the icon does not appear and when you hover over the gap the drop down menu does not provide IM settings.
2) In IE8 RC1 the presence information comes back correctly and the icon displays, but the drop down list is rendered severeal inches above the icon. (see this screenshot)
Any help with these issues, or with other tips about adding presence to custom web parts would be greatfully received.
Update on progress
- Adding web page to 'Trusted Sites' for IE7 - did nothing
- Compatability view for IE8 makes no difference.
- Changed to id="CSRP_id,type=sip"
Changed code to the following on recommendation:
<span>
<img class="PresenceImage" src="/_layouts/images/imnhdr.gif" onload="IMNRC('USEREMAIL')" name="imnmark" ShowOfflinePawn="1" id="contact_im,type=sip" />
</span>
None of the above updates have been succesful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,您必须排除是否存在样式问题或 JavaScript 问题。
如果所有状态气泡均正确显示,请获取 IE 开发人员工具栏 并尝试追踪 css。 甚至更改网站的主题,看看是否会得到不同的结果。
这是我们的 html,效果很好
注意:
[USERMAIL] = 明显
[用户名] = 显而易见
[GUID] = 随机 guid
另请注意格式错误的 img 标签,没有结尾的“/>” (只是“>”)。 我们使用它是因为这是由 SharePoint 生成的 html(请不要让我开始那个)。
First, you are going to have to eliminate whether you have a styling issue or a javascript issue.
If all of your presence bubbles display correctly, then get the IE Developer Toolbar and try and trace the css back. Even change the themes of the site and see if you get a different result.
This is our html, which works nice
Note:
[USERMAIL] = obvious
[USERNAME] = obvious
[GUID] = random guid
Also note the malformed img tag with no end "/>" (just ">"). We use this as this is the html generated by SharePoint (please don't get me started on that).