Rubber stamp table cell renderers performance

One never stops to learn...
http://java.sun.com/javase/6/docs/api/javax/swing/table/DefaultTableCellRenderer.html
+“...So this class overrides the validate, invalidate, revalidate, repaint, and firePropertyChange methods to be no-ops and override the isOpaque method solely to improve performance. If you write your own renderer, please keep this performance consideration in mind.”+
Hm. This was quite a revelation for me. However, I’m having troubles implementing it. I have rather complex cell renderers… To be exact: I have complex cell editors, for example one containing two textfields and two buttons (key & description textfields plus zoom & search buttons) inside a JPanel. The JPanel is the cell editor component. Because I want the buttons on exactly the same location in the renderer as in the editor, I have an editor-to-renderer wrapper.
I cannot disable the mentioned methods on the JPanel that is the renderer, then its contents isn’t painted anymore. Invalidate and validate must stay.
Now, I can easily build a simple text based renderer using DefaultTableCellRenderer aka JLabel. However, what if a table must show more than trivial stuff? Are there any good guides on how to build complex cell renderers?
Again: I often use the editor-as-renderer wrapper in order to not have to code stuff twice. At all works just fine, but appearantly is very slow (my tables are slow indeed)... Any way to do this correctly?

Ok, here you are with two SSCCE's! :-)
The first test only shows a regular complex renderer (2x textfield, 2x button). According to the specs the component must have certain methods disabled, so they are overridden in the jpanel that holds all these components. Run, and then try again with the two methods uncommented.
The second test is how I normally do it; I do not want to write separate editors and renderers, so I only write the editor and use an editor-to-renderer wrapper. In order to fulfill the requirement, I wrap the editor component in a second jpanel that overrides the required methods. Again, run and then try again with the two methods uncommented.
package test;
import java.awt.Component;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableCellRenderer;
* Test1: use a complex cell renderer and follow the specs in
* http://java.sun.com/javase/6/docs/api/javax/swing/table/DefaultTableCellRenderer.html
public class CellRendererTest
      * @param args
     public static void main(String[] args)
          SwingUtilities.invokeLater(new Runnable()
               @Override
               public void run()
                    JTable lJTable = new JTable(new DefaultTableModel(new String[][]{{"a1","b1"},{"a2","b2"}}, new String[]{"A","B"}));
                    lJTable.setDefaultRenderer(Object.class, new ComplexCellRenderer());
                    JFrame lJFrame = new JFrame();
                    lJFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                    lJFrame.add(lJTable);
                    lJFrame.setSize(500,100);
                    lJFrame.setVisible(true);
     // =============================================================================
     static class ComplexCellRenderer implements TableCellRenderer
          JTextField iKey = new JTextField(5);
          JButton iSearch = new JButton("?");
          JButton iGoto = new JButton(">");
          JTextField iDescription = new JTextField(20);
          JPanel iJPanel = new JPanel()               
//               @Override public void validate() {}
//               @Override public void invalidate() {}
               @Override public void revalidate() {}
               @Override public void repaint() {}
               @Override public void firePropertyChange(String propertyName, Object oldValue, Object newValue) {}
               @Override public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) {}
               @Override public void firePropertyChange(String propertyName, int oldValue, int newValue) {}
          public ComplexCellRenderer()
               iKey.setBorder(null);
               iDescription.setBorder(null);
               iDescription.setEnabled(false);
               iJPanel.setLayout(new GridLayout());
               iJPanel.add(iKey);
               iJPanel.add(iSearch);
               iJPanel.add(iGoto);
               iJPanel.add(iDescription);
          @Override
          public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
               iKey.setText( value == null ? "" : value.toString() );
               iDescription.setText( value == null ? "" : value.toString() + "..." );
               return iJPanel;
}Test 2:
package test;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.GridLayout;
import javax.swing.AbstractCellEditor;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer;
* Test2: usually when have complex cell renderers, it actually means you have complex cell editors.
* You want the renderer to look 100% like the editor, so it is practical to implement a wrapper.
* Naturally the wrapped editor must adhere to the specs in: 
* http://java.sun.com/javase/6/docs/api/javax/swing/table/DefaultTableCellRenderer.html
* So the idea is the wrap it in a special panel, this is what the "useAsRenderer" method is for.
public class CellRendererTest2
      * @param args
     public static void main(String[] args)
          SwingUtilities.invokeLater(new Runnable()
               @Override
               public void run()
                    JTable lJTable = new JTable(new DefaultTableModel(new String[][]{{"a1","b1"},{"a2","b2"}}, new String[]{"A","B"}));
                    lJTable.setDefaultEditor(Object.class, new ComplexCellEditor());
                    lJTable.setDefaultRenderer(Object.class, new UseTableCellEditorAsTableCellRenderer(new ComplexCellEditor().useAsRenderer()));
                    JFrame lJFrame = new JFrame();
                    lJFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                    lJFrame.add(lJTable);
                    lJFrame.setSize(500,100);
                    lJFrame.setVisible(true);
     // =============================================================================
     // The editor
     static class ComplexCellEditor extends AbstractCellEditor  implements TableCellEditor
          JTextField iKey = new JTextField(5);
          JButton iSearch = new JButton("?");
          JButton iGoto = new JButton(">");
          JTextField iDescription = new JTextField(20);
          JPanel iJPanel = new JPanel();
          public ComplexCellEditor()
               super();
               iKey.setBorder(null);
               iDescription.setBorder(null);
               iDescription.setEnabled(false);
               iJPanel.setLayout(new GridLayout());
               iJPanel.add(iKey);
               iJPanel.add(iSearch);
               iJPanel.add(iGoto);
               iJPanel.add(iDescription);
          @Override
          public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
               iKey.setText( value == null ? "" : value.toString() );
               iDescription.setText( value == null ? "" : value.toString() + "..." );
               return iJPanel;
          @Override
          public Object getCellEditorValue()
               return iKey.getText();
          public ComplexCellEditor useAsRenderer()
               JPanel lJPanel = new JPanel()
//                    @Override public void validate() {}
//                    @Override public void invalidate() {}
                    @Override public void revalidate() {}
                    @Override public void repaint() {}
                    @Override public void firePropertyChange(String propertyName, Object oldValue, Object newValue) {}
                    @Override public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) {}
                    @Override public void firePropertyChange(String propertyName, int oldValue, int newValue) {}
               lJPanel.setLayout(new BorderLayout());
               lJPanel.add(iJPanel);
               iJPanel = lJPanel;
               return this;
     // ==========================================================================================
     // Simplified version of the wrapper (normally this wrapper takes care of the special JPanel)
     static class UseTableCellEditorAsTableCellRenderer implements TableCellRenderer
          public UseTableCellEditorAsTableCellRenderer(TableCellEditor tableCellEditor)
               iTableCellEditor = tableCellEditor;
          private TableCellEditor iTableCellEditor = null;
          @Override
          public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
              // we use the editor as the renderer
              Component lEditor = iTableCellEditor.getTableCellEditorComponent(table, value, isSelected, row, column);
              return lEditor;
}

