How to communicate between two instances of the same page in GWT

My GWT application needs to upload to YouTube using browser-based upload described here http://code.google.com/apis/youtube/2.0/developers_guide_java.html#Browser_based_Upload I need YouTube to redirect to the same page I am uploading video from after upload is completed, so I can inform the user that the upload is done. For this reason, I am setting the form action like this (ytPost is used to store both token and PostUrl received from YouTube). form.setAction(ytPost.getPostUrl()+ "?nexturl="+Window.Location.getHref().toString()); From what I see in Eclipse, this happens in a thread called - Daemon Thread [Code server for fyiapp from Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16 ( .NET CLR 3.5.30729; .NET4.0C) on http://127.0.0.1:8888/FyiApp.html?gwt.codesvr=127.0.0.1:9997#tab=plan&item=69 @ _brp1HJ[BO$Y~rSZ] (Running) The problem comes when YouTube redirects back to the same page from which I initiated the upload, but GWT instantiates a new thread called - Daemon Thread [Code server for fyiapp from Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16 ( .NET CLR 3.5.30729; .NET4.0C) on http://127.0.0.1:8888/FyiApp.html?gwt.codesvr=127.0.0.1:9997#tab=plan&item=69 @ _brp1HJ[BO$Y~rSZ] (Suspended (breakpoint at line 104 in PostEditor)) As a result, even though I am technically on the “same page” code wise (GWT client side) from where I initiated the initial YouTube upload request, this page doesn’t have any state which I need to inform the user that YouTube upload is completed. I can issue Window.alert, or write to the status bar, but all the widgets are brand new. The both threads continue to run from this point on. What should I do to either be able to receive YouTube redirect on the same thread from which the upload was initiated or if this is impossible, how should I pass the information between two instances of the same browser page?

以上就是How to communicate between two instances of the same page in GWT的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