The following code demonstrates an issue with GridCellRenderer and gwt Hyperlink objects. It loads a TreeGrid and a standard Grid, with one cell each (a link to a blank page). The issue is that when one clicks anywhere in the cell other than the link, the blank page is launched. Only clicking the link should launch the window instead of the white space in the cell.

public void onModuleLoad() {
final VerticalPanel vertPanel = new VerticalPanel();

Moving this to the help forum as this is not a bug in GXT. You are using the GWT Hyperlink Widget incorrectly

Pandaman

9 Jul 2009, 4:54 AM

So how am I supposed to use it then?

nyklogistics

9 Jul 2009, 5:22 AM

Yes, I want to know it too.(:|

sven

9 Jul 2009, 5:30 AM

That is the way the HyperlinkWidget works in GWT. For your feature you need to use some other Widget, probably write an own one.

Whaat do you want to do?

Pandaman

9 Jul 2009, 5:46 AM

I want to be able to click a link in a grid cell and open the page that the link points to in a new window. This code does this fine. But I don't want to open the page the link points to if the user clicks the blank space in the grid cell.

sven

9 Jul 2009, 6:23 AM

The Hyperlink is wrong than. You need to write an own component for that.Take a look with firebug at the output if the Hyperlink widget.

Pandaman

9 Jul 2009, 6:47 AM

I guess I can do it the old fashion way and render an HTML link that uses javascript to open a new window...

raybeez

10 Jul 2009, 8:52 AM

If you want to accomplish this, why not just markup the property that's used to display data in the cell, eg:

or something similar. This works just fine for me - granted, only in a normal TreePanel or a normal Grid, but I think it'd render just the same in a TreeGrid.

Pandaman

10 Jul 2009, 8:58 AM

Yeah that's more or less what I have, except that I made the GridCellRenderer wrap the text with html for the link. I originally wanted to use Hyperlink objects to make the code a bit cleaner, but since they don't work as desired, I'm fine with html.