Wednesday, August 29, 2018

Re: how to create an anchor column in a celltable

What I want is when you click on the cell a new tab opens with the url you clicked,
my string url column is filled with the response I get from the servlet
can you please give me more details on the alternative response.

On Wednesday, August 29, 2018 at 3:45:27 PM UTC+2, Thomas Broyer wrote:
If you want to display text as-is (e.g. not a link), then you can use a ClickableTextCell (see it live, with source code, in http://samples.gwtproject.org/samples/Showcase/Showcase.html#!CwCellSampler), the FieldUpdater will be called when the cell is clicked.
Alternatively, you could use a TextCell with a custom SafeHtmlRenderer that would wrap the URL in a link (easiest would probably be to implement this using a SafeHtmlTemplates: pass the URL as input –you'll want to pass it as a SafeUri, constructed using UriUtils.fromString()–, use it to construct something like <a href="{0}" target="_blank">{0}</a>)

On Tuesday, August 28, 2018 at 6:00:00 PM UTC+2, Ousti Driss wrote:
Hey everyone,

I'm writing the code of a simple web app using gwt, I have a Celltable all its columns are String type,
one of the columns is a url column , I want to make this column clickable, which means once you click on a cell
of this column, you are redicted to the url shown, is that possible?
i tried to add an anchor column to the table, but I got error messages while defining this column when I call the getValue method, the type of return should be a string!!
Is there a way to do such a thing?

Thank you :) 

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment