Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsFinding iFrame that corrensponds to TreeItem or TableRow
https://www.eclipse.org/forums/index.php/mv/msg/309882/821036/#msg_821036
I am really stuck with this. The whole project is in danger now because of this issue. I need help asap.
Please note that I have no knowledge of RAP and I need a quick hack/fix.
I am using RAP 1.3. Basically, our application behaves like this. When an TreeItem or TableRow is double-clicked, CTabItem opens that points to an iFrame, which loads a servlet. CTabItem loads a bunch of divs and an iFrame wrapped in a div element. We are not using any client widgets. The whole RAP application gets generated by server.
My question is: how can I find an iFrame in the client end (javascript space) that corresponds to the TreeItem and TableRow? I need solutions for both Table.js and TreeItem.js.
I was able to find double-click functions in TreeItem.js and Table.js that get triggered when TreeItem and TableRow get double clicked. So, in these double-click functions, I need to put some javascript code that finds the iFrame that is being loaded by TreeItem and TableRow. How do I do that?
]]>V B2012-03-14T21:39:57-00:00Re: Finding iFrame that corrensponds to TreeItem or TableRow
https://www.eclipse.org/forums/index.php/mv/msg/309882/821402/#msg_821402
I'm not sure i understand your scenario. Let me recap:
* You have Tree and/or Table in your application.
* When an item in there is double-clicked, you programatically (in Java)
select an CTabItem.
* That CTabItem makes a control visible that contains a BrowserWidget
(i.e. Iframe).
* In that BrowserWidget you set an URL that points to a servlet.
* You somehow want a javascript reference to that iFrame that you use in
a hacked version of TreeItem.js/TableRow.js, and there are multiple iFrames.
It that about right?
Greetings
Tim
Am 14.03.2012 22:39, schrieb V B:
> Hi RAP experts,
>
> I am really stuck with this. The whole project is in danger now :(
> because of this issue. I need help asap.
>
> Please note that I have no knowledge of RAP and I need a quick hack/fix.
>
> I am using RAP 1.3. Basically, our application behaves like this. When
> an TreeItem or TableRow is double-clicked, CTabItem opens that points to
> an iFrame, which loads a servlet. CTabItem loads a bunch of divs and an
> iFrame wrapped in a div element.
>
> My question is: how can I find an iFrame in the client end (javascript
> space) that corresponds to the TreeItem and TableRow? I need solutions
> for both Table.js and TreeItem.js.
>
> I was able to find double-click functions in TreeItem.js and Table.js
> that get triggered when TreeItem and TableRow get double clicked. So, in
> these double-click functions, I need to put some javascript code that
> finds the iFrame that is being loaded by TreeItem and TableRow. How do I
> do that?
>
Professional services for RAP and RCP? http://eclipsesource.com/services/rap/]]>Tim Buschtoens2012-03-15T10:04:56-00:00Re: Finding iFrame that corrensponds to TreeItem or TableRow
https://www.eclipse.org/forums/index.php/mv/msg/309882/821527/#msg_821527
Please note the iFrame is loaded by the Browser.js (org.eclipse.swt.browser.Browser).
Basically, I want a javascript reference to the iframe that is loaded when a TreeItem or TableRow is double clicked.
OR
I want a javascript reference to the contents of iFrame before the iFrame is destroyed. I tried getting a reference to the contents of the iFrame by making a call in the destruct method of Browser.js. However, iFrame was already destroyed. document.getElementById(iFrameId) gave me a null object when I called it in the destruct method of Browser.js.
Any help is greately appreciated.
Vlad
]]>V B2012-03-15T13:34:26-00:00Re: Finding iFrame that corrensponds to TreeItem or TableRow
https://www.eclipse.org/forums/index.php/mv/msg/309882/821542/#msg_821542
Perhaps you could tell me what you actually want to achieve with this?
There might be a simpler way to do whatever it is you want to do.
In any case, if you want to access the browser contents before its
disposed, you can do so in the destroy (not destruct) method. Basically:
Am 15.03.2012 14:34, schrieb V B:
> Hi Tim,
>
> Please note the iFrame is loaded by the Browser.js
> (org.eclipse.swt.browser.Browser).
> Basically, I want a javascript reference to the iframe that is loaded
> when a TreeItem or TableRow is double clicked.
>
> OR
>
> I want a javascript reference to the contents of iFrame before the
> iFrame is destroyed. I tried getting a reference to the contents of the
> iFrame by making a call in the destruct method of Browser.js. However,
> iFrame was already destroyed. document.getElementById(iFrameId) gave me
> a null object when I called it in the destruct method of Browser.js.
>
> Any help is greately appreciated.
>
> Vlad
>
>
>
>
>
>
Professional services for RAP and RCP? http://eclipsesource.com/services/rap/]]>Tim Buschtoens2012-03-15T13:52:31-00:00Re: Finding iFrame that corrensponds to TreeItem or TableRow
https://www.eclipse.org/forums/index.php/mv/msg/309882/821621/#msg_821621
I developed my own custom memory-clearing function that clears all contents in the iFrame. However, my custom memory-clearing function must be called before the iFrame gets destroyed by RAP.
In Browser.js, there is no destroy : function() you mentioned. I found destroyFunction:function(name), but this function never gets called when the iFrame gets destroyed.
However, I found the destroy function in qx.js. When I put my code in destroy function of qx.js, I can see that my code is getting called. However, I don't know how I can get to the iFrame because the destroy function in qx.js gets called on everything.
Is there a way for me to get to the contents of iFrame before it gets destroyed? Is this possible to do somewhere in qx.js or some other .js file?
If it is not, is it possible to get to the contents of the iFrame when TreeItem and TableRow is double-clicked? In our application, every TreeItem and TableRow corresponds to the document. The document loads in a CTabItem. In the CTabItem, there is a Browser.js, which loads the iFrame with the servlet.
Vlad ]]>V B2012-03-15T16:06:43-00:00Re: Finding iFrame that corrensponds to TreeItem or TableRow
https://www.eclipse.org/forums/index.php/mv/msg/309882/821625/#msg_821625
I developed my own custom memory-clearing function that clears all contents in the iFrame. However, my custom memory-clearing function must be called before the iFrame gets destroyed by RAP.
In Browser.js, there is no destroy : function() you mentioned. I found destroyFunction:function(name), but this function never gets called when the iFrame gets destroyed.
However, I found the destroy function in qx.js. When I put my code in destroy function of qx.js, I can see that my code is getting called. However, I don't know how I can get to the iFrame because the destroy function in qx.js gets called on everything.
Is there a way for me to get to the contents of iFrame before it gets destroyed? Is this possible to do somewhere in qx.js or some other .js file?
If it is not, is it possible to get to the contents of the iFrame when TreeItem and TableRow is double-clicked? In our application, every TreeItem and TableRow corresponds to the document. The document loads in a CTabItem. In the CTabItem, there is a Browser.js, which loads the iFrame with the servlet.
Vlad]]>V B2012-03-15T16:06:43-00:00Re: Finding iFrame that corrensponds to TreeItem or TableRow
https://www.eclipse.org/forums/index.php/mv/msg/309882/821634/#msg_821634
the memory leak in IE related to iframe was a know problem. See:
327440: Memory leak problem with Iframe in Internet Explorer https://bugs.eclipse.org/bugs/show_bug.cgi?id=327440
I don't know if the fix could be easily back ported to 1.3.
Best,
Ivan
On 3/15/2012 6:06 PM, V B wrote:
> We are using RAP 1.3. For some reason RAP or Internet Explorer is not
> doing garbage collection when the iFrame gets destroyed by RAP. So,
> overtime, our users can't use the application, and they must restart
> the browser.
>
> I developed my own custom memory-clearing function that clears all
> contents in the iFrame. However, my custom memory-clearing function
> must be called before the iFrame gets destroyed by RAP.
>
> In Browser.js, there is no destroy : function() you mentioned. I
> found destroyFunction:function(name), but this function never gets
> called when the iFrame gets destroyed.
>
> However, I found the destroy function in qx.js. When I put my code in
> destroy function of qx.js, I can see that my code is getting called.
> However, I don't know how I can get to the iFrame because the destroy
> function in qx.js gets called on everything.
>
> Is there a way for me to get to the contents of iFrame before it gets
> destroyed? Is this possible to do somewhere in qx.js or some other .js
> file?
>
> If it is not, is it possible to get to the contents of the iFrame when
> TreeItem and TableRow is double-clicked? In our application, every
> TreeItem and TableRow corresponds to the document. The document loads
> in a CTabItem. In the CTabItem, there is a Browser.js, which loads
> the iFrame with the servlet.
>
> Vlad
Professional services for RAP and RCP? http://eclipsesource.com/services/rap/]]>Ivan Furnadjiev2012-03-15T16:19:43-00:00Re: Finding iFrame that corrensponds to TreeItem or TableRow
https://www.eclipse.org/forums/index.php/mv/msg/309882/821692/#msg_821692
I tried RAP 1.4. The memory does get cleared when the iFrame is destroyed. However, my tests show that your fix only works in IE8. It does not work in IE6. We have a lot of clients that are still using IE6, and we can't upgrade them to IE8 yet.
My custom memory-clearing function works for all IEs. I just need a way to call it bbefore iFrame gets destroyed by RAP.
Could you please let me know how that can be done?
I tried:
-Calling my memory clearing code in the destruct method of Browser.js.
It did not work, since the iFrame was already destroyed by RAP by the time I called my function.
- I was told by RAP forum to put my memory clearing code in destroy method of Browser.js. Such method is not located in Browser.js.
- I put my code in the destroy function of qx.js. My code was called, but I was not able to get the iFrame since destroy gets called for everything.
If such thing is not possible, is it possible to get to the contents of the iFrame when TreeItem and TableRow is double-clicked? In our application, every
TreeItem and TableRow corresponds to the document. The document loads
in a CTabItem. In the CTabItem, there is a Browser.js, which loads
the iFrame. The iFrame's is populated by the servlet.
Any help is grately appreciated.
Vlad
]]>V B2012-03-15T17:42:45-00:00Re: Finding iFrame that corrensponds to TreeItem or TableRow
https://www.eclipse.org/forums/index.php/mv/msg/309882/821695/#msg_821695
I tried RAP 1.4. The memory does get cleared when the iFrame is destroyed. However, my tests show that your fix only works in IE8. It does not work in IE6. We have a lot of clients that are still using IE6, and we can't upgrade them to IE8 yet.
My custom memory-clearing function works for all IEs. I just need a way to call it bbefore iFrame gets destroyed by RAP.
Could you please let me know how that can be done?
I tried:
-Calling my memory clearing code in the destruct method of Browser.js.
It did not work, since the iFrame was already destroyed by RAP by the time I called my function.
- I was told by RAP forum to put my memory clearing code in destroy method of Browser.js. Such method is not located in Browser.js.
- I put my code in the destroy function of qx.js. My code was called, but I was not able to get the iFrame since destroy gets called for everything.
If such thing is not possible, is it possible to get to the contents of the iFrame when TreeItem and TableRow is double-clicked? In our application, every
TreeItem and TableRow corresponds to the document. The document loads
in a CTabItem. In the CTabItem, there is a Browser.js, which loads
the iFrame. The iFrame's is populated by the servlet.