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

Similar Messages

  • How is it possible to split the table cells in Pages, Version 5.1

    How is it possible to split the table cells in Pages, Version 5.1?

    This is a feature removed in the change from Pages 09 to Pages 5.0.1.
    If you need this facility, revert to Pages 09.  If you upgraded to 5.0.1, then the earlier version is still in your Applications folder in a folder called iWork.

  • How to enable a table cell dynamically?

    Hi
    I have a javafx TableView with editable and non-editable columns. I have set editable columns CellFactory to a custom EditableTextCell.This makes the whole column editable on load of the Scene.
    I have one more requirement for the same table. I have to make the table cell editable at runtime based on a flag in item mapped to tablerow. Only a single row cell should get editable not all the cells in column. How to do that? Please suggest.

    Perhaps something like this
    create or replace view v_myview
    as
    select id, name, 'table1' as tbl_nm from table1
    union all
    select id, name, 'table2' from table2
    union all
    select id, name, 'table3' from table3
    union all
    select id, name, 'table4' from table4
    select name
      from v_myview
    where id = 101
       and tbl_nm = :P101_TABLE_NAME;

  • Restricting data in the table cell

    Hi,
    I want to know how to restrict the data entereed in the table cell not more than 10 characters. How can i handle this.

    You need to supply your own cell editor instead of using the default one. Create a subclass of JTextField that consumes the keyPressed event when the text length is 10 characters, and call:
    theTableColumn.setCellEditor(new DefaultCellEditor(theTextField));

  • JavaFX2.2 TableView:How to make a table cell be edited without mouse click?

    Hi,
    I've encounter a problem with editable table cells. I'm using the TableView in my project just as the Tutorial on Oracle (http://docs.oracle.com/javafx/2/ui_controls/table-view.htm).
    According to it, I use the setCellFactory method to reimplement the table cell as a text field with the help of the TextFieldTableCell class. However, I found the steps is a little complex to get to the point where the cell can be edited:
    1.Let the table cell be selected by using direction key.
    2.Press “Enter” to converts the cell to a text filed so that it is ready to be edited.
    3.Clicking in the text field allows the contents to be edited
    The problem is step 3, that you must use the mouse to click before you can input data in this table cell.
    So, is there a solution to avoid step 3? That is the text field allows the data inputting when you just press “Enter”(step 2).
    By the way, English is not my native language. Hope I have made myself clear.

    Hi,
    You need to pass the focus to the text field when the startEditing event occurs. In the class that extends TableCell you use for cellFactory:
    public void startEdit() {
    super.startEdit();
    createTextField();
    setText(null);
    setGraphic(textField);
    * put focus on the textfield so user can directly typed on it
    Runnable r = new Runnable() {
    @Override
    public void run() {
    getGraphic().requestFocus();
    Platform.runLater(r);
    }

  • Obi 10g, merge the table cells horizontally

    hi, experts,
    is it possible to merge the table cells horizontally?
    thank you very much!

    Forreging,
    Try removing left border of the cells using CSS/options in the coulmn properties.
    mark post promptly
    -bifacts
    http://www.obinotes.com
    J

  • CL_GUI_ALV_TREE - Possible to edit the table cells in situ?

    Hi
    I am working on my first CL_GUI_ALV_TREE report.  The hierarchy is in place and the fields come through ok on the table side.  However,  I would now like to edit the fields.  I have the checkbox showing in the tree control and the row is set to editable.  Am I able to edit the fields in the table side in situ, as I would do in the CL_GUI_ALV_GRID control i.e. using mc_style_enabled/disabled?  These attributes are not present in the class builder so I presume not.  Is there another way? 
    Cheers
    Ian

    Hi
    module user_command_0100 input.
      DATA return TYPE REF TO cl_gui_event.
      save_ok = ok_code.
      case ok_code.
        when 'EXIT' or 'BACK' or 'CANC'.
        Exit program
          leave to screen 0.
      Process ALVtree user actions     
        when others.
          call method cl_gui_cfw=>get_current_event_object
                  receiving
                     event_object = return.
          call method cl_gui_cfw=>dispatch.
      endcase.
    endmodule.                 " USER_COMMAND_0100  INPUT
    check this code and call method cl_gui_cfw
    hope this helps u....
    Reward points if useful...
    Regards
    Sreenivas

  • How can I create a Face Time account.  I have an Apple ID and password.  When I Google how to create an account all I get is what I need for the system

    I have a 13" MacPro.  How can I create a Face Time account.  I have an Apple ID and password.  When I Google how to create an account all I get is what I need for the system

    You don't need to create an account.   Your use your Apple ID to log into Facetime.
    If you haven't already you will need to download the Facetime App from the Mac App Store.
    https://itunes.apple.com/us/app/facetime/id414307850?mt=12&ls=1
    FaceTime for Mac: Troubleshooting FaceTime - Apple Support

  • HT1551 I recently downloaded the latest software update for on my Apple TV (per the prompt Apple TV gave us).  Ever since downloading the update, we cannot access movies, play movies, or access iTune store.  We can play YouTube videos so not a connection

    Help.  I recently downloaded the latest software update for on my Apple TV (per the prompt Apple TV gave us).  Ever since downloading the update, we cannot access movies, play movies, or access iTune store.  We can play YouTube videos so the problem is not related to the connection.  It happens only when we are trying to access Movies.  Very confused.  Our AppleTV was working fine until I did the new software update.  Now this problem!  Help!

    re-add the shared lib
    check the firewall on the computer

  • How to change the colour of the table cell editor on some condition?

    Hi all,
    I have a requirment acco which i need to make the colour of the tableceleditor ias RED and font color white when the data in that is < 0.please tell me how is this possible and its urgent..
    regards
    Sharan

    If you are using release NW04 and have a TextView as table cell editor, you can do this:
    Add a calculated attribute "Color" of DDIC type "com.sap.ide.webdynpro.uielementdefinitions.TextViewSemanticColor" under the data source node of the table.
    Bind the "semanticColor" of the cell editor to this context attribute.
    Implement the get-method for the calc. attribute like this
    WDTextViewSemanticColor get<DataSourceNode>Color(I<DataSourceNode>Element element)
      return element.getValue() < 0 ? WDTextViewSemanticColor.NEGATIVE : WDTextViewSemanticColor.STANDARD;
    Armin

  • Grep: How to fill a table cell with certain color

    I have an excel sheet with 5000 rows that needs to be formatted in Indesign.
    1. Is there a way to get a certain color fill of the cell depending on text. Lets say if the text is "apple", the cell should fill with red (and text also color red to make it disappear).
    2. How do I make two different character styles to appear in the same cell (information is tab-separeted but sometimes I would like to have 2 "paragraphs" in one cell sometimes – with that I mean two tab-delimited cells from excel to appear in ONE cell in indesign).
    Thanks in advance
    Example of what I would like to accomplish:  http://tinypic.com/r/vo4och/6

    Yes but wouldn't that make the field contain a string?
    I tried something like that, and every field I edit becomes left-justified, and String (instead of int, float which is right-justified)
    Matthew

  • I'm having trouble converting a Word Form to a PDF form because the table cells are importing incorrectly. How can I fix it?

    I am converting a form from Word to PDF. The form includes several tables and the tables are converting with weird lines where the corners meet. I've tried everything. I've even retyped a portion of the form and tried importing it but it still had the weird lines. I'd rather not recreate the form in PDF because it's not short and I already have a perfectly good form to import. Any suggestions?

    What version of Word? What version of Acrobat? How exactly are you converting the file?

  • How to link a table cell?

    Hi,
    What would be the best way to link this table cell? I want the entire cell to be linked rather than just the text inside it.
    <table width="160" border="0" align="right" cellpadding="5" cellspacing="0" class="backgroundbox-video">
                          <tr>
    <td width="167" align="left" valign="top"><p class="navheader-lg">Video Clip</p>
                                <p class="navheader-sm">Watch a short<br />
                                  testimonial video</p></td>
                          </tr>
    Thanks so much
    Laura

    Here is what I have in the style sheet...
    .vidA a {
        text-decoration: none;
        display:block;
        background-image: url(../images/videoclip-imageandcolor-tr.gif) no-repeat scroll right bottom;
        background-color:#B1D6D5;
        padding:10px;
    .vidA a:link, .vidA a:visited, .vidA a:hover{
        color:black;
    .vidA a:hover{
        background-color:#4AA3C9;
    .vidA p {
        margin:5px;
    .audioA a {
        text-decoration: none;
        display:block;
        background-image: url(../images/audioclip-imageandcolor-tr.gif) no-repeat scroll right bottom;
        background-color:#B1D6D5;
        padding:10px;
    .audioA a:link, .vidA a:visited, .vidA a:hover{
        color:black;
    .audioA a:hover{
        background-color:#4AA3C9;
    .audioA p {
        margin:5px;
    and here is what I have for those tables...
    <td align="right" valign="top" bgcolor="#FFFFFF"><table width="160" border="0" align="right" cellpadding="5" cellspacing="0" class="backgroundbox-video">
                          <tr>
                            <td class="vidA" width="167" height="100" align="left" valign="middle"><a href="http://www.12results.com/video1.html" onclick="MM_openBrWindow('http://www.12results.com/video1.html','','width=400,height=400');return false">
          <span class="navheader-lg">Video Clip</span><br />
          <span class="navheader-sm"><br />
          Watch a short<br />
          testimonial video</span></a></td>
                          </tr>
                        </table></td>
                      </tr>
                      <tr>
                        <td align="right" valign="top" bgcolor="#FFFFFF"><table width="160" border="0" align="right" cellpadding="5" cellspacing="0" class="backgroundbox-audio">
                          <tr>
                            <td class="audioA" width="167" height="100" align="left" valign="middle"><a href="http://www.12results.com/video1.html" onclick="MM_openBrWindow('http://www.12results.com/video1.html','','width=400,height=400');return false"> <span class="navheader-lg">Audio Clip</span><br />
                                  <span class="navheader-sm"><br />
                                  Listen to a 40 min<br />
    interview about SAW</span></a></td>
                          </tr>
                        </table></td>
    ---I completely removed the styles for those tables (was background-video, background-audio) because all it had was the background styling (which you said to remove) and can't see any other reason to have it there?
    So it's perfect except for the background images are not showing...so did I do something wrong in the fireworks/make transparent process do you think?
    Thanks...
    Laura

  • How do with change table cells from staticText1 to button1 in run time?

    I have two question:
    first: I think change table's cells from staticText to button in run time?
    how do?
    second: I think change table column's order in run time?how do?
    ex:
    =============change before===========
    name age
    wtu 22
    =============chnage after=============
    age name
    22 wtu
    thanks

    Try something like this:
    1. Drop a Table. By default it has three columns.
    2. Drop a button inside the third column. Set its id property to buttonInColumn3, and set its rendered property to false.
    3. Drop another button, this time outside the table. Set its id property to buttonOutsideTable.
    4. Double-click the buttonOutsideTable and make the method look as follows:
    public String buttonOutsideTable_action() {
    //switch the first two columns
    List cols = tableRowGroup1.getChildren();
    Object col = cols.remove(0);
    cols.add(1, col);
    //toggle between showing staticText3 and buttonInColumn3 (in the third column)
    staticText3.setRendered(!staticText3.isRendered());
    buttonInColumn3.setRendered(!buttonInColumn3.isRendered());
    return null;
    5. Run the application and click the button outside the table several times.

  • How to listener a table cell

    I have this table cell editable and I want to listen when value changes (to update the database data) but I am not being able to do that, any help?
    I also would like to activate the new cell value with ENTER key, the way it is now I have to get ou of the cell clicking outside somewhere or using TAB key to move.
    I am using these tow classes to Editor and Renderer (for numbers):
    import java.awt.*;
    import java.text.*;
    import javax.swing.table.*;
    import javax.swing.*;
    public class DecimalRenderer extends DefaultTableCellRenderer {
        DecimalFormat  formatter;
        public DecimalRenderer(String pattern) {
            this(new DecimalFormat(pattern));
        public DecimalRenderer(DecimalFormat formatter) {
            this.formatter = formatter;
            setHorizontalAlignment(JLabel.RIGHT);
        public void setValue(Object value) {
            setText((value == null) ? "" : formatter.format(((Double)value).doubleValue()));
        public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
            Component cell = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
            cell.setBackground( Color.white );
            cell.setForeground( Color.black );
            return cell;
    import java.awt.*;
    import javax.swing.table.*;
    import javax.swing.*;
    public class NumberCellEditor extends AbstractCellEditor implements TableCellEditor {
        //protected JTextField textField;
        protected JFormattedTextField textField;
        private JTable tableUsed;
        protected Object oldValue;
        public NumberCellEditor() {
            textField = new JFormattedTextField();
            textField.setEditable(true);
            textField.setHorizontalAlignment(SwingConstants.RIGHT);
            textField.setFont(new java.awt.Font("Tahoma", 1, 12));
            textField.setBackground(Color.white);
            textField.setForeground(Color.red);
        public NumberCellEditor(int decimal) {
            textField = new JFormattedTextField();
            textField.setEditable(true);
            textField.setHorizontalAlignment(SwingConstants.RIGHT);
            textField.setBackground(Color.white);
            textField.setForeground(Color.red);
            textField.setFormatterFactory(Lib.setFormatDouble(decimal));
            public NumberCellEditor(boolean currency, int decimal) {
            textField = new JFormattedTextField();
            textField.setEditable(true);
            textField.setHorizontalAlignment(SwingConstants.RIGHT);
            textField.setBackground(Color.white);
            textField.setForeground(Color.red);
            textField.setFormatterFactory(Lib.setCurrencyFormat(decimal));
        private void setConfig(){
            textField.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    if(tableUsed.isEditing()){
                        tableUsed.getCellEditor().stopCellEditing();
        public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
            //textField.setText(value.toString());
            textField.setValue(value);
            oldValue = value;
            this.tableUsed = table;
            String className = value.getClass().getName();
            System.out.println("Type: "+className);
            return textField;
        /** Returns the value contained in the editor */
        public Object getCellEditorValue() {
            String name = oldValue.getClass().getName();
            Object returnValue=null;
            try {
                if (name.equals("java.lang.Integer"))
                    returnValue = new java.lang.Integer(textField.getText());
                else if (name.equals("java.lang.Double"))
                    returnValue = (Double)textField.getValue(); //new java.lang.Double(textField.getText());
                else if (name.equals("java.lang.Float"))
                    returnValue = new java.lang.Float(textField.getText());
                else if (name.equals("java.lang.Long"))
                    returnValue = new java.lang.Long(textField.getText());
                else if (name.equals("java.lang.Short"))
                    returnValue = new java.lang.Short(textField.getText());
                else if (name.equals("java.lang.Byte"))
                    returnValue = new java.lang.Byte(textField.getText());
                else if (name.equals("java.math.BigDecimal"))
                    returnValue = new java.math.BigDecimal(textField.getText());
                else if (name.equals("java.math.BigInteger"))
                    returnValue = new java.math.BigInteger(textField.getText());
            } catch (NumberFormatException e) {}
            return returnValue;
    }My code to that column/cell:
    TableColumn columnValueService = tabelaListaQuantidade.getColumn(colunas[4]);
    columnValueService.setPreferredWidth(150);
    columnValueService.setCellRenderer(new DecimalRenderer("###,###,##0.00"));
    columnValueService.setCellEditor(new NumberCellEditor(true, 2));I would appreciate any help.
    Thanks

    I want to listen when value changes Use a TableModelListener
    I also would like to activate the new cell value with ENTER keyThis is the default behaviour with the default editors. I suggest you extend the default editor instead of extending the abstract editor

Maybe you are looking for

  • How to connect to yamaha disklavier mark III

    I have a macbook pro and want to play midi files on my yamaha disklavier piano.  I have installed the yamaha UX16 driver and made the connections.  The macbook pro recognizes the disklavier as an attached device.  I cannot get anything to go from the

  • CC - Objects randomly change when resized, don't center correctly with align panel

    I'm not sure how clear these photos are, but here's what's happening. I make a compound object, then when I resize it, it moves anchors around. Note the corners on the 3rd "8" -- they're pinched together. This is happening on a lot of different objec

  • How to delete a customize table

    HI, I need to delete a customize table . But while trying to delete the table it's showing a message " Still used in dictionary. can't delete'. because this table is used by some programs and search helps. How to delete the table? Thanks & regards sa

  • SAP NetWeaver CE 7.1 EHP1 does not support version 1.5 JCA?

    Hi, I've been following the documentation of SAP NetWeaver CE 7.1 EHP1 regarding creation of a version 1.5 resource adapter. When I finally got to "Add/Remove projects" in the server view to test my adapter, I get this error: The server does not supp

  • Problems with browsers after update to Safari2.0.2 (416.12)

    I have been experiencing problems with browser use on Safari today (the first time I have used the browsers since automatic update of OSX.4 was performed on 4.11.05). Safari opens general web pages but stalls on many data base searches (spinning pinw