Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Browser Widget focus
Browser Widget focus [message #120981] Fri, 06 February 2009 23:38 Go to next message
Howard is currently offline HowardFriend
Messages: 29
Registered: July 2009
Junior Member
It's probably just something I'm missing, but I'm having an issue with
Browser widget.

I have browser widget inside dialogs, and in order to click on a link
inside the browser I need to click twice to get it to work. After the
first extra click, the browser seems to have focus and will work as normal
(single clicks).

So I tried to do setFocus() and forceFocus() but both returns false. Why
would the widget fail to get focus? Or is this a bug?

Thanks in advance,
Howard
Re: Browser Widget focus [message #121079 is a reply to message #120981] Mon, 09 February 2009 21:29 Go to previous messageGo to next message
Jim Tilley is currently offline Jim TilleyFriend
Messages: 4
Registered: July 2009
Junior Member
I too am having this problem. The HTML page I am displaying in the
Browser component contains href links but I have to click inside the
Browser component initially in order to make the links responsive. The
status bar in the RAP browser does not display the link URL until the
first mouse click is received.
Thanks
-Jim
Re: Browser Widget focus [message #121118 is a reply to message #120981] Tue, 10 February 2009 09:56 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2359
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Howard,

I can't reproduce it with Controls Demo -> Browser tab. When I set the
page in the browser, the links became active immediately. Can you
provide a simple self-running snippet that illustrate the problem?

Best,
Ivan

Howard wrote:
> It's probably just something I'm missing, but I'm having an issue with
> Browser widget.
>
> I have browser widget inside dialogs, and in order to click on a link
> inside the browser I need to click twice to get it to work. After the
> first extra click, the browser seems to have focus and will work as
> normal (single clicks).
>
> So I tried to do setFocus() and forceFocus() but both returns false.
> Why would the widget fail to get focus? Or is this a bug?
>
> Thanks in advance,
> Howard
>
Re: Browser Widget focus [message #121161 is a reply to message #121118] Wed, 11 February 2009 01:30 Go to previous messageGo to next message
Howard is currently offline HowardFriend
Messages: 29
Registered: July 2009
Junior Member
Try this. Basically just a shell with browser in it. I'm wondering if it
has anything to do with me running RWT standalone? If you need a war file
to test RWT standalone, you can see my previous thread "File Upload and
Download in RWT standalone", I attached a war file there.

Thanks!

----------------------------------------

import org.eclipse.rwt.lifecycle.IEntryPoint;
import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class BrowserApplication implements IEntryPoint {
public int createUI() {
Display display = new Display();
Shell shell = new Shell(display, SWT.TITLE);
shell.setLayout(new GridLayout());

Browser browser = new Browser(shell, SWT.NONE);
browser.setUrl("http://www.eclipse.org/");
browser.setLayoutData(new GridData(GridData.FILL_BOTH));

shell.open();
shell.setMaximized(true);
while (shell!= null && !shell.isDisposed()) {
try{
if (!display.readAndDispatch()) {
display.sleep();
}
}
catch (Throwable t)
{
t.printStackTrace();
}
}

return 0;
}
}
Re: Browser Widget focus [message #121179 is a reply to message #121161] Wed, 11 February 2009 09:19 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2359
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Howard,

the browser widget uses qooxdoo Iframe. I've dig inside the qooxdoo
Iframe and found that there is a blocker div element which cover the
actual Iframe when the instance is created. As a temporary workaround
add the following code in the RAP Browser.js file:
focus : function() {
this.base( arguments );
this.release();
}
This release (remove) the blocker div tag on Browser focus gain.

Best,
Ivan

Howard wrote:
> Try this. Basically just a shell with browser in it. I'm wondering if
> it has anything to do with me running RWT standalone? If you need a
> war file to test RWT standalone, you can see my previous thread "File
> Upload and Download in RWT standalone", I attached a war file there.
>
> Thanks!
>
> ----------------------------------------
>
> import org.eclipse.rwt.lifecycle.IEntryPoint;
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.browser.Browser;
> import org.eclipse.swt.layout.GridData;
> import org.eclipse.swt.layout.GridLayout;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.widgets.Shell;
>
> public class BrowserApplication implements IEntryPoint {
> public int createUI() {
> Display display = new Display();
> Shell shell = new Shell(display, SWT.TITLE);
> shell.setLayout(new GridLayout());
> Browser browser = new Browser(shell, SWT.NONE);
> browser.setUrl("http://www.eclipse.org/");
> browser.setLayoutData(new GridData(GridData.FILL_BOTH));
> shell.open();
> shell.setMaximized(true);
> while (shell!= null && !shell.isDisposed()) {
> try{
> if (!display.readAndDispatch()) {
> display.sleep();
> }
> }
> catch (Throwable t)
> {
> t.printStackTrace();
> }
> }
>
> return 0;
> }
> }
>
>
Re: Browser Widget focus [message #121186 is a reply to message #121161] Wed, 11 February 2009 09:33 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2359
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Howard,

and please file a bugzilla about it.

Thanks,
Ivan

Howard wrote:
> Try this. Basically just a shell with browser in it. I'm wondering if
> it has anything to do with me running RWT standalone? If you need a
> war file to test RWT standalone, you can see my previous thread "File
> Upload and Download in RWT standalone", I attached a war file there.
>
> Thanks!
>
> ----------------------------------------
>
> import org.eclipse.rwt.lifecycle.IEntryPoint;
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.browser.Browser;
> import org.eclipse.swt.layout.GridData;
> import org.eclipse.swt.layout.GridLayout;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.widgets.Shell;
>
> public class BrowserApplication implements IEntryPoint {
> public int createUI() {
> Display display = new Display();
> Shell shell = new Shell(display, SWT.TITLE);
> shell.setLayout(new GridLayout());
> Browser browser = new Browser(shell, SWT.NONE);
> browser.setUrl("http://www.eclipse.org/");
> browser.setLayoutData(new GridData(GridData.FILL_BOTH));
> shell.open();
> shell.setMaximized(true);
> while (shell!= null && !shell.isDisposed()) {
> try{
> if (!display.readAndDispatch()) {
> display.sleep();
> }
> }
> catch (Throwable t)
> {
> t.printStackTrace();
> }
> }
>
> return 0;
> }
> }
>
>
Re: Browser Widget focus [message #121259 is a reply to message #121179] Wed, 11 February 2009 17:49 Go to previous messageGo to next message
Howard is currently offline HowardFriend
Messages: 29
Registered: July 2009
Junior Member
Thanks for taking the time to investigate, Ivan.
Alas I tried to add that snippet to Browser.js but it doesn't seem to do
anything. I wouldn't be surprised if I'm not adding it correctly though,
so would you kindly past the entire file for me?

Also, out of curiosity, is this a RWT standalone issue since you said the
demo browser works fine?

Cheers,
Howard
Re: Browser Widget focus [message #121267 is a reply to message #121259] Wed, 11 February 2009 19:05 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2359
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Howard,
This is not a RWT standalone issue. I've opened a bug about it:

[Browser] Extra click is needed to activate the link in the browser widget
https://bugs.eclipse.org/bugs/show_bug.cgi?id=264569

Best,
Ivan



Howard wrote:
> Thanks for taking the time to investigate, Ivan.
> Alas I tried to add that snippet to Browser.js but it doesn't seem to
> do anything. I wouldn't be surprised if I'm not adding it correctly
> though, so would you kindly past the entire file for me?
>
> Also, out of curiosity, is this a RWT standalone issue since you said
> the demo browser works fine?
>
> Cheers,
> Howard
>
Re: Browser Widget focus [message #121291 is a reply to message #121267] Wed, 11 February 2009 21:50 Go to previous messageGo to next message
Howard is currently offline HowardFriend
Messages: 29
Registered: July 2009
Junior Member
Ivan,

Would you please update the bug with the temporary work-around you posted?
Attaching the entire Browser.js would be good because I still can't figure
out where/how to add your snippet. :(

Interesting why the browser demo would work fine and that this bug wasn't
caught earlier.

Thanks,
Howard
Re: Browser Widget focus [message #121316 is a reply to message #121291] Thu, 12 February 2009 07:39 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2359
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Howard,

the iframe blocker is removed automatically, when you click somewhere in
the application. In the Controls Tab -> Browser, the browser widget is
empty by default and the blocker is there. When you click somewhere in
the application (button to set the URL for example)... the blocker is
removed. In your example the browser widget is "preloaded" with the
page, that's why there is no this first click to remove the blocker. The
bug is fixed in CVS HEAD - the blocker is removed on iframe "load" event
as qooxdoo developers suggested.

Best,
Ivan

Howard wrote:
> Ivan,
>
> Would you please update the bug with the temporary work-around you
> posted? Attaching the entire Browser.js would be good because I still
> can't figure out where/how to add your snippet. :(
>
> Interesting why the browser demo would work fine and that this bug
> wasn't caught earlier.
>
> Thanks,
> Howard
>
Re: Browser Widget focus [message #121491 is a reply to message #121316] Thu, 12 February 2009 20:33 Go to previous message
Howard is currently offline HowardFriend
Messages: 29
Registered: July 2009
Junior Member
Great explanation and fix works great. Thanks a bunch!
Previous Topic:no context menu on TableViewer
Next Topic:Switching Perspective on tomcat server
Goto Forum:
  


Current Time: Tue Dec 07 20:31:52 GMT 2021

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

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

Back to the top