Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Finding iFrame that corrensponds to TreeItem or TableRow (Finding iFrame that corrensponds to TreeItem or TableRow )
Finding iFrame that corrensponds to TreeItem or TableRow [message #821036] Wed, 14 March 2012 21:39 Go to next message
V B is currently offline V BFriend
Messages: 8
Registered: March 2012
Junior Member
Hi RAP experts,

I am really stuck with this. The whole project is in danger now Sad 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?

[Updated on: Wed, 14 March 2012 21:41]

Report message to a moderator

Re: Finding iFrame that corrensponds to TreeItem or TableRow [message #821402 is a reply to message #821036] Thu, 15 March 2012 10:04 Go to previous messageGo to next message
Tim Buschtoens is currently offline Tim BuschtoensFriend
Messages: 396
Registered: July 2009
Senior Member
Hi.

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?
>

--
Tim Buschtöns

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Finding iFrame that corrensponds to TreeItem or TableRow [message #821527 is a reply to message #821402] Thu, 15 March 2012 13:34 Go to previous messageGo to next message
V B is currently offline V BFriend
Messages: 8
Registered: March 2012
Junior Member
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





Re: Finding iFrame that corrensponds to TreeItem or TableRow [message #821542 is a reply to message #821527] Thu, 15 March 2012 13:52 Go to previous messageGo to next message
Tim Buschtoens is currently offline Tim BuschtoensFriend
Messages: 396
Registered: July 2009
Senior Member
Hi.

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:

members : {

...

destroy : function() {
---your code here---
this.base( arguments );
}

}

Tim

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
>
>
>
>
>
>

--
Tim Buschtöns

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Finding iFrame that corrensponds to TreeItem or TableRow [message #821621 is a reply to message #821542] Thu, 15 March 2012 16:06 Go to previous messageGo to next message
V B is currently offline V BFriend
Messages: 8
Registered: March 2012
Junior Member
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
Re: Finding iFrame that corrensponds to TreeItem or TableRow [message #821625 is a reply to message #821542] Thu, 15 March 2012 16:06 Go to previous messageGo to next message
V B is currently offline V BFriend
Messages: 8
Registered: March 2012
Junior Member
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
Re: Finding iFrame that corrensponds to TreeItem or TableRow [message #821634 is a reply to message #821621] Thu, 15 March 2012 16:19 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Vlad,
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

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Finding iFrame that corrensponds to TreeItem or TableRow [message #821692 is a reply to message #821634] Thu, 15 March 2012 17:42 Go to previous messageGo to next message
V B is currently offline V BFriend
Messages: 8
Registered: March 2012
Junior Member
Hi Ivan,

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

Re: Finding iFrame that corrensponds to TreeItem or TableRow [message #821695 is a reply to message #821634] Thu, 15 March 2012 17:42 Go to previous message
V B is currently offline V BFriend
Messages: 8
Registered: March 2012
Junior Member
Hi Ivan,

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
Previous Topic:Auto-refreshing ViewPart by using Job
Next Topic:Integration of JavaFx 2.0 in RAP???
Goto Forum:
  


Current Time: Wed Apr 24 23:32:05 GMT 2024

Powered by FUDForum. Page generated in 0.03353 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top