Help:JCombobox in table cell

I have a column using combobox as cell editor in jtable, the combo box 's content is different based on the row user selects, for example, user selects the first row, the combo box will show selections" hi, hello", when user selected the second row, that row's combobox will show "where, what, why". How can I create individual comboxeditor or renderer for each cell in combo box column, so the contents of combo box will change based on the different rows. My old way is just to create a editor for the whole column, but based on the selection, remove all items in the combobox, and add new items in that combo box. The problem is when user first click the combo, all items disappear,the second click will show all newly added items,how can I show just all new items just by one click.
Thanks a lot.

I have a code that con solve your problem... It shows the contents of a cell as jcombobox...
/*--- formatted by Jindent 2.1, (www.c-lab.de/~jindent) ---*/
import java.awt.*;
import javax.swing.*;
import javax.swing.table.*;
* Class declaration
* @author
* @version %I%, %G%
public class TableComboDemo extends JPanel {
     private JTable table;
     private int rows = 3;
     private int columns = 3;
     private int depth = 3;
     private String[][][] strings = new String[rows][columns][depth];
     private TableCellRenderer myRenderer = new MyComboRenderer();
     private TableCellEditor myEditor = new MyComboEditor();
     private TableModel myTableModel = new MyTableModel();
     * Constructor declaration
     * @see
     public TableComboDemo() {
          setupModel();
          table = new JTable() {
               * Method declaration
               * @param row
               * @param column
               * @return
               * @see
               public TableCellRenderer getCellRenderer(int row, int column) {
                    return myRenderer;
               public TableCellEditor getCellEditor(int row, int column) {
                    return myEditor;
          table.setModel(myTableModel);
          this.add(new JScrollPane(table));
     * Method declaration
     * @see
     public void setupModel() {
          strings[0][0][0] = "a";
          strings[0][0][1] = "b";
          strings[0][0][2] = "c";
          strings[0][1][0] = "d";
          strings[0][1][1] = "e";
          strings[0][1][2] = "f";
          strings[0][2][0] = "g";
          strings[0][2][1] = "h";
          strings[0][2][2] = "i";
          strings[1][0][0] = "j";
          strings[1][0][1] = "k";
          strings[1][0][2] = "l";
          strings[1][1][0] = "m";
          strings[1][1][1] = "n";
          strings[1][1][2] = "o";
          strings[1][2][0] = "p";
          strings[1][2][1] = "q";
          strings[1][2][2] = "r";
          strings[2][0][0] = "j";
          strings[2][0][1] = "s";
          strings[2][0][2] = "t";
          strings[2][1][0] = "u";
          strings[2][1][1] = "v";
          strings[2][1][2] = "w";
          strings[2][2][0] = "x";
          strings[2][2][1] = "y";
          strings[2][2][2] = "z";
     * Method declaration
     * @param args
     * @see
     public static void main(String[] args) {
          JFrame frame = new JFrame();
          frame.getContentPane().add(new TableComboDemo());
          frame.pack();
          frame.setVisible(true);
     * Class declaration
     * @author
     * @version %I%, %G%
     private class MyComboRenderer implements TableCellRenderer {
          private JComboBox combo;
          * Method declaration
          * @param table
          * @param value
          * @param isSelected
          * @param hasFocus
          * @param row
          * @param column
          * @return
          * @see
          public Component getTableCellRendererComponent(
               JTable table,
               Object value,
               boolean isSelected,
               boolean hasFocus,
               int row,
               int column) {
               combo = new JComboBox((String[]) value);
               return combo;
     * Class declaration
     * @author
     * @version %I%, %G%
     private class MyComboEditor extends DefaultCellEditor {
          private JComboBox combo;
          public MyComboEditor() {
               super(new JComboBox());
          * Method declaration
          * @param table
          * @param value
          * @param isSelected
          * @param row
          * @param column
          * @return
          * @see
          public Component getTableCellEditorComponent(
               JTable table,
               Object value,
               boolean isSelected,
               int row,
               int column) {
               combo = new JComboBox((String[]) value);
               return combo;
     * Class declaration
     * @author
     * @version %I%, %G%
     private class MyTableModel extends AbstractTableModel {
          * Method declaration
          * @return
          * @see
          public int getRowCount() {
               return rows;
          * Method declaration
          * @return
          * @see
          public int getColumnCount() {
               return columns;
          * Method declaration
          * @param row
          * @param column
          * @return
          * @see
          public Object getValueAt(int row, int column) {
               return strings[row][column];
          * Method declaration
          * @param row
          * @param col
          * @return
          * @see
          public boolean isCellEditable(int row, int col) {
               return true;
}

Similar Messages

  • Need Help With Shifting Table Cells

    Hi --
    I was asked to take a look at this page and fix the cell that have shifted down:  http://www.moore-engineers.com/contact/contact.html.  It's been quite a while since I've really worked with tables, and I'm having a hard time figuring this out.
    Can someone take a look and let me know what's going on?  I'd appreciate any help.
    Thanks,
    John

    Hi Osgood --
    Thanks for taking a look.  You're comments validated what I thought.  And you're right...that's not my work.  If you ever see me produce work like this, please have Adobe revoke my DW license!
    I spend about an hour with it yesterday and no matter what I did, either the problem went uncorrected or the entire table was blown apart.  I eventually gave up.
    I think my client suspects he's been "stitched-up" by the person who built the site which is why he contacted me.  I've recommended that the site be totally rewritten.
    Thanks again for your comments.
    John

  • Table cell color in webdynpro for ABAP

    Hai,
    I need to differentiate some table cell values using color change or some other way.
    while populating table values, I have a field like mandatory or optional. According to mandatory field, I need to chage color the text of the another column in the same table called "name".
    Another help about the table cell popin, I have a column name like "Name" in the table like link to action. If a person clicks on any of the "name" cells, the descriptive value should come as table cell popin.
    If you have sample code, that will help me lot.
    Thanks,
    I will reward points any type of helpful answer.
    Tamil

    Hi,
    did you take a look at the information under http://help.sap.com/saphelp_nw2004s/helpdata/en/b5/ac884118aa1709e10000000a155106/frameset.htm and WDR_TEST_TABLE in the system?
    Regards, Heidi

  • Search help in case of a table cell editor

    Hi
    I need a search help in case of a table cell editor as well as the the other requirement is that it shld be a reusable one.
    could anyone of u suggest me some methods
    regards
    Nikhil Tapkir

    There are several ways of doing this.
    1. Use OVS
    2. Create a Search help in R3. Call the function module.
    3. Create a Jar file which would provide the result .
    It is upto you on which ever way you want to provide
    Kumar

  • Robohelp HTML 9 hyperlinks in table cells help

    Hi,
    I'm creating a table in robohelp html 9 and adding hyperlinks in the table cells. If the hyperlink is the first word in that cell robohelp is adding styling code to the link eg <td><a href="#" style="color: #0000ff; text-decoration: underline; ">test</a></td>.
    If I add a link to the second word in a table cell the styling does not appear or even if I add a space before the link the code does not appear eg <td>&#160;<a href="#">test</a> </td>.
    The code appears when I flick between design and HTML views but it does not make any difference in which view I create the link.
    No matter how many times I delete this code is keeps coming back. Can  anyone please help me? Is there some default that gives this the styling  code?Does anyone else get this issue?
    A table with the different examples is below. It was created in design view by clicking table>insert table>OK. Links added by clicking the insert hyperlink button.
    <table style="border-collapse: separate; border-collapse: separate;" cellspacing="0"
             width="33.333%" border="1">
        <col style="width: 100%;" />
        <tr>
            <td><a href="#" style="color: #0000ff; text-decoration: underline; ">test
             that has the added code</a></td>
        </tr>
        <tr>
            <td>&#160;<a href="#">test with space in front of link</a> </td>
        </tr>
        <tr>
            <td><a href="#" style="color: #0000ff; text-decoration: underline; ">test</a></td>
        </tr>
        <tr>
            <td>A <a href="#">test</a> </td>
        </tr>
    </table>
    Thanks in advanced

    I have the same problem with those stupid links in tables - I've been working on this for HOURS and HOURS...... Based on previous experience, I assumed it must only be me and an ill-formed stylesheet. The table/link issue just came to my attention because I am in the process of changing styles/formats to a new company standard (new link color) and thought I really screwed my CSS up as I was changing things!
    My only workaround thusfar has been to rewrite some data in the tables so that text will precede the link (yes, I did).  And where I just couldn't do that, I resigned myself to the problem and forced a different color on the links (changing the #0000ff).  One plus was that RH didn't rewrite the color code once it was changed manually..... but then I realized later that I didn't consider the hover color when I did this, so I now have to go back and correct them. 
    So glad to find your post...........
    I played with the idea of adding hidden text, but was worried that the problem was really a result of an issue with my CSS and doing that wasn't the proper way to fix it.   So, without guilt, I took Rick's suggestion and added an invisible dot/period at the beginning of every link in a table, when that link is the first or only content in the td.  Did the trick!  Now the links assume my declared css style! 
    I submitted a bug report.......
    Thank you!!!

  • JComboBox table cell renderer problem

    The following program demonstrates a difference in behavior of table cell editor combobox based on whether the combo box is editable or not. If the ComboBox is editable, then the first click into the table cell starts the edit and shows the popup, whereas if the combobox is not editable then it takes 2 clicks into the cell to cause the popup to become visible. I am trying to achieve the 1 click popup behavior while keeping the combobox not editable. Run the following program, and click on various cells, the top table requires 2 clicks for a popup, and the bottom table only 1. The only difference is the editablility of the combobox. (This is windows l&f)
    import java.awt.BorderLayout;
    import java.awt.Component;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import javax.swing.DefaultCellEditor;
    import javax.swing.JComboBox;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JSplitPane;
    import javax.swing.JTable;
    import javax.swing.UIManager;
    import javax.swing.table.DefaultTableModel;
    import javax.swing.table.TableCellRenderer;
    public class JTableComboBoxCellEditorTest {
         public static void main(String[] args) {
              try {
                   UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
              catch (Exception e){e.printStackTrace();}
              DefaultTableModel tableModel = new DefaultTableModel(
                        new Object[][] {{"1","2"},{"2","3"},{"3","1"} },
                        new Object[]{"Column1","Column2"}
              final JComboBox renderer = new JComboBox(new Object[]{"1","2","3"});
              TableCellRenderer cellRenderer = new TableCellRenderer() {
                   public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int col){
                        renderer.setSelectedItem(value);
                        return renderer;
              JTable table1 = new JTable(tableModel);
              final JComboBox badEditor = new JComboBox(new Object[]{"1","2","3"});
              badEditor.setEditable(false);
              table1.setDefaultEditor(Object.class, new DefaultCellEditor(badEditor));
              table1.setDefaultRenderer(Object.class, cellRenderer);
              table1.setRowHeight(24);
              JTable table2 = new JTable(tableModel);
              final JComboBox goodEditor = new JComboBox(new Object[]{"1","2","3"});
              goodEditor.setEditable(true);
              table2.setDefaultEditor(Object.class, new DefaultCellEditor(goodEditor));
              table2.setRowHeight(24);
              table2.setDefaultRenderer(Object.class, cellRenderer);
              JSplitPane split = new JSplitPane(JSplitPane.VERTICAL_SPLIT,new JScrollPane(table1), new JScrollPane(table2));
            JFrame f = new JFrame("Table Test");
            f.getContentPane().add(split,BorderLayout.CENTER);
                f.setBounds(100,100,500,500);
            f.addWindowListener(new WindowAdapter() {
                 public void windowClosing(WindowEvent e) {
                      System.exit(0);
            f.setVisible(true);
    }

    Setting a renderer for first column:
    assetTable.getColumnModel().getColumn(1).setRenderer(tableRenderer);Your custom renderer must honor the selection color and border or otherwise the first column will not look selected. You should subclass DefaultTableCellRenderer:
    public class AssesTableRenderer extends DefaultTableCellRenderer  {
      public Component getTableCellRendererComponent(...) {
        // default renderer uses a label
        JLabel label = (JLabel)super.getTableCellRendererComponent(...);
        // decide icon to use
        Icon icon = ...;
        label.setIcon(icon);
       return label;
    }

  • Help: Jbo Exception non blocking when using table cell renderer?

    Hi,
    JClient 9.5.2.
    When using Table Cell Renderer on an table cell attribute that is defined mandatory and activating the insert button, the (oracle.jbo.AttrValException) JBO-27014 exception is caught but it is not blocking and a new row is still inserted.
    The JClient component demo, table attribute list, has the same behaviour.
    You can add multiple rows even if not all required attributes have been documented.
    Can a Swing specialist help me on this one?
    Example of Table Cell Renderer:
    public class TableBasicStatusRenderer extends DefaultTableCellRenderer
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
    int row, int column)
    JLabel lb = new JLabel((String) StaticData.getStatusName(value)); // retrieves label from Map
    return lb;
    Regards
    Frederic

    Hi,
    I found something interesting, it could be a WORKAROUND!
    I noticed that in another detail panel with table layout the JBO exception was blocking and adding another row before completing the row was NOT possible.
    In the create method of the entity object of the displayed View Object I iterate over the detail row iterator to retrieve a maximum value.
    By the end of the method the pointer is positionned after the last row.
    So I added to the detail panel that doesn't block following code:
    In create method of detail Entity Object Impl (only one entity object involved for this View)
    // Retrieve master EntityObjectImpl from association:
    PostalTariffImpl postalTariffImpl = getPostalTariffAssoc();
    // Retrieve detail default row iterator
    RowIterator ri = postalTariffImpl.getPostalDetailGroupAssoc();
    // Position pointer after last row
    ri.last();
    ri.next();
    Question: Why does this solve the problem?
    Regards
    Frederic
    PS Les mysteres de l'informatique!

  • Table Cell Contents Disappears Please HELP!!!!

    PROBLEM: I have a different tables within different table cells in the Master table. One table per Master cell. Once I click on a table cell (0,0) and click on another table cell (1,1) the cell (0,0) blanks out. Likewise with other cells so that if I've click on all the cells in the Master Table and then clicked somewhere else all cell contents have disappeared.
    QUESTION: Do I need to call some UI refresh procedure????? I have a cell renderer which returns the table for each Master's Cell.
    I don't if this is clear but please help!
    Thanks

    Hi,
    the problem is that the DefaultCellEditor can't handle tables.
    So you have to write your CellEditor, which returns another table as Editor.
    class YourTableCellRenderer implements  TableCellRenderer{
        private  JTable table = new JTable();
        public Component getTableCellRendererComponent(JTable table,
                                                       Object value,
                                                       boolean isSelected,
                                                       boolean hasFocus,
                                                       int row,
                                                       int column){
             // set Data and Layout
             return table;
    }then set the Editor to your MasterTable (master) with.
    master.setCellEditor(TableCellEditor anEditor) or
    master.setDefaultEditor(Class columnClass,
                                 TableCellEditor editor);Hope this Helps.
    Michael

  • Scrolling table cell -- request help

    Hi,
    I would like to make a scrollable table cell (about 300px wide and 400 px high) that can contain both images and text. The content of the cell needs to be scrollable.
    I am a more than a newbie but not very skilled in Dreamweaver CS3 on a PC. I have worked a bit with CSS.
    If someone could assist me, I would really appreciate it especially if you are able to point me to video tutorial in which this is demonstrated. I have a membership in both Lynda.com and Kelby Online Training but didn't see anything there on this subject.
    I have read many posts on "scrollable DIVs" on the forum but haven't been able to apply them successfully.
    I would appreciate anyone's assistance.
    Many thanks.
    Jane

    Are you looking at adding a text box that can also contain pictures?
    Sounds almost like an overflow style in CSS.
    Something like this:
    <div style="width: 300px; height: 400px; background-color: #FFFFFF; font-size: 11px; overflow: auto;">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</div>

  • Need help: checkbox or radiobutton in table cell

    So basically i am looking for code samples or links to where i can find an implementation of 2 or 3 radiobuttons or checkboxes in a table cell/column, so that for each row, i can have a selection of A, B or C for a particular string in the first column. I can create a table with one checkbox, but i cant figure out 2 or more inside the same cell.
    thanks :)

    The JTable tutorial has a section titled "Using a Combo Box as an Editor". Take a look at their example for how to do this.
    http://java.sun.com/docs/books/tutorial/uiswing/components/table.html

  • Make Table Cells Transparents in InDesign CC 2014?? HELP!

    Hi!
    I used to be able to make the fill on my table cells different transparencies in indesign. I could make it so the background would lightly show through, and the text would still be legible. I also was able to make the table border be transparent so the background would totally shine through. I can't do this anymore with the new 2014 release.
    Does anyone know how to fix this??? Thanks!!!

    I think it works like this here:

  • JComboBox as a cell editor in JTable

    Hi,
    I've set one of my columns in my table to have a JComboBox as a cell editor. This is fine but my problem is that each row has different values in the JComboBox but when I update each row the column with the JComboBox they all end up with the same values.
    All help appreciated,
    Thanks,
    Lou
    // column with JComboBox
    TableColumn myCol = table.getColumnModel().getColumn(3);
    Vector comboValues = new Vector();
    JComboBox myCombo = null;
    for (int row = 0; row < tableModel.getRowCount(); row++)
    comboValues = new Vector();
    if (row == 0)
    // code here to add values to comboValues
    myCombo = (JComboBox) (((DefaultCellEditor) (table.getCellEditor(row, 3, .getComponent());
    myCombo = new JComboBox(comboValues);
    myCol.setCellEditor(new DefaultCellEditor(myCombo);
    tableModel.fireTableStructureChanged();
    tableModel.fireTableDataChanged();
    else
    // get differnent values for comboValues and update comboValues Vector
    myCombo = (JComboBox) (((DefaultCellEditor) (table.getCellEditor(row, 3, .getComponent());
    myCombo = new JComboBox(comboValues);
    myCol.setCellEditor(new DefaultCellEditor(myCombo);
    tableModel.fireTableStructureChanged();
    tableModel.fireTableDataChanged();

    Remember that you Table API specifies that each cell will use one instance of the specified editor...
    Think about that... the same editor is being used for each cell in that column... therefore, setting the
    data in the combobox et all will set it for that instance bveing used to edit the cell....
    Check out [url http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#editrender]How to use Tables if in doubt...

  • Different JComboBox in different Cells in a JTable

    Hi:
    I would like to make a JTable whose content would be several JBox with different values each one. That is to say, a double-column table with the value name in the first column and a range of possible values in the second column,
    Despite my efforts I was not able to do that. Every example that I found in the Web does not let different JComboBox per cell. They run with the same cell and values for each column.
    Can anybody help me?
    Thanks in advance.
    Carlos

    Here is an example that is based on camickr´s example:
    import javax.swing.DefaultCellEditor;
    import javax.swing.JComboBox;
    import javax.swing.JFrame;
    import javax.swing.*;
    import java.util.*;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.table.*;
    import javax.swing.JTable;
    import java.util.ArrayList;
    import javax.swing.DefaultCellEditor;
    import javax.swing.event.TableModelEvent;
    import javax.swing.event.TableModelListener;
    public class TableCell extends JFrame
         JComboBox comboBox1 = new JComboBox();
         JComboBox comboBox2 = new JComboBox();
         JTable table;
         ArrayList<DefaultCellEditor> editors = new ArrayList<DefaultCellEditor>();
         TableCell()
              comboBox1.addItem("Tennis");
              comboBox1.addItem("Fotboll");
              comboBox1.addItem("Baseball");
              comboBox1.addItem("Handboll");
              comboBox2.addItem("USA");
              comboBox2.addItem("Brazil");
              comboBox2.addItem("Australia");
              comboBox2.addItem("China");
              comboBox2.addItem("Egypt");
              DefaultCellEditor dce1 = new DefaultCellEditor(comboBox1);
              DefaultCellEditor dce2 = new DefaultCellEditor(comboBox2);
              editors.add(dce1);
              editors.add(dce2);
              final JTable table = new JTable()
              { // anonym innerklass
                   private Class editingClass;
                   public TableCellRenderer getCellRenderer(int row, int column)
                        editingClass = null;
                        int modelColumn = convertColumnIndexToModel(column);
                        int modelRow = convertRowIndexToModel(row);
                        if (modelColumn == 1)
                             Class rowClass = getModel().getValueAt(row, modelColumn).getClass();
                             return getDefaultRenderer( rowClass );
                        else
                             return super.getCellRenderer(row, column);
                   public TableCellEditor getCellEditor(int row, int column)
                        editingClass = null;
                        int modelColumn = convertColumnIndexToModel(column);
                        int modelRow = convertRowIndexToModel(row);
                        if (modelColumn == 1)
                             if (modelRow == 5)     // cell number 5 in column 1 which is going to show the combobox
                                  return (DefaultCellEditor) editors.get(0);
                             if (modelRow == 6)     // cell number 6 in column 1 which is going to show the combobox
                                  return (DefaultCellEditor) editors.get(1);
                             else
                                  editingClass = getModel().getValueAt(modelRow, modelColumn).getClass();
                                  return getDefaultEditor( editingClass );
                        else
                             return super.getCellEditor(row, column);
              table.setModel(new javax.swing.table.DefaultTableModel
                   new Object [][]
                          {"String", "I'm a string"},
                        {"Date", new Date()},
                        {"Integer", new Integer(123)},
                        {"Double", new Double(123.45)},
                        {"Boolean", Boolean.TRUE},
                        {"Combobox 1", "COMBOBOX 1"},
                        {"Combobox 2", "COMBOBOX 2"}
                   new String [] { "Attribute", "Data" }
              table.setPreferredScrollableViewportSize(table.getPreferredSize());
              JScrollPane scrollPane = new JScrollPane( table );
              getContentPane().add( scrollPane );
         public static void main(String[] args)
              TableCell frame = new TableCell();
              frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
              frame.pack();
              frame.setLocationRelativeTo( null );
              frame.setVisible(true);
    }

  • How to highlight the table cell color in respective colors as needed per the requirements??

    var aData = [
        {notificationNo: "10000000", description: "Maintenance for boiler", location: "G001-STG-UTLR-BLR", equipmentNo: "100000053", orderStatus: "ordered"},
        {notificationNo: "10000010", description: "Genreal Maintenance for boiler", location: "G001-STG-UTLR-BLR", equipmentNo: "100000053", orderStatus: "notordered"},
        {notificationNo: "10000011", description: "boiler Maintenance", location: "G001-STG-UTLR-BLR", equipmentNo: "100000053", orderStatus: "ordered"},
        {notificationNo: "10000012", description: "Pump breakdown", location: "G001-STG-UTLR-BLR", equipmentNo: "100000053", orderStatus: "ordered"},
        {notificationNo: "10000013", description: "External service boiler", location: "G001-STG-UTLR-BLR", equipmentNo: "100000053", orderStatus: "notordered"},
    jQuery.sap.require("sap.ui.model.json.JSONModel");
    var oEnterpriseAsset_NotificationConsole;
    sap.ui.model.json.JSONModel.extend("EAM_Notification_Console", {
        CreateNotificationConsole:function(){
            oEnterpriseAsset_NotificationConsole = this;
                var oTable = new sap.ui.table.Table({
                //title: "Table Example",
                visibleRowCount: 7,
                firstVisibleRow: 3,
                selectionMode: sap.ui.table.SelectionMode.Single,
            /*    toolbar: new sap.ui.commons.Toolbar({items: [
                    new sap.ui.commons.Button({text: "Button in the Toolbar", press: function() { alert("Button pressed!"); }})
                extension: [
                    new sap.ui.commons.Button({text: "Button in the Extension Area", press: function() { alert("Button pressed!"); }})
            }).addStyleClass("tableform");;
            oTable.addColumn(new sap.ui.table.Column({
            label: new sap.ui.commons.Label({text: "Notification"}),
            template: new sap.ui.commons.Link().bindProperty("text", "notificationNo").bindProperty("href", "href",
                    function(aValue)
            //    sortProperty: "notificationNo",
                //filterProperty: "notificationNo",
                width: "200px"
            oTable.addColumn(new sap.ui.table.Column({
                label: new sap.ui.commons.Label({text: "Description"}),
                template: new sap.ui.commons.Link().bindProperty("text", "description").bindProperty("href", "href"),
                //sortProperty: "notificationNo",
                //filterProperty: "notificationNo",
                //width: "200px"
            var oModel = new sap.ui.model.json.JSONModel();
            oModel.setData({modelData: aData});
            oTable.setModel(oModel);
            oTable.bindRows("/modelData");
        var idForTable= "DimTable"
            //alert("id of tbale " + idForTable);
            var htmlOutput = '<table id=' + idForTable + ' name="DimTab" style="border: 1px solid black;margin-left:15px;" cellpadding=6 cellspacing=0><tr style="background-color:#E5E5E5"><td><b>Dimension</b></td><td><b>Value</b></td></tr>';
            for(var i=0;i<aData.length;i++)
             alert(aData[i].notificationNo);
            htmlOutput += '<tr style="display:none;"><td style="border-right:1px solid #e5e5e5;">Contract No</td><td>'+ aData[i].notificationNo+'</td></tr>';
            htmlOutput += '<tr style="display:none;"><td  style="border-right:1px solid #e5e5e5;">Unit No</td><td>'+ aData[i].description+'</td></tr>';
            htmlOutput += '</table>';   
             var html2 = new sap.ui.core.HTML({
                 // static content
                 //content : "<div style='position:relative;background-color:white;'>Weather</div><script src='//www.gmodules.com/ig/ifr?url=http://www.google.com/ig/modules/builtin_weather.xml&synd=open&w=320&h=200&title=__MSG_weather_title__&lang=en&country=ALL&border=http%3A%2F%2Fwww.gmodules.com%2Fig%2Fimages%2F&output=js'></script>",
            content : htmlOutput,
                  //2 wrkng sydney content : '<div id="cont_Mzc0NjN8NXwxfDF8NHxlZGY1ZjV8M3xGRkZGRkZ8Y3wx"><div id="spa_Mzc0NjN8NXwxfDF8NHxlZGY1ZjV8M3xGRkZGRkZ8Y3wx"><a id="a_Mzc0NjN8NXwxfDF8NHxlZGY1ZjV8M3xGRkZGRkZ8Y3wx" href="http://www.weather-wherever.co.uk/australia/sydney_v37463/" target="_blank" style="color:#333;text-decoration:none;">Weather forecast</a> © weather</div><script type="text/javascript" src="http://widget.weather-wherever.co.uk/js/Mzc0NjN8NXwxfDF8NHxlZGY1ZjV8M3xGRkZGRkZ8Y3wx"></script></div>',
                  //content : '<div style="margin-left:-10px;margin-top:10px;width:100%;"><LINK rel="StyleSheet" href="http://weatherandtime.net/new_wid/w_5/style.css" type="text/css" media="screen"><div class="ww_5" id="ww_5_2119"><div class="l_b"></div><div class="c_b"><div class="day" id="d_0"><span class="den"></span><br><span class="date"></span><br><span class="temp"></span><div class="pict"></div><span class="press"></span><br><span class="hum"></span><br><span class="vet"></span><br></div><div class="day" id="d_1"><span class="den"></span><br><span class="date"></span><br><span class="temp"></span><div class="pict"></div><span class="press"></span><br><span class="hum"></span><br><span class="vet"></span><br></div><div class="day" id="d_2"><span class="den"></span><br><span class="date"></span><br><span class="temp"></span><div class="pict"></div><span class="press"></span><br><span class="hum"></span><br><span class="vet"></span><br></div><div class="cl"></div><div class="links"><a target="_blank" title="Pune Weather forecast" href="http://weatherandtime.net/en/Asia/India/Pune-weather.html">Pune Weather forecast</a><br><a style="font-size:12px !important;color:#12A0D7 !important;text-decoration:none !important;" href="http://weatherandtime.net/en/widgets-gallery.html" title="weather"></a></div></div><div class="r_b"></div></div><script type="text/javascript" src="http://weatherandtime.net/w_5.js?city=2119&lang=en&type=2&day=3"></script></div>',
              // initially behaves the same as Sample 1
                 preferDOM : false,
                 // use the afterRendering event for 2 purposes
        return     oTable;
    /* In the screen shot as u can see.. I have to highlight the table cell in green color and red color for ordered and unordered status(which is binded to a json data) respectively....anyone please help??

    Hi Abhi,
                   Check this link it may helpHow I made highlight of specific values in Table

  • Looping table cells....... is it possible to loop more than one table cell?

    Hi there
    Hope everyone is doing well
    I have been using the addt looper wizard and it works great.....
    I usually put all the things I want to loop into one cell.... then select all the things and apply the looper.... which works fine....
    But..... it is hard to align all the elements I want to loop
    I have been using transparent gif images to space the loops evenly but when I space dynamic taxt on top of each other there is a large gap.....
    It is a nightmare to get it looking even
    Ok say I want to loop this.....
    A thumbnail
    Product ID
    Price
    It would look like this
    A thumbnail
    Product ID
    Price
    Because I cannot reduce the space between the lines......
    So I would like to place all the different elements in separate table cells and loop them..... I have tried and get really strange results....
    When you look at most online shops, their product pages have a thumbnail image the id, price, description, etc.... all spaced evenly.... and looks like is looped...... So.... how do I do it?
    Is there any easier way to align the things I want to loop?
    Any help would be great

    Hi there
    I seem to have figured out how to loop cells....
    Should have thought of it earliar but anyway
    Was easy....
    Just create a looped (repeat) region and insert a table into the region and edit the table to align all the looped elements easily....
    Cool

Maybe you are looking for

  • Boot Windows 7 Off of External SSD?

    So I currently have a Macbook Pro Retina (mid 2012) with 500gb of SSD. I have it split (320gb mac/180 win) because I use it for Final Cut Pro editing on the mac side and Steam/PC Gaming on the Windows side. I am considering purchasing a Transcend Jet

  • File upload with DAD not working

    Hi all, I have an application which uses the file upload function, similar to the sample http://otn.oracle.com/products/database/htmldb/howtos/howto_file_upload.html During the development I was not using a DAD and it was working perfectly. Now I hav

  • Scheduled job not getting executed on a logical standby

    Hello, We have created a job(through dbms_scheduler API). The job is enabled and shows up in the SCHEDULERJOBS view also. However the job does not get executed. I looked into the following tables there was no relevant entry found for the aforesaid jo

  • No admin in project

    Hi, I have some sensitive data that needs to be run through EDQ, but I don't want make it available to Administrators. However, in the Security tab of the Project Properties, it doesn't seem possible to exclude Administrators from a Project. Is there

  • Animations to SWF Export, place back, make PDF: Acrobat XI?

    I read that Flash runtime is not supported anymore in Acrobat XI. What does that mean for clients viewing PDF files that have placed SWF files and viewing them on computers that have no Flash player/plug-in installed? I have clients that export InDes