Skip to Content
avatar image
Former Member

URL in TableView cell

How can a table view cell be defined to be a URL? When the user clicks on the URL the content needs to show up in a separate browser window.

We are using JSPDynPage for implementing the iView.

Thanks

Deepak

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Apr 27, 2004 at 09:17 AM

    Hello Deepak,

    you must set the type to html, there is a method for this:

    For example for an column:

    TableView.setColumnType(TableColumnType.LINK, 1);

    Best Regards,

    Patrick

    http://www.unternehmensportale.biz

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      You have to set also the reference and the target.

      Here's an example:

      TableColumn userCol = table.getColumn("EMail");

      userCol.setType(TableColumnType.USER);

      And then you have to define a CellRenderer:

      public class HelpFeedbackTableCellRenderer implements ICellRenderer

      {

      public void renderCell(int row, int column, TableView tableView, IPageContext rendererContext)

      {

      if (column == 4)

      {

      Link l = new Link("EMail");

      l.addText("EMail");

      l.setReference("mailto:" + tableView.getValueAt(row,column).toString());

      l.setTarget("_top");

      l.setLinkDesign(LinkDesign.FUNCTION);

      l.render(rendererContext);

      }

      }

      }