Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Browser won't show in RAP 1.4.2
Browser won't show in RAP 1.4.2 [message #947362] Wed, 17 October 2012 03:08 Go to next message
Erwin Hogeweg is currently offline Erwin HogewegFriend
Messages: 37
Registered: July 2009
Member
I am trying to open an embedded browser in a RAP application, but I must be doing something wrong because it doesn't show up.

As far as I can see this is just standard code:

link.addSelectionListener(new SelectionAdapter() {
	@Override
	public void widgetSelected(SelectionEvent event) {
		try {
//			Browser b = new Browser(parent, SWT.NONE);
			Browser b = new Browser(parent.getShell(), SWT.NONE);
//						b.setUrl("http://www.eclipse.org");
						b.setText("<html><body>This is Unicode HTML content from memory</body></html>"); 
					} catch (SWTError e) {
						// Error handling here
					}

				}
			});


I can see the request go out, but the page is never shown.

If I replace it with the ExternalBrowser it works... but not as desired.

Any insight is highly appreciated.

Using Eclipse RAP 1.4.2 on Mac OS X.

Kind Regards,

Dutch.
Re: Browser won't show in RAP 1.4.2 [message #948105 is a reply to message #947362] Wed, 17 October 2012 19:10 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
Erwin,

you might be running into layout issues. If you create a new widget, you
are responsible to re-layout the parent in order to show the new widget.

What is the try-catch block for? Don't you rather want to see exceptions
that occur while calling setUrl() or setText()?

Did you try to replace the browser widget with a Label, just to be sure
that the problem isn't specific to the Browser widget.

The call to setUrl() is overriddent by setText() and thus could be
omitted. Is this what you want?

HTH
Rüdiger

On 17.10.2012 14:50, Erwin Hogeweg wrote:
> I am trying to open an embedded browser in a RAP application, but I must
> be doing something wrong because it doesn't show up.
>
> As far as I can see this is just standard code:
>
> link.addSelectionListener(new SelectionAdapter() {
> @Override
> public void widgetSelected(SelectionEvent event) {
> try {
> // Browser b = new Browser(parent, SWT.NONE);
> Browser b = new Browser(parent.getShell(), SWT.NONE);
> // b.setUrl("http://www.eclipse.org");
> b.setText("<html><body>This is Unicode HTML
> content from memory</body></html>"); } catch
> (SWTError e) {
> // Error handling here
> }
>
> }
> });
>
>
> I can see the request go out, but the page is never shown.
>
> If I replace it with the ExternalBrowser it works... but not as desired.
>
> Any insight is highly appreciated.
>
> Using Eclipse RAP 1.4.2 on Mac OS X.
>
> Kind Regards,
>
> Dutch.


--
Rüdiger Herrmann
http://codeaffine.com
Re: Browser won't show in RAP 1.4.2 [message #948130 is a reply to message #948105] Wed, 17 October 2012 19:46 Go to previous message
Erwin Hogeweg is currently offline Erwin HogewegFriend
Messages: 37
Registered: July 2009
Member
Rüdiger,

Quote:
you might be running into layout issues. If you create a new widget, you
are responsible to re-layout the parent in order to show the new widget.

That was the clue. re-layout... thanks a bunch. Comments to other statements below.
Quote:
What is the try-catch block for? Don't you rather want to see exceptions
that occur while calling setUrl() or setText()?

Absolutely, I removed the exception handling for brevity.
Quote:
Did you try to replace the browser widget with a Label, just to be sure
that the problem isn't specific to the Browser widget.

Duh... no I didn't, that would have been an obvious thing to do wouldn't it? I was so convinced it was the Browser widget Smile
Quote:
The call to setUrl() is overriddent by setText() and thus could be
omitted. Is this what you want?

Yes, for this experiment at least.

Thanks a lot for your help. I am rolling again.

Dutch.
Previous Topic:How to provide a download button?
Next Topic:Update View Dynamically?
Goto Forum:
  


Current Time: Thu Mar 28 13:40:23 GMT 2024

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

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

Back to the top