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] Tue, 16 October 2012 23:08 Go to next message
Erwin Hogeweg is currently offline Erwin Hogeweg
Messages: 32
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 15:10 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger Herrmann
Messages: 563
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 15:46 Go to previous message
Erwin Hogeweg is currently offline Erwin Hogeweg
Messages: 32
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:Use Calendar component (no Datepicker)
Next Topic:Update View Dynamically?
Goto Forum:
  


Current Time: Wed Jul 30 01:17:43 EDT 2014

Powered by FUDForum. Page generated in 0.07477 seconds