Displaying a link in a tableView

Hi,
I am trying to display a link in column of a tableview in a jsp page.
the source code is:
     public void initAttachmentsModel() {
          Vector colName = new Vector(2);          
          colName.addElement("File Name");
          colName.addElement("URL");
          attachmentsModel = new DefaultTableViewModel(attachmentsList, colName);
          TableColumn col = attachmentsModel.getColumn("URL");
          col.setType(TableColumnType.LINK);
          col.setEncode(false);
But no link is displayed within the tableview.
I also tried setUserTypeCellRenderer() and still no results.
Message was edited by: Mark Finnern

Hi Aviad,
You can do this in two ways. Populate the value of all columns in Table Model.
<u>I Way</u>: Set the column type as Link in TableView Model.
<hbj:tableView  id="myTableView"
                model= "myTableViewBean.model"
                design = "ALTERNATING"
                headerVisible = "true"
                footerVisible = "true"
                fillUpEmptyRows = "true"
                selectionMode = "MULTISELECT"
                navigationMode = "BYLINE"
                headerText = "<h3>tableView</h3>"
                visibleFirstRow = "1"
                visibleRowCount = "4"
                onNavigate="onNavigate" >
<%
myTableView.setColumnType(TableColumnType.LINK,column no);
%>
  </hbj:tableView>
<u>II Way</u> Set the column type as TableColumnType.USER and write the cell renderer.
<%
myTableView.setColumnType(TableColumnType.USER,column no);       
myTableView.setUserTypeCellRenderer(new TableViewCellRenderer()); %>
In Cell Renderer "TableViewCellRenderer.java"
import com.sapportals.htmlb.*;
import com.sapportals.htmlb.rendering.IPageContext;
import com.sapportals.htmlb.table.ICellRenderer;
import com.sapportals.htmlb.table.TableView;
public class TableViewCellRenderer implements ICellRenderer {
    public void renderCell(int row, int column, TableView tableView, IPageContext rendererContext) {
        if (column == 1) {
         Link mylink = new Link();
         String linkText = tableView.getValueAt(row, 
                           column).toString();
         mylink.addText(linkText);
     // Set the renderer
            ddlb.render(rendererContext);
Hope this helps.
Regards,
Praveen
PS. Dont foget to award points if it is useful/solved

Similar Messages

  • How display attachment links in a list view in SharePoint 2013?

    Hi all,
    I'm looking for a way to display attachment links in a list in SharePoint 2013. There are few resources online to achieve this in SP2010 and SP07. Your help is much appreciated.
    Thank you.

    Hi Ram Sampath:
    You can use Event Receiver and create another list(ListA) to record your attachment link.
    Maybe your process is:
    Users add list items and attachments
    List event will be fired
    Use Event Receiver to get attachment url and then Write into ListA
    You also can refer to the following web site:
    https://social.technet.microsoft.com/Forums/sharepoint/en-US/b693eb84-b846-4f0f-93c1-276cf931c746/how-to-get-attachment-in-itemadded-event-receiver
    http://stackoverflow.com/questions/19077770/how-to-retrieve-list-item-attachments-with-sharepoint-2013-event-receiver-in-cor

  • Displaying a link to an external page as a "catalog"

    Hi,
    I was trying to display a link to an external web page as a catalog in SRM, e.g. http://www.google.com.
    This should be possible somehow, an SRM will even provide a link to go back, "return to SRM application".
    I created a web service to do this. I'm not sure what Business Type of Web Service is the most appropriate. So I chose "01 Product Catalog" for the time being.
    So far my call structure is very simple:
    No.      Parameter               Parameter Value     Type
    10                    http://www.google.com     0 URL
    100     BYPASS_OUTB_HANDLER               2 Fixed Value       
    110     HOOK_URL                         4 Return URL
    When I click on that link I get the message "405. Thatu2019s an error. The request method POST is inappropriate for the URL /."
    So I set the flag "use HTTP GET to call Web Service". But the error remains.
    Does anyone know how to set this up?
    Best regards,
    Marcus

    Hi Markus,
    I expect that a page like google is not expecting a POST request, i.e. the POST request is used to try to submit a form or request to the server, google does not expect such a request.
    Maybe try using a test catalog like that provided by Wiley or similar (http://catalog.wiley.com/marketbasket.cgi), see http://www.wiley.com/legacy/authors/apiinfo/ for more info on this.
    Regards.
    Jason

  • Display a Linked List ADT in JTree ?

    Most of the Swing examples that I have noticed for building a JTree have used many different ADTs, but I haven't noticed any examples to use a JTree to display a linked list (not necessarily the LinkedList class though). I was studying Data Structures & Algorithms, and the majority of the examples for Binary Trees, Red-Black Trees, and 2-3-4 Trees use a form of a linked list to connect all of the nodes together.
    Isn't it, or should it, be possible to use a JTree to display a linked list ADT ? Or am I missing something somewhere ?

    Maybe, if you only had a reference to one other node in the object that is being linked together.
    What if there was a node object that contained three references ?
    nextNode
    prevNode
    subNode

  • Why won't my links palette display any links?

    Is this a common bug? The links palette will not display any links for ANY documents. They do not show as missing or broken, there is just an empty palette window.

    Try restoring your InDesign preferences. Here's how:
    Trash, Replace, Reset, or Restore the application Preferences

  • How to display a linked multi-page pdf?

    I am a DW newbie building a small website for my book design business. I would like to show book design samples as spreads in a multi-page pdf (set up with page display set to two-up)  linked to thumbnail images on a web page. I have created the links, but the pdf either opens in another window as single page, or (in Firefox) triggers a dialog box which asks to either dowload or open in Acrobat. Is the display of pdfs always dictated by the client browser settings or is there a DW behavior or widget that can accomplish this? Any other ideas on how best to display these samples? DW CS5.5, Mac OS 10.6.8.

    Thanks for your reply. I think I have what I need now: I can export pdfs out of InDesign as spreads, and then the pdf reader in the browser sees that spread in the linked pdf as a single page. Should have thought of that sooner. Would be nice if there was some way to control the display of linked pdfs with code rather than be at the mercy of the client browser.

  • How to display many Links like text with multi lines?

    I need to:
    1)display many links in one container like text
    2)each link have onClick event Handler
    Example:
    Link1 SomeLink2 Link3 \*
    Link4 AnatherLink5            \*
    AndOneMoreLink6              \*
    \* - right border of container
    i'v tried TileGroup, but it has colums.... Group - overlapped links in one place.... and so on.
    Any ideas how to do it?

    I think you overlooked some of the possibilities provided by Apex.
    For instance you can create a simple HTML region where you put the links as you prefer (makes sense if they are a fixed number and you need a special formatting).
    You can also create Lists (see shared components). Lists are specifically meant for links, like Task lists in the Apex Builder itself, but you cannot build them dynamically, so you must know in advance each and every static link.
    Or you can create a report if links come as result of a query which is good for building them dynamically.
    A fourth option is a PL/SQL region outputting HTP calls where you have total control over every aspect.
    Flavio
    http://oraclequirks.blogspot.com

  • How to display archive link picture in pdf

    Hi, Experts
      I create a pdf form using tcode SFP, and create a graphics element in the form,
    but i don't want to use the MIME object to disaplay,because our pictures are archive link.
    How to display archive link picture in pdf form?
    Thanks you very much!
    Ken.li
    Edited by: Ken.Li on Nov 17, 2009 3:50 AM
    Edited by: Ken.Li on Nov 17, 2009 4:30 AM

    Hello,
    I can recommend you go through the tutorial called How Tou2026 Integrate ADOBE form on WebdynPro for ABAP and Deploy it on portal by Bhawanidutt Dabral. Ignore the fact it uses WD, I have tried the proposed solution how to load in the picture on a simple offline/ print form. Look around for this tutorial.
    It propose to use the FM as follows:
    CALL METHOD cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp
        EXPORTING
          p_object       = c_graphics
          p_name         = lv_pernr1
          p_id           = c_bmap
          p_btype        = c_bcol
        RECEIVING
          p_bmp          = ls_z_if_test_cv-im_photo
        EXCEPTIONS
          not_found      = 1
          internal_error = 2
          OTHERS         = 3.
    It passes the picture as XSTRING into the form and there you bind this data stream to a Image Field (not an Image!!! check this twice). Don´t forget to check the checbox to include picture data into the form file.
    Hope this helps, Otto

  • Display Promoted links in Multiple Lines

    Hi,
    I am trying to Display Promoted links in Multiple Lines in sharepoint Online and used the following link for reference:
    http://www.rbradbrook.co.uk/Blog/Post/14/Displaying-Promoted-Links-on-Multiple-Lines
    When editing the webpart I am getting things correct as below:
    Once I save this , its showing as list.
    Any suggestions or help in this.
    Thanks in advance

    Hi,
    The solution you mentioned did not work form me either. I digged through the internet and something else worked:
    On a single page add a Script Editor Web Part and paste the following code in the source:
    <style type="text/css">
    .ms-promlink-body {width:100%}
    .ms-promlink-header {visibility:hidden}
    < /style>
    Works perfectly for me!
    The source of this code:
    Sharepointkevin.com

  • How can display the link Personalize

    In the portal I am displaying the links:
    I have the role of admon.
    Help, Logoff in Head Area(MastHead) How can display the link Personalize?
    Regards

    Assign yourself eu_role.
    Thanks
    Prashant

  • Part of message should display as link in a mail

    I need to add a link in my message which I am sending to my users automated every week.
    I am able to send a message but they are not able to see "www.ravi.com" as a link,
    kindly suggest me

    If you write http://www.ravi.com than it will display like link.

  • In portal 9i, removal of folder display name link

    hi all,
    i need to know, how to make the folder display name not a link.
    by default display name comes as a link, which points to the particular content area , the folder uses.
    --archana                                                                                                                                                                                                                                                                                                                                                                                                       

    Hi Samer_asn,
    I am trying to do exactly what you did.
    Can you tell me how you could retrieve the word doc from blob and show it in a portlet when a user clicks on a link
    Thanks in advance
    Jay

  • After Delete in Linked list...unable to display the linked list

    Hi...i know that there is an implementation of the class Linked Link but i am required to show how the linked list works in this case for my project...please help...
    Yes..I tried to delete some objects in a linked list but after that i am not able to display the objects that were already in the linked list properly and instead it throws an NullPointerException.
    Below shows the relevant coding for deleting and listing the linked list...
    public Node remove(Comparator comparer) throws Exception {
         boolean found = false;
         Node prevnode = head;          //the node before the nextnode
         Node deletedNode = null;     //node deleted...
         //get next node and apply removal criteria
         for(Node nextnode = head.getNextNode(); nextnode != null; nextnode = nextnode.getNextNode()) {
              if(comparer.equals(nextnode)) {
                   found = true;
                   //remove the next node from the list and return it
                   prevnode.setNextNode(nextnode.getNextNode());
                   nextnode.setNextNode(null);
                   deletedNode = nextnode;
                   count = count - 1;
                   break;
         if (found) return deletedNode;
         else throw new Exception ("Not found !!!");
    public Object[] list() {
         //code to gather information into object array
         Node node;
         Object[] nodes = new Object[count];
         node = head.getNextNode();
         for (int i=0; i<count; i++) {
              nodes[i] = node.getInformation();  // this is the line that cause runtime error after deleting...but before deleting, it works without problem.
              node = node.getNextNode();
         return nodes;
    }Please help me in figuring out what went wrong with that line...so far i really can't see any problem with it but it still throws a NullPointerException
    Thanks

    OK -- I've had a cup and my systems are coming back on line...
    The problem looks to be the way that you are handling the pointer to the previous node in your deletion code. Essentially, that is not getting incremented along with the nextNode -- it is always pointing to head. So when you find the node to delete then the line
       prevnode.setNextNode(nextnode.getNextNode());will set the nextNode for head to be null in certain situations (like if you are removing the tail, for instance).
    Then when you try to print out the list, the first call you make is
    node = head.getNextNode();Which has been set to null, so you get an NPE when you try to access the information.
    Nothing like my favorite alkaloid to help things along on a Monday morning...
    - N

  • How to catch and display a link content in another portlet page?

    Can you tell me how to display a URL content into next page after an user click s on this link? I am developing a JSR 168 portlet under a Portal. I have 3 pages so far in my portlet. view.jsp, view2.jsp and IpByHourPage.jsp. view2.jsp displays a lis of IP address. When an user clicks on an IP in view2.jsp, it goes to IpByHourPage.jsp. How to catch the IP address such as 123.23.89.21 that an user just click displayed in IpByHourPage.jsp. I don't know why I got null value returned.
    Also, I don't know how to do a "go back to previous page". I want to go back to view2.jsp from IpbyHourPage.jsp
    Here is my code
    in view2.jsp
    <portlet:renderURL var="aURL">
    <portlet:param name="goto" value="IpByHourPage"/>
    </portlet:renderURL>
    <a href="<%=aURL.toString() %> "><%=MyIP%></a>
    in IpByHourPage.jsp
    <%
    String MyIPHour = request.getParameter("goto");
    %>
    <h1>IP Report by Hour ( <%=MyIPHour%> )</h1>
    <portlet:renderURL var="Ret_IPByHour">
    <portlet:param name="Ret_IPHourPage" value="Ret_IPByHourPage"/>
    </portlet:renderURL>
    <center> <a href="<%=Ret_IPByHour.toString() %> "><b>Choose Another IP</b></a></center>
    in my .java file
    protected void doView(RenderRequest request, RenderResponse response)
    throws PortletException, IOException, UnavailableException {
    response.setContentType("text/html");
    String MyBegDate = request.getParameter("BegDate");
    String MyEndDate = request.getParameter("EndDate");
    String MyNetworks = request.getParameter("networks");
    String MyYourName = request.getParameter("yourname");
    PortletURL renderURL = response.createRenderURL();
    renderURL.setPortletMode(PortletMode.VIEW);
    request.setAttribute("renderURL", renderURL.toString() )
    String GotoRenderAction = request.getParameter("goto");
    String MyIPHourAction = request.getParameter("Ret_IPHourPage");
    if ( (MyIPHourAction!=null) && MyIPHourAction.equals("Ret_IPByHourPage") )
    PortletRequestDispatcher kk = getPortletContext().getRequestDispatcher("/view2.jsp");
    kk.include(request, response);
    if (MyIPHourAction != null && MyIPHourAction.equals("Ret_IPByHourPage"))
    PortletRequestDispatcher mm = getPortletContext().getRequestDispatcher("/view2.jsp");
    mm.include(request, response);
    if (GotoRenderAction != null && GotoRenderAction.equals("IpByHourPage"))
    request.setAttribute("BegDate", "MyBegDate");
    request.setAttribute("EndDate", "MyEndDate");
    System.out.println("BegDate" + MyBegDate);
    System.out.println("Endate" + MyEndDate);
    PortletRequestDispatcher mm = getPortletContext().getRequestDispatcher("/IpByHourPage.jsp");
    mm.include(request, response);
    if(MyEndDate!= null )
    PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/view2.jsp");
    prd.include(request, response);
    else if (MyEndDate==null && GotoRenderAction == null)
    PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/view.jsp");
    prd.include(request, response);
    The problem for above code is the clicked single IP can not be displayed in IpByHourPage.jsp. and I cannot go back to view2.jsp from IpByHourPage.jsp. when I click "Choose Another IP"
    I find out that the MyBegDate and MyEndDate values are all null when I click Choose Another IP link. I got the following error message
    Caused by: javax.servlet.ServletException: Unparseable date: "null null"
         at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
         at org.apache.jsp.view2_jsp._jspService(view2_jsp.java:651)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    How to fix above problems. Thanks

    I think the problems are related to portletsession. But I don't know how to use it. How to put portletsession into doview method or my jsp pages. Can anyone tell me in my code? Thanks a lot.

  • Interactive report conditional display of link column - apex 4

    I create an interactive report
    select object_id,
           object_name,
           case
            when mod(rownum, 2) = 0
            then 'block'
            else 'none'
           end  display_link
    from user_objects
    where rownum <= 10in the Link Column for the report I selected one of the edit icons and put the following in the link attributes
    style="display:#DISPLAY_LINK#"I also edited the object_id and set the Column Link and selected an edit icon and put the same style in the link attributes.
    The link under the column displays correctly but the link for the report does not seem to substitute the #DISPLAY_LINK# from the report. Any Ideas?

    Here's how I've done this:
    SELECT ORG_ID,
           CLEARER_NAME,
           LEGAL_NAME,
           MARGINING_ACCOUNT,
           RULE_GROUP_DESCR,
           VIOLATION_COLOR,
           VIOLATION_LEVEL,
           CASE MARGIN_IND
            WHEN 'Y' THEN '&nbsp'
            ELSE '<a href="#" title="Ignore This Alert"><img src="/i/ice/images/hide.png" alt="Ignore"></a>'
           END AS IGNORE_LINK,
           ....This takes care of either showing (or not showing) the link.
    IN order to process when it is present, not that the address is "#" This will cause your cursor to change to a hand (or whatever your pointer is) when the mouse floats over the link. The actual transfer to the next page, I handle with jQuery/JavaScript.
    Create a Dynamic Action.
    Event: Click
    Selector Type: jQuery Selector
    jQuery Selector: 'aalt'
    Event Scope: Live
    (note that the jQuery Selector is finding the alt attribute that I set on my link in the SELECT above . Tweak as needed.
    This "Action" for this DA will be to "execute JavaScript code"
    Normally, I would set some values into Page Items and then create a branch to pass this values to the next page. I am doing the same thing in the following code. I am getting the values off of the row wherein the user clicked on the link. I am setting these values from the row into the page item values. Then, I am submitting the page. All the "htmldb_Get" business is just stuff that I have to do to get the page item values into the session (so that I can pass them to the next page).
    var clickedRow = this.triggeringElement.parentNode.parentNode.parentNode;
    var ruleGroupDescr = $(clickedRow).children('td[headers="RULE_GROUP_DESCR"]').html();
    var ajaxRequest = new htmldb_Get(null, $x('pFlowId').value, null, 0); 
    gReturn = ajaxRequest.get();
    $s('P31_RULE_GROUP_DESCR', ruleGroupDescr );
    ajaxRequest = null; 
    var clearerName = $(clickedRow).children('td[headers="CLEARER_NAME"]').html();
    var ajaxRequest = new htmldb_Get(null, $x('pFlowId').value, null, 0); 
    gReturn = ajaxRequest.get();
    $s('P31_CLEARER_NAME', clearerName );
    ajaxRequest = null; 
    apex.submit("IGNORE");Finally, just create a branch to the next page and set the items on the next page to the ones on this page that are being set in the above script. Note that in my example, I have set the request to "Ignore" when I submitted; so, I set the condition of my branch to be Request = IGNORE.
    Hope this helps,
    -Joe

Maybe you are looking for

  • Is there a maximum number of printers that iOS can address/list?

    A school client of ours has raised this question regarding their iPads, and I can't find an answer anywhere (they believe the limit is eleven printers): can anyone come up with a definitive number? TIA, Paul.

  • Company code wise material with quantity table

    Hi I need Table for company code wise material with quantity to check 2009 stock which is issued. thanks Edited by: pandu123 on Aug 17, 2011 1:21 AM

  • DO NOT USE OUSIDE YOUR HOME AREA

    Hello fellow Z10-ners I just came back from the states. For the first 4 hours there I got 7 emails with no pictures and then a SMS came that I used 40 MB of data. $200.75+  GST. I guess there are background programs that use data and I didn't even us

  • ShObjIdl.h compile error when including Photoshop SDK header?

    I develop photoshop plugins on both Mac 10.6 and Windows 7, now my code has been built and run successfully on Mac, but on Windows there are curious compile errors in a file "ShObjIdl.h", this is a Windows SDK header file. ( my VC++ version is 2010 )

  • X61 partition on vista

    Hi, I have a brand new X61 with Vista Basic and would like to have two partitions instead of one. Now i have one partition (drive C) and i like to create another partition and install Linux. I mean i want create dual-boot vista and Linux (Ubuntu). Pl