Similar Messages

  • BEx Cell Report - Performance Issue

    All,
    We have a BEx Report in which I have used cell formulas extensively.
    My BW ver 3.0B and parch 31. From last f32 weeks this report is working only for maximum of 9 materials. Tthe report output comes very fast. The momemnt I give 10th material or more in the parameter screen, the report never comes out.
    I tried SAP Note : 976996, still the same problem.
    Can anyone please help?
    Thanks
    RS

    Hi,
    just create a proper index and performance will increase. There are some SAP OSS notes who deal with this (for example field "client" should be added if'm not mistaken).
    We did the same on profit center tables with huge performance increases
    grtz
    dries

  • JTables how to apply multiple cell renderers to a cell

    I have a complicated table with many different cell renderers depending on column type. (i.e check boxes, editable text fields, formatted fields, fields with icons etc..) Now I need to add the capability to color rows depending on a certain status value of a column. How can I add this capability since I already have renderers for the cells> Most examples I have seen for manipulating row colors simply extends DefaultCellRenderer for the entire table, but I already have renderers for these cells.

    Create an interface and make each renderer implement a method that colours in the background for you. Just an idea, haven't tried it myself

  • Table cell flashing

    Hi,
    Before I start to hack away a solution that might not be fx-like, I'd like to get your expert opinion about implementing cell flashing for a table view.
    I have done this several times in Swing (using a timer, a customer renderer, switching the bg/fg colors 3 times, and firing up an even table cell update), but how do implement this feature in JavaFX?
    * The table cell renderer (override def call (...)) could be used
    * The bg/fg color switch can be done using different css styles
    * what would be the best way to implement the timer and ask the view to "repaint" a specific cell?
    Thx v much

    Below is a bit of code that does something like what you want (the port to groovy should be easy). It may need some testing/tweaking for a real scenario and I'm not sure just how many animated cells you could have going at a time before performance becomes an issue (maybe someone from the JFX team could comment on this?).
    Also, regarding the use of styles for animating the change, you should be aware of this: Removing CSS style classes?
    Basically you need to make sure your 'default' style has values set for everything your 'highlight' style messes with, otherwise the highlight won't get turned off.
    import javafx.animation.FadeTransition;
    import javafx.animation.Timeline;
    import javafx.application.Application;
    import javafx.beans.value.ChangeListener;
    import javafx.beans.value.ObservableValue;
    import javafx.scene.Scene;
    import javafx.scene.control.Label;
    import javafx.scene.control.TableCell;
    import javafx.scene.control.TableColumn;
    import javafx.scene.control.TableView;
    import javafx.scene.control.cell.PropertyValueFactory;
    import javafx.scene.layout.BorderPane;
    import javafx.stage.Stage;
    import javafx.util.Callback;
    import javafx.util.Duration;
    public class TestApp extends Application
        public static void main(String[] args)
            Application.launch(args);
        @Override
        public void start(Stage stage) throws Exception
            BorderPane root = new BorderPane();
            TableView<Person> table = new TableView<Person>();
            table.getItems().addAll(
                    new Person("Cathy", "Freeman"),
                    new Person("Albert", "Namatjira"),
                    new Person("Noel", "Pearson"),
                    new Person("Oodgeroo", "Nooncal")
            TableColumn<Person, String> firstNameCol = new TableColumn<Person, String>("First Name");
            firstNameCol.setCellValueFactory(
                    new PropertyValueFactory<Person, String>("firstName")
            table.getColumns().add(firstNameCol);
            TableColumn<Person, String> lastNameCol = new TableColumn<Person, String>("Last Name");
            lastNameCol.setCellValueFactory(
                    new PropertyValueFactory<Person, String>("lastName")
            lastNameCol.setCellFactory(new Callback<TableColumn<Person, String>, TableCell<Person, String>>()
                public TableCell<Person, String> call(TableColumn<Person, String> column)
                    final FlashingLabel label = new FlashingLabel();
                    label.setStyle("-fx-background-color: #ffaaaa");
                    TableCell<Person, String> cell = new TableCell<Person, String>()
                        protected void updateItem(String value, boolean empty)
                            super.updateItem(value, empty);
                            label.setText(value);
                            label.setVisible(!empty);
                    cell.setGraphic(label);
                    return cell;
            table.getColumns().add(lastNameCol);
            root.setCenter(table);
            Scene scene = new Scene(root, 800, 600);
            scene.getStylesheets().add("styles.css");
            stage.setScene(scene);
            stage.show();
        public class FlashingLabel extends Label
            private FadeTransition animation;
            public FlashingLabel()
                animation = new FadeTransition(Duration.millis(1000), this);
                animation.setFromValue(1.0);
                animation.setToValue(0);
                animation.setCycleCount(Timeline.INDEFINITE);
                animation.setAutoReverse(true);
                animation.play();
                visibleProperty().addListener(new ChangeListener<Boolean>()
                    public void changed(ObservableValue<? extends Boolean> source, Boolean oldValue, Boolean newValue)
                        if (newValue)
                            animation.playFromStart();
                        else
                            animation.stop();
        public class Person
            private String firstName;
            private String lastName;
            private Person(String firstName, String lastName)
                this.firstName = firstName;
                this.lastName = lastName;
            public String getFirstName()
                return firstName;
            public String getLastName()
                return lastName;
    }

  • Table Cell Editor which allows to input multiple lines of text...

    Hi there
    Does anyone know how to write a table cell editor which allows users to input multiple lines of text? please provide some sample if possible...
    Thanks
    Ken

    I'm assuming you also want the renderer to display multiple lines? if so, make a class that extends JTextArea and that implements the TableCellEditor and TableCellRenderer interfaces, then set instances of this as the editor and renderer for the TableColumn in question. The implementation of most of the methods in these interfaces is trivial, often just this.setBackground() based on the table.getSelectionBackground() or table.getBackground(), a this.setText() based on the value passed in, then just a 'return this'.
    You might want to make an abstract class which implements these interfaces for you, and which delegates to a simple abstract method that you override to return the renderer/editor component.
    Note that you must use two instances of the class you make, one for the renderer and one for the editor, since it must be able to be able to render the remainder of the table's cells without interfering with the JTextArea performing the editing. (alternatively you could make two classes that extend JTextArea, each just implementing one of the interfaces, but this is more effort I think.) Also note that you must increase the table's row height to get more than one row visible.

  • RoboHelp 7 to 9 : Table Cell Padding

    HI All,
    I very recently upgraded from TCS 1.3 with RoboHelp 7 to TCS 3.5 with RoboHelp 9. Yeay! All is good so far except one little niggle. . .
    I use tables frequently in my source files to set out information. In RH7 I did this through Table > Insert > Table... Select number of rows and columns then click OK.
    When I did this I could see that RH had automatically added padding to the table cells. If I added text into the cell there was a small gap between the table border and start of the text.
    When I perform the same action in RH9, the padding appears to be missing (highlight a table cell and skip over to HTML view). I can't figure out how to add this automatically.It could get a little tiresome if I have to add it for each table cell from now on in order to be consistent with the tables already in my project. Manually adding a margin from the Table properties dialog appears to make no difference. Even when I set the margin to be outrageously huge, my text still butts right up against the table border.
    So, does anyone know how I can set my table cells to automatically have the same padding  as they did in RH7?
    Any ideas or help are welcomed. Thanks guys!
    Lil

    Presumably, after reading the Table Styles topic in the help as well as your tour Peter, my existing tables stay as is unless I apply a table style to them but I have to create a style for any new tables I add into my project files?
    Yes to all questions. At some point it may be worth converting your inline tables to CSS though so that future changes are just at CSS level.
    You don't mention in your tour Peter whether the mapping issue across to printed documentation has now been fixed in RH9?
    If you mean what I think you do, not that is still an issue.
    Having attempted to create a table style, I'm now trying to work out why if I choose to apply formatting to the 'Whole Table' and set the borders to 'Solid', '1px', 'All Borders' and 'Silver', I get an outline around the whole table rather than all cells bordered. Confused?!!
    The table editor is a nightmare. Whole table means the outer borders, not the whole table, as one might reasonably expect. I think the trick is to set borders for odd rows as top left and even rows as bottom right, something like that.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • Refferencing Table Cell

    Dear All.
    i have a required to show the maximum production qty and the date i am using bex query and include all the time characteristics i.e. Calday, week, month and year.
    now in WEB i am consuming query with separate sepate characteristic with the maximum qty key figure and using the Rank function on each table and it works perfectly fine.
    the problem is i am arrangin table in a row in form of columns and it shows perfecly fine in WEBI report but when i export to excel it shows tables separated every where in excel sheet.
    if there is a way to reffrence table cell i can easily perform the job.
    Kindly please help to find the solution.

    Dear Fedric.
    I dont want to refference cell between webi and excel i want to access the value in table i.e webi table block
    Let say showing the value on label from the table cell within webi
    Thank you

  • JTable loses cell renderers

    Well I just had an annoying bug that took me a long time to diagnose.
    Under certain circumstances, my JTable would suddenly redraw using all default cell renderers - my overriding renderers just stopped being used.
    Until today I was not able to reproduce it consistently, but I finally managed to do so, and I found the reason for it.
    It turned out that due to a bug in my code, I was occasionally callingfireTableRowsDeleted(first, last);with first set to -1. This apparently causes any column renderers you've set to be discarded!
    Hopefully this post will be useful if anyone else sees the same loss of renderers.

    It turned out that due to a bug in my code, I was occasionally calling
    fireTableRowsDeleted(first, last);Doesn't seem right. Here is the code from the JTable. A negative value seems to be handled.
    private void tableRowsDeleted(TableModelEvent e)
        int start = e.getFirstRow();
        int end = e.getLastRow();
        if (start < 0)
             start = 0;
        if (end < 0)
            end = getRowCount()-1;
    ...This problem is usually caused by invoking the fireTableStructureChanged() method (which is automatically invoked when you use setModel() or setDataVector()). This method does indeed cause the TableColumnModel to be recreated, which means the TableColumns are also recreated so you lose the old renderers and editors.
    You can prevent this by using the following:
    table.setAutoCreateColumnsFromModel( false );

  • JTable - help with custom cell renderers and editors

    I've got myself into a bit of a mess with cell renderers and editors.
    I've got a custom component that wants displaying in a column and then hand over all functionality to this component when you start editing it.
    Now how I went out about this was to create a custom cell renderer that extends this component and implements TableCellRenderer.
    I then created a table cell editor that extends AbstractCellEditor and implements TableCellEditor and this cell editor creates a new component when it's initialized. I then use setCellEditor(new MyCellEditor()) on the column and setCellRenderer(new MyCellRenderer()).
    This works slightly but I'm wondering how this is all implemented.
    When I set the cell editor on it's own it seems to be sharing a reference to the single component that's being used which means that if you edit one cell all the cells get changed to the new value.
    Thanks for the help,
    Alex

    only a few forums are actually browsedAnd theSwing forum is one of the most active. Did you search it for editiing examples? I've seen many editing examples posted in a SSCCE format.
    SSCEE is also impossible as the functionality spans over about 10 classes We did not ask for your application, we asked for a SSCCE. The whole point of a SSCCE is to simplify the 10 classes into a single class and maybe an inner class for the editor to make sure you haven't made a silly mistake that is hidden because of the complexity of your real application.

  • How to prevent a JButton in a Table Cell from stretching its size.

    Hi,
    I have JButton added to a Table Cell. But the button is filled up by covering the whole area of the cell and when I go for increase the width of the Table column, the button size is also stretched up along with the column's increasing width. How can I implement a solutiong so that I have a preferred size for the button so that when I go for stretch the column, the button should retain its preferred size. That mean it should not be stretched.
    I hereby added the code for a reference,
        // ButtonEditor
        class ButtonEditor extends DefaultCellEditor {
            private static final long serialVersionUID = 42L;
             private String    label;
             private boolean   isPushed;
                    protected JButton button;
             public ButtonEditor(JCheckBox checkBox) {
                  super(checkBox);
                  button = new JButton();
                  button.setOpaque(true);
                  button.addActionListener(new ActionListener() {
                       public void actionPerformed(ActionEvent e) {
                            fireEditingStopped();
              * Override the DefaultCellEditor inbuilt method
             public Component getTableCellEditorComponent(JTable table, Object value,
                       boolean isSelected, int row, int column) {
                  if(value.equals(AdminToolsRes.resBundle.getString("nei.label.blockSync"))){
                       label = (value == null) ? "" : value.toString();
                       button.setText( label );
                       isPushed = true;
                       return button;
                  else
                       return null;
              * Stop cell editing
             public boolean stopCellEditing() {
                  isPushed = false;
                  return super.stopCellEditing();
              * call the fireEditingStopped method
             protected void fireEditingStopped() {
                  super.fireEditingStopped();
              * sets the cell editable to True
              * @return
             public boolean isCellEditable(){
                  return true;
        //ButtonRenderer
        class ButtonRenderer extends JButton implements TableCellRenderer {
            private static final long serialVersionUID = 42L;
             public ButtonRenderer() {
                  setOpaque(true);
              * Override the TableCellRenderer inbuilt method
             public Component getTableCellRendererComponent(JTable table, Object value,
                       boolean isSelected, boolean hasFocus, int row, int column) {
                  if (isSelected) {
                     setBackground(table.getSelectionBackground());
                 } else{
                     setForeground(table.getForeground());
                     setBackground(table.getBackground());
                  if(value.equals(AdminToolsRes.resBundle.getString("nei.label.blockSync"))){
                       setText( (value == null) ? "" : value.toString() );
                       return this;
                  }else{
                       JTextField txtFld = new JTextField();
                       txtFld.setBorder(null);
                       txtFld.setText((value ==null) ? "" : value.toString());
                       if(isSelected){
                            txtFld.setForeground(table.getSelectionForeground());
                            txtFld.setBackground(table.getSelectionBackground());
                       return txtFld;
        }Please help me in answering the question.
    SumodeV

    I feel, here the JPanel also might get stretched up.All renderers are sized to fill the entire area of the cell, so yes, the panel will get stretched, but the button won't. That is why the suggestion was made.
    All renderers are sized to fill the entire area of the cell.
    Not sure, but you might be able to override the JTable.prepareRenderer(...) method to reset the size of the button back to is preferred size. I have no idea how this will affect the rendering.

  • 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

  • Highlighting text in a table cell

    Im trying to get text in a table have it background shaded a different colour to the rest of the table cell but it doesnt work. No exceptions are thrown does anyone have any idea.
    public Component getTableCellRendererComponent(JTable table,
            Object value,
            boolean isSelected,
            boolean hasFocus,
            int row,
            int column)
            setFont(table.getFont());     
            this.setText(value));
            this.selectAll();
            this.setSelectionColor(new Color(0,0,255,100);
            return this;
        }

    The answer is similar to what someone else asked recently for highlighting text in a JFormattedTextField cell.
    class MyFocusListener extends FocusAdapter
    public void focusGained(FocusEvent e)
    SwingUtilities.invokeLater(new Runnable()
    public void run()
    selectAll();
    Put that in your cell editor or its base class. You can change the color or whatever you want. I think the problem is a timing thing where normal focus processing is interrupting your changes. So give the focus processing time to run with this Runnable triggering your processing to occur on the Awt thread (as is proper) after the system is doing whatever it wants to do. Let us know if it works for you.

  • How can I make a table cell extend beyond the page?  The text disappears when the cell becomes larger than the page.

    How can I make a table cell extend beyond a page?  The text disappears when the cell becomes bigger than the page.  I want the table to continue to the next page.

    As a student, you might be able to get Office for Mac from the college bookstore at a substantial discount. Otherwise, I think your best option for documents that need to be shared with Office users is to get one of the free Office clones such as LibreOffice.

  • How to use a checkbox table cell in FXML

    I've figured out how to make a column in a TableView render as a checkbox rather then just text when the UI is written in Java. Now I'm trying to figure out how to do the same thing with FXML. I've tried a couple experiments which have all failed, usually with an exception complaining that it can't coerce a table cell class type (or extension) to an interface (i.e. Callback).
    Right now I'm just trying to make one of the columns be a checkbox. I'm not trying to use any custom type. In other words, in Java I would have done the following:
    TableColumn<MyModel, Boolean> col1 = new TableColumn<MyModel, Boolean>();
    col1.setCellValueFactory(new PropertyValueFactory<MyModel, Boolean>("col1Field"));
    col1.setCellFactory(CheckBoxTableCell.forTableColumn(col1));This works when I build the UI using Java API calls. Does anyone know how to do this in FXML?

    Thank you both.
    I used Luca's suggestion as a first step.
    You'll find attached my v.i. that enables me to do what I wanted. It finally works as I expected. It would have been much simpler if my DAQ was able to measure directly a resistance!
    Loris
    Attachments:
    banc_de_test_température.vi ‏205 KB

Maybe you are looking for

  • How to get rid of the large slideshow images in Web gallery (CS4)

    Here is the deal. I've created a flash web gallery/ But the new CS4 has the option for slideshow with this flash stuff. CS3 use to create thumbnail and large images folders. The new one creates 3 folders: 1. thumbnails, 2, medium images, 3 large imag

  • Installed iTunes but when excessing it, it won't appear

    hi i recently just formatted my new hard disk and installed windows XP Pro Service pack 2. Did up all the updates and installed the new itunes 7.7. But even after transferring all my songs from my removable hard disk into the com, when i try to open

  • How can I convert Binary File to Normal Text File?

    Hi, I need to read a binary file and need to conevrt as normal text file. The binary file contains some number & String (Names) with fixed length. It is the combination of Char, String, Integer, Byte & Single Bit. I used DataInputStream but I didnt g

  • SMD_RFC has no RFC authorization for function group SPF.

    Hi, http://pw200-3.fcc.XXXXXXX.com:50000/smd  ->Diagnostics Setup ->Setup Wizard - Step 1  receives an error message like . . The value of profile parameter login/accept_sso2_ticket could not be checked Attached the below error message << >>   Sat No

  • WD_CONTEXT AND IF_WD_CONTEXT_NODE

    Hi folks,            Am very new to Abap objects and working on webdynpro.I have a very basic question what is wd_context and if_wd_context_node.Please let me know what is the use of them. Regards, Vamshi.