[英]Pass Querystring parameter from SharePoint to Java Applet webpart
I have a SharePoint webpart page, with a parameter in the page Querystring (in the URL), and I also have a Page Viewer webpart (which effectively IFRAME's the specified webpage), which shows a Java applet. 我有一个SharePoint Webpart页面,在页面的Querystring(在URL中)中有一个参数,还有一个Page Viewer Webpart(实际上是IFRAME的指定网页),其中显示了一个Java applet。
Is there any way I can get the parameter in the SharePoint Querystring to be recieved by the Java Applet ? 有什么方法可以获取Java Applet接收的SharePoint Querystring中的参数?
The reason for doing a Java applet in a webpart is to allow a file to be dragged and dropped onto the Java applet, and the parameter shows where the file would be saved in the SharePoint Document Centre. 在Webpart中执行Java小程序的原因是允许将文件拖放到Java小程序中,并且该参数显示文件在SharePoint文档中心中的保存位置。
I'd appreciate any and all suggestions. 我将不胜感激任何建议。
Cheers 干杯
Nick 缺口
Notes: 笔记:
Sounds like your two webpages run from different domains. 听起来您的两个网页都来自不同的域。 In that case, you need to use one of the Cross-Domain Communication tricks to break the walls. 在这种情况下,您需要使用“跨域通信”技巧之一来打破障碍。
Read this article, 阅读这篇文章,
http://msdn.microsoft.com/en-us/library/bb735305.aspx http://msdn.microsoft.com/en-us/library/bb735305.aspx
This is my favorite approach. 这是我最喜欢的方法。 To summarize it, 总结一下,
The xd_helper Javascript can be very simple. xd_helper Javascript可能非常简单。 Look at the one used by Google Friend Connect, 看一看Google Friend Connect使用的那个,
var u=location.href,h=u.substr(u.indexOf("#")+1).split("&"),t,r;try{t=h[0]===".."?parent.parent:parent.frames[h[0]];r=t.gadgets.rpc.receive}catch(e){}r&&r(h);
Facebook uses a more verbose version, Facebook使用更详细的版本,
http://static.ak.facebook.com/js/api_lib/v0.4/XdCommReceiver.js?2 http://static.ak.facebook.com/js/api_lib/v0.4/XdCommReceiver.js?2
SharePoint and the Page Viewer Web Part probably aren't the issue here directly. SharePoint和Page Viewer Web部件可能不是这里的直接问题。 As you state, the 'walls' that you describe are an HTML IFrame tag. 如您陈述的那样,您描述的“墙”是HTML IFrame标签。 You could focus your search on if the query string is accessible when the applet is within an IFrame. 当小程序位于IFrame中时,您可以集中精力查询是否可访问查询字符串。
Alternatively, why don't you use the Content Editor Web Part? 或者,为什么不使用内容编辑器Web部件? That allows you to include any arbitrary HTML directly onto the page. 这样,您就可以将任意HTML直接包含在页面中。 Instead of passing parameters by query string, pass them through on the object tag : 与其通过查询字符串传递参数,不如通过对象标记传递参数:
<object
classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
width="200" height="200">
<param name="code" value="Applet1.class">
<param name="paramX" value="valueX">
</object>
You should be able to retrieve with: 您应该可以通过以下方式进行检索:
String name = getParameter("paramX");
您是否尝试过使用JS然后使用document.write小程序的嵌入代码来读取查询字符串?
找到了指向此博客的链接,该链接涵盖了如何将参数传递给内容编辑器Webpart,然后该WebPart解决了该问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.