Add image to Table cell

Hi All,
   Based on condition how can i add image to Table cell.

Hi,
Its very simple and straightforward.
All you need to do is:
1...Create a context(value attribute) of type string.
2...I am assuming that you have created a table, and mapped its columns with a node.
3...In the <i>TableCellEditor</i>  of your desired column, map the above context with the <i>imagesource</i> property.
4...In the code, set the value of this context to the image name(eg: abc.gif), on satisfying of a condition.
5...However, keep in mind to set the context value to some default blank image in the doinit() of the view, else, you will get a null pointer exception.
I hope this solves your problem.
Keep posting if you have any further queries.
Regards,
Hanoz

Similar Messages

  • Displaying of image in table cells

    Hi,
    I have a requirement where i need to display an image in table cell editor. Can anyone please tell how to do this.
    Thank You,
    Madhavi

    Hi
    The link is related to the same code as well..
    First copy all your images into "project/src/mimes/components/<packagename>"
    1) First create a new column for image and insert Child "Image" UI Element
    2) Create a Context in a view in which you are using Image UI Element
    3) Value Node
    Name : Image
    Cardidality : 1..1
    4) create 2 Value Attributes
    4)a ImageAlt (Calculate property - true)
    4)b ImageSrc (Calculate property - true)
    5)Bind the properties of Image
    alt - Image.ImageAlt
    source - Image.ImageSrc
    6) in getImageSrc()
    //according to your condition use your image
    retrun "XX.gif"
    7) in getImageAlt()
    return "Image Not Available"
    Case 2 :
    1) Add a new String attribute to your existing context
    2) Right click on your table in RootUIElememntContainer
    3) Edit Sturcture Binding
    4) Select the context which you modified , Select next
    5) in the next step for the newly created attribute select imageUIElement as type
    If you want to use that in wdDoinit()
    bind the two string value attributes to alt and source properties of ImageUIElement and write the following code
    in doinit
    wdContext.currentContextElement.set<src>("img1.gif") ;
    wdContext.currentContextElement.set<alt>("Image not found") ;
    Best Regards
    Chaitanya.A

  • How do I get rid of white space on one side of image in table cell?

    I'm making a disjointed rollover and when ever I add images it creates too much white space to the right of the cell.  How can I make the picture fit, so space is not wasted?  See image sample with red arrows where I want to remove space.  I've removed the width size from my table, hoping it would "spring to shape" around the images, but no go.

    HTML:
    Cellpadding="0"
    Cellspacing="0"
    CSS:
    table {border-collapse: collapse}
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb

  • Adding Image to table cell

    hello,
    I want to add Image related to particular file to cell of the JTable,
    I already have name of the file in cell but want to display file or directory name with its related icon.
    i am using TableCellRenderer ,but don't know how to keep both filename and icon.
    tell if you are aware of it.
    thanx

    The cell renderer component for the DefaultTableCellRenderer is a JLabel and this has a setIcon() method. You can extend this DefaultTableCellRenderer and inside the getTableCellRendererComponent(JTable table,
    Object value,
    boolean isSelected,
    boolean hasFocus,
    int row,
    int column) method you decide from the parameters which Icon (or ImageIcon) you want to display and then use setIcon() .

  • Insert shape over image in table cell

    Want to use circles, ovals, lines with arrows to point to some part (text or image) of a cell in a table.
    Need to emphasize certain areas of graphics in a document used as a step by step type document.
    If I add the shape outside the table and then try to drag/drop on to the image in the cell, the entire cell jumps to a new empty cell.
    Can nod get image to appear over the image in the table cell.

    Hello,
    do you think about this, please have a look here: http://help.adobe.com/en_US/dreamweaver/cs/using/WSc78c5058ca073340dcda9110b1f693f21-7b86a .html.
    Another way, to add text over an image uses Nancy O.'s Demo here (I would prefer by using PS or similar):
    http://alt-web.com/DEMOS/CSS-Sold-Out-Text-over-image.shtml
    Hans-Günter

  • What's the best way to place images in table cells?

    I'm working on a basic tooling catalog/list using a table for all of the information.  One of the columns is for an image of the tool.  Is there a way to place each image in a cell and have it resized to fit the cell dimensions (including my text inset settings)?  I'm using CS4 and the images are all tiff files, although I also have psd files of each.  Any suggestions would be appreciated.

    Table cells don't adjust automatically except in the vertical direction when set to "at least" some dimension, and I suspect you don't really want that anyway. Keep in mind that column width is constant through the whole table, so fitting the cell to the largest image is going to give you a giant coumn width that isn't used for smaller product shots in the same table.
    What about making an image frame the size you want, and setting the fitting options to fit proportionally? Copy that frame and paste into the cell, then place the image in the frame.

  • Background Image In Table Cell

    I'm not sure what I'm doing wrong or missing here. This is the first time that I'm using an image as a background. I've made a table with a 100% width with 3 colums and 3 rows. The left and right table cells have been merged and the 3 middle rows are at a width of 938 pixels. I have cropped the images correctly. The right column lines up perfectly, but the left column does not line up like it's supposed to with the image. You can take a look at it by going to http://www.wattsconcepts.com/new
    Here is the code below if anyone wants to take a look at it. Any help in solving this is greatly appreciated. I am using Dreamweaver CS5.5
    Thank you for your time!
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Watts Concepts - Kentucky Web Design - Harrodsburg, Kentucky</title>
    <style type="text/css">
    body {
              margin-left: 0px;
              margin-top: 0px;
              margin-right: 0px;
              margin-bottom: 0px;
              background-color: #000;
              background-image: url();
    </style>
    </head>
    <body>
    <table width="100%" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td rowspan="3" align="left" valign="top" background="images/left-index.jpg"> </td>
        <td width="938" align="center" valign="top"><img src="images/logo-index.jpg" width="938" height="172" /></td>
        <td rowspan="3" align="left" valign="top" background="images/right-index.jpg"> </td>
      </tr>
      <tr>
        <td align="center" valign="top"><img src="images/eye-index.jpg" width="938" height="296" alt="Reach Your Audience Today" /></td>
      </tr>
      <tr>
        <td align="center" valign="top"><img src="images/test-index.jpg" width="938" height="197" /></td>
      </tr>
    </table>
    </body>
    </html>

    Your HTML code should ideally be as follows:
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Watts Concepts - Kentucky Web Design - Harrodsburg, Kentucky</title>
    <style type="text/css">
    body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
    background-color: #000;
    </style>
    </head>
    <body>
    <table width="938px" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="938" align="center" valign="top"><img src="images/logo-index.jpg" width="938" height="172" /></td>
      </tr>
      <tr>
        <td align="center" valign="top"><img src="images/eye-index.jpg" width="938" height="296" alt="Reach Your Audience Today" /></td>
      </tr>
      <tr>
        <td align="center" valign="top"><img src="images/test-index.jpg" width="938" height="197" /></td>
      </tr>
    </table>
    </body>
    </html>
    Also, you don't need 3 columns for this website. 1 column and 3 rows should do. Also, never use 100% for <table> width. It's bad practice as you're making your site fluid which will render your site to malfunction on some browsers
    And you had the entire 3 sections as 1 image as your CSS body background-image. This is bad practice. Crop only what you want for each section, never give the entire merged site as 1 image.
    Try the code I've given you above and it should work perfect.
    A quick tip: Try learning and using DIV with pure CSS styling instead of tables. Tables are a thing of the past. You could just google it and you have tons of free resources on how to create a site using DIV. Also, there's a beautiful tutorial posted by one of our senior members here: http://www.adobe.com/devnet/dreamweaver/articles/dw_html5_pt2.html that explains how to create HTML5 site with Pure CSS styling using DIV tags.
    Cheers,
    ST

  • Place image in table cell in pages for iOS 5

    Can I place an image into a table cell in pages for iphone? This would keep me from having to take my expensive MBA out on the dangerous (for the computer) jobsite.  It would change my life to be able to do this on the iphone as my reports require it.  As of yet I've found no way to do this.
    Thanks in advance for your help!
    ~CR

    Put the text cursor in the cell and use the regual Place command. The image will be placed as an inline graphic in the empty paragraph.

  • How to add colors to table cells

    Hi ALL,
    Does anyone have any idea of adding colors to table cells?For example i am displaying monthly chart in a table view i want to fill the cells with colors when columns are saturday and sunday.
    Thanks in advance

    Hi,
    I want to pass the colors at bean level.For example
    private DefaultTableViewModel createNewTable
                                      (DefaultTableViewModel model) {
            Vector data = createData();
            Vector colName = new Vector();
            /* Define column names */
            colName.addElement("1stColumn");
            colName.addElement("2ndColumn");
            colName.addElement("3rdColumn");
            model = new DefaultTableViewModel(data, colName);
            return model;
        private Vector createData() {
            Vector dataVec = new Vector();
            Vector retVector = new Vector();
            /* 1st entry */
            dataVec.addElement("Row 1, Column 1");
            dataVec.addElement("Row 1, Column 2");
            dataVec.addElement("Row 1, Column 3");
            retVector.addElement(dataVec);
            /* 2nd entry */
            dataVec = new Vector();
            dataVec.addElement("Row 2, Column 1");
            dataVec.addElement("Row 2, Column 2");
            dataVec.addElement("Row 2, Column 3");
            retVector.addElement(dataVec);
            /* more entries */
            return retVector;
    suppose I want to pass the color at Row2,Column1.Can anyone post the sample code ?
    its little urgent.Thanks in advance

  • Images in Table cell

    HI,
    I have to display different images in a SAP .Net tabe control cell depends on the field values from a database. I set the Tabel cell editor property to "Image Instance" and programatically assign the relative path of the image "web resourcesimagesxxx.gif" according to the database field values. I can see at runtime the web source have correct URL to the image source but the image is not getting displayed on the iView. What am I doing wrong?? I follow this article to do the code part
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/nw/dotnet/pdk for .net faq - .net controls.faq
    Please help.
    thanks

    Thanks for the reply guys,
    Here is the code; I'm not using server "itemDtaBound"
    I set the field type as "image instance" at design time and at runtime after reading the data assign the graphics to the control according to the value returned from the database at the Page_Load
    I only took the relevant portion
            Dim sOrderByField As String = ""
            Dim sqlDate As String = FormatDBDateTimeSQL(Format(Now, "MM/dd/yyyy 00:00:00"))
            'Dim ConnStr As String = "server='(local)'; trusted_connection=true; database='tllink'"
            sSQL = "SELECT EmployeeName, BadgeId, Punch_Type,Punch_Date, Punch_time, TerminalID FROM TERMINAL_TRANSACTIONS"
         sSQL &= " WHERE (Punch_Date =" & sqlDate & ") AND (Punch_Type IN ('IN', 'OUT' ,'DEPT' )) AND ((CAST(Punch_Time AS VARCHAR) + '-' + BadgeId) IN"
            sSQL &= " (SELECT (CAST(MAX(PUNCH_TIME) AS VARCHAR) + '-' + BADGEID) FROM TERMINAL_TRANSACTIONS"
            sSQL &= " WHERE  (Punch_Date =" & sqlDate & ") GROUP BY BADGEID))"
    rRec = g_cDB.GetRec(sSQL, , True)
    OleDbDataAdapter1.Fill(dSQLSet,rRec, "TERMINAL_TRANSACTIONS")
            'SQLTable = dSQLSet.Tables(0)
            Dim RowCurrent As DataRow
            Dim tr As SAP.Web.UI.Controls.TableRow
    For Each RowCurrent In dSQLSet.Table("TERMINAL_TRANSACTIONS").Rows
                tr = New SAP.Web.UI.Controls.TableRow
                If IsDBNull(RowCurrent("EmployeeName")) = False Then
                    tr.Cells.Add(New SAP.Web.UI.Controls.TableCell(New TextView(RowCurrent("EmployeeName"))))
                Else
                    tr.Cells.Add(New SAP.Web.UI.Controls.TableCell)
                End If
                If IsDBNull(RowCurrent("badgeid")) = False Then
                    tr.Cells.Add(New SAP.Web.UI.Controls.TableCell(New TextView(RowCurrent("badgeid"))))
                Else
                    tr.Cells.Add(New SAP.Web.UI.Controls.TableCell)
                End If
                If IsDBNull(RowCurrent("Punch_Type")) = False Then
                    If RowCurrent("Punch_Type") = "IN" Then
                        tr.Cells.Add(New SAP.Web.UI.Controls.TableCell(New SAP.Web.UI.Controls.Image("Web Resources/Images/in.gif")))
                    ElseIf RowCurrent("Punch_Type") = "OUT" Then
                        tr.Cells.Add(New SAP.Web.UI.Controls.TableCell(New SAP.Web.UI.Controls.Image("Web Resources/Images/out.gif")))
                    Else
                        tr.Cells.Add(New SAP.Web.UI.Controls.TableCell(New SAP.Web.UI.Controls.Image("Web Resources/Images/transfer.gif")))
                    End If
           End If
           Me.DataTable.Items.Add(tr)
    Next
    My table displays the employee name and badge id but the images are coming as broken link. I added the images to the web resources before deploying the par.
    The follwing is the runtime source from the browser
    </td></tr><tr rr="1"><td tableid="tae241ba0_DataTable" cc="0" rr="1" class="urSTTD urSTTDBdr1" style="padding:0;"><div tabindex="0" ti="0"><span ct="TextView" style="margin:0px;"></span></div></td><td tableid="tae241ba0_DataTable" cc="1" rr="1" class="urSTTD urSTTDBdr" style="padding:0;"><div tabindex="0" ti="0"><span ct="TextView" onkeydown="sapUrMapi_TextView_menuActivate('',event)" class="urTxtStd" style="white-space:nowrap;">000000000003412770</span></div></td><td tableid="tae241ba0_DataTable" cc="2" rr="1" class="urSTTD urSTTDBdr" style="padding:0;"><div tabindex="0" ti="0"><img class="urImg" src="/irj/portalapps/Timelink_Portal_APP/Images/green.gif" ct="Image" border="0" style="height:28;width:30;"></img></div></td><td tableid="tae241ba0_DataTable" cc="3" rr="1" class="urSTTD urSTTDBdr" style="padding:0;"><div tabindex="0" ti="0"><img class="urImg" src="/irj/portalapps/Timelink_Portal_APP/Images/in.gif" ct="Image" border="0"></img></div></td><td tableid="tae241ba0_DataTable" cc="4" rr="1" class="urSTTD urSTTDBdr" style="padding:0;"><div tabindex="0" ti="0"><span ct="TextView" onkeydown="sapUrMapi_TextView_menuActivate('',event)" class="urTxtStd" style="white-space:nowrap;">2/10/2006</span></div></td><td tableid="tae241ba0_DataTable" cc="5" rr="1" class="urSTTD urSTTDBdr" style="padding:0;"><div tabindex="0" ti="0"><span ct="TextView" onkeydown="sapUrMapi_TextView_menuActivate('',event)" class="urTxtStd" style="white-space:nowrap;">07:24:58</span></div>
    as you can see it includes the path to th images green.gif and in.gif
    thanks

  • Images as table cell content

    Hi,
    we are using thumbnail images for representing some employee status in a table. Images are displayed successfully.
    Problem is the white space between two cells, we want to eliminate the space between two cells. I have tried cell width property but it doesn't help.
    Any other suggestions to achieve this.
    Thanks a lot.
    Rgds

    Hi Sharanya,
    I could not find property cell spacing and cell padding property for cell.
    I am on Nw04.
    Is there other way we can achieve this.
    Rgds

  • Add image to table header

    Hello dear All
    My requirement is to add an image in jTable header( *.png or *.gif image in the tabel header.) I.e if there are 5 columns i have to add 5 images in the table header.
    Please help me to overcome this issue.
    Thanks

    Sorry, it looks like the tutorial has recently been updated. Sorting is now supported in JDK6. Prior to this you needed to write your own code for sorting and the tutorial include sample classes to help you out.
    Anyway, I found some old code lying around that should get you started:
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.table.*;
    public class TableHeader extends JFrame
         public TableHeader()
              Object[] columnNames =
                   "Some Text",
                   new ImageIcon("copy16.gif"),
                   new ImageIcon("add16.gif")
              //  Columns headings are cast to a String when created automatically.
              //  We want Icons, so use a special renderer and create the columns manually
              DefaultTableModel model = new DefaultTableModel(columnNames, 5);
              JTable table = new JTable();
              table.setAutoCreateColumnsFromModel( false );
              table.setModel( model );
              table.getTableHeader().setDefaultRenderer( new HeaderRenderer() );
              for (int i = 0; i < columnNames.length; i++)
                   TableColumn newColumn = new TableColumn(i);
                   newColumn.setHeaderValue( columnNames[i] );
                   table.addColumn(newColumn);
              table.setPreferredScrollableViewportSize(table.getPreferredSize());
              JScrollPane scrollPane = new JScrollPane( table );
              getContentPane().add( scrollPane );
         class HeaderRenderer extends DefaultTableCellRenderer
              public Component getTableCellRendererComponent(
                   JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int col)
                   setBorder(UIManager.getBorder("TableHeader.cellBorder"));
                   setHorizontalAlignment(CENTER);
                   //  display text or icon
                   System.out.println(value.getClass());
                   if (value instanceof Icon)
                        setIcon( (Icon)value );
                        setText( "" );
                        setBackground( Color.green );
                   else
                        setIcon( null );
                        setText((value == null) ? "" : value.toString());
                        setBackground( Color.yellow );
                   return this;
         public static void main(String[] args)
              TableHeader frame = new TableHeader();
              frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
              frame.pack();
              frame.setLocationRelativeTo( null );
              frame.setVisible(true);
    }

  • Add Hyperlink to table cell content dynamically

    Hello,
              I have a xdp form created in Livecycle designer. We populate a table by dynamically merging XML to this xdp form uing livecycle FormServices.
    For example:
    the XML:
    <data>
    <person>
         <name> George</name>
         <age>11</age>
    </person>
    <person>
         <name> John</name>
         <age>30</age>
    </person>
    </data>
    populated in table of pdf:
    Name
    Age
    George
    11
    John
    30
    How do I add the hyper link to "George", "John" programmatically, so it can be link to some other URL.
    Thanks,
    Joanna

    So my table is like this:
    Product
    Price
    Apples
    1.29
    Oranges
    2.49
    Grapes
    1.99
    and my XML is like this:
    <
    Product ProductType="Apples">
    <URL>www.apples.com</URL>
    <Price>1.29</Price>
    </Product>
    <
    Product ProductType="Oranges"> 
    <URL>www.oranges.com</URL>
    <Price>2.49</Price>
    </Product>
    <
    Product ProductType="Grapes"> 
    <URL>www.grapes.com</URL>
    <Price>1.99</Price>
    </Product>
    What I want to do is populate the table from the XML file, and make the URL element be linked from the product name (Apples for instance) at runtime  when I fill the table.  Any ideas?

  • Left justify images in table cell

    I have just started trying to learn DW.
    Why do some of my images left justify in the cell (as I want
    them to) while others float out in the center of the cell?

    > working and the code that isn't and deleted some code -
    a blockquote tag
    > ? -
    > that seems to have done the trick.
    It certainly would.
    Until you gain some proficiency with HTML and then with CSS,
    your experience
    with DW will be one of these mysteries after another. The
    problem is, that
    knowledge would PREVENT you from clicking on the icon that
    inserts the
    <blockquote> tag (mistakenly identified as an indent in
    DW) in the first
    place, and would then allow you to find it and remove it once
    it has been
    used.
    Good luck!
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "nugentdav" <[email protected]> wrote in
    message
    news:g2anes$ddi$[email protected]..
    >I have not looked at my code, as you pointed out, I need
    to know html and
    >css
    > to really be proficient with this and get the results I
    want.
    >
    > BUT just by your suggestion I made the comparison
    between the code that is
    > working and the code that isn't and deleted some code -
    a blockquote tag
    > ? -
    > that seems to have done the trick.
    >
    > Thanks!
    > Nugent
    >

  • How to add image in jtable header using 'Default table model'

    Hi,
    I created a table using "DefaultTableModel".
    im able to add images in table cells but not in 'table header'.
    i added inages in table by overriding "getColumnClass" of the DefaultTableModel.
    But what to do for headers?
    please help.
    Thanks in advance.

    The 'Java 5 tutorial' is really an outstanding oneI should note the the current tutorial on the Sun website has bee updated for Java 6. It contains updates to reflect the changes made in JDK6. Once of the changes is that sorting of tables is now supported directly which is why I needed to give you the link to the old tutorial.
    http://java.sun.com/docs/books/tutorial/uiswing/TOC.html

Maybe you are looking for

  • How can i use adat inputs thru my motu 828 in logic pro7

    hey guys, i really need help with this one. i'm new to logic and can't figure out how to use my additional inputs from adat in logic. it just shows me 12 inputs and outputs, which are just the i/o from motu 828 interface, not including the otpical on

  • Session or Cookies

    I'm creating a Forum for a society, What's better sessions? or cookies? Cookies seem to be secure enough, but might I get in trouble if someone sets a browser to disable cookies? Octavian

  • New Spool Request not generating

    Dear All, I have seen print preview of one PO and taken print which has created a spool request. Another PO also I have seen the preview and taken print, but it has added to previous spool request as second page. My problem is I need to generate new

  • WSDL endpoint protocol for process

    We have a number of processes in LiveCycle being used as web services called from a PDF embedded in workspace. The processes are split across three Livecycle ES2 nodes with JBoss 4.2. When I consume the WSDL via https in Designer I would expect for t

  • Please don't get angry...

    Hi all, This question is gonna make some of you mad but I just can't manage to help myself (I've really tried). I'm trying to create and manipulate executable jar files using command prompt (C:\WINDOWS\system32\cmd.exe) but everytime I enter the[b] j