简体   繁体   English

如何从gwt中的一个浏览器窗口获取数据到另一窗口?

[英]How to get the data from one browser window to other window in gwt?

First of all i would like to say that i have gone through all the posts which are similar to my query but i have some different requirement. 首先,我想说的是,我浏览了所有与我的查询相似的帖子,但我有一些不同的要求。

In our project we are using gwt to develop the modules, in one of our module, we have "Edit" button which opens a new browser window which includes 'CKEditor'. 在我们的项目中,我们使用gwt开发模块,在其中一个模块中,我们具有“编辑”按钮,该按钮将打开一个新的浏览器窗口,其中包括“ CKEditor”。 We are modifying the data in ckeditor comes(by url) from gwt widget . 我们正在修改gwt widget的ckeditor comes(by url)中的数据。

The Window opens by using following code snippet(JSNI) in my gwt widget: 在我的gwt小部件中使用以下代码片段(JSNI)打开窗口:

private static native BodyElement getBodyElement(String url) /*-{    
         var win = window.open("url", "win",      "width=940,height=400,status=1,resizeable=1,scrollbars=1"); // a window object    
         return win.document.body;       
   }-*/; 

The newly opened window have the html form which is with ckeditor . 新打开的窗口具有ckeditor的html形式。

So here i am closing new window once my form has been submitted but i want the edited text to be displayed in old window. 所以在这里,一旦提交表单,我将关闭新窗口,但是我希望编辑后的文本显示在旧窗口中。 How can i achieve this requirement? 我怎样才能达到这一要求?

If you can use HTML5, it should be quite easy. 如果可以使用HTML5,它应该很容易。 Use Messaging. 使用消息传递。

Take a look here: 在这里看看:

Cross-document messaging 跨文档消息传递

With the reference of the newly opened window, yu can establish a communication between both windows. 参考新打开的窗口,yu可以在两个窗口之间建立通信。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM