Keep in  table cell data permanently

Hi I have a table when i click on add button on the toolbar one empty row should be inserted in the table ok it was fine
now i need to enter some data into the newly added row then i need to press save button of the tool bar that data should
be saved in the database.
In save button's actionperformed method i called like a method.
     first i put this code
if (modelTable.getView().getCellEditor() != null) {
          modelTable.getView().getCellEditor().stopCellEditing();
          System.out.println("In side Stopcell editing method.");
for stoping the cell edit before saving the data.
     activally i need object of ModelMode so i used this
ModelModel saveModelModel =(ModelModel)modelTable.getModel().getValueAt(row,col);
And also i tried like the following ways
     String name = (String)modelTable.getModel().getValueAt(row,col);
     Object name = modelTable.getModel().getValueAt(row,col);
but what happened it shows typecasting exception.
Because the data in the table cell was disappered when we click on save button. so i think maybe
ModelModel saveModelModel =(ModelModel)modelTable.getModel().getValueAt(row,col);it was not able to catch the data.
so any suggestion plz for keeping the data in the tablecell .Activally when ever i click any button on the table
that cell data was vanished.
If i use hardcoded data in place of getting datafrom the table it was working fine.
saveButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent ev) {
                     System.out.println("Save");
                     /*if (modelTable.getView().getCellEditor() != null) {
                      modelTable.getView().getCellEditor().stopCellEditing();
                      System.out.println("In side Stopcell editing method.");
                      // this method will goto setValueAt() in dataTableModel. before going to down code.
                     int row = modelTable.getModel().getRowCount()-1;
                     int col = modelTable.getModel().getColumnCount()-1;
                     MakeController makeController = new MakeController(new MakeUI());
                   MakeModel makeModel= null;                 
                   if(makeUI.getMakeComboBox().getSelectedItem() instanceof  MakeModel)
                         System.out.println("casting worked !!!!!");
                         makeModel= (MakeModel)makeUI.getMakeComboBox().getSelectedItem();
                    else
                         System.out.println("Cast not working ");                   
                     SaveModel saveModelAction = new SaveModel(this);
                     modelValueObj = new ModelValue();
                     saveModelModel = new ModelModel();
                     if(makeModel!=null){
                   modelValueObj.setMake_id(makeModel.getMake_id());     
                     else {
                          System.out.println("Select Make");
                     System.out.println("Row "+ row);
                     //String name = (String)modelTable.getModel().getValueAt(row,0);
                     Object name = (Object)modelTable.getModel().getValueAt(row,0);
                     System.out.println("String ModelName "+name.toString());
                     saveModelModel =(ModelModel)modelTable.getModel().getValueAt(row,0);
                     //System.out.println("ModelName "+saveModelModel.getModel_name());
                     modelValueObj.setModel_id(new Long (108));
                     //modelValueObj.setMake_id(new Long (1001));
                     modelValueObj.setModel_name(saveModelModel.getModel_name());
                     //modelValueObj.setModel_name("M7");
                    modelValueObj.setDisplay_model(new Boolean(true));
                    modelValueObj.setDeleted(new Boolean(false));
                    saveModelAction.setSaveModelValue(modelValueObj);
                     saveModelAction.buildRequest();
                    saveModelAction.execute();
                     boolean result = saveModelAction.retrieveData();
                     /*if (modelTable.getView().getCellEditor() != null) {
                      modelTable.getView().getCellEditor().stopCellEditing();
                      System.out.println("In side Stopcell editing method.");
                      // this method will goto setValueAt() in dataTableModel. before going to down code.

table.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);

Similar Messages

  • How to control the force return in table cell data?

    I have some xml format files.When I import them into FrameMaker,They display as table data.but when the data is very long in table cell,I want to control the new line by myself.for example,I add some \r\n in my xml file data,then in FrameMaker,It can identify the \r\n, force return.In framemaker I don't know the actual symbol that means the newline.How Can I deal with the problem?thank you!

    Hi Russ,
    yes, but you have to agree that forcing a return in the SOURCE content is really not a wise thing to do - It would be better to break the content into multiple paragraphs or used an XSLT to determine the column width and insert your own breaks in a version of the XML for rendering in Frame. If, at a later date, your templates in Frame change to allow wider columns in your table, then you'd have to go back into the source code and change every occurrence of the c/r in the data - Yeuch! Better to transform the data once, before importing into Frame and then if the col-width changes it is a simple task to change the width in the XSLT - personally, I would make sure the EDD and DTD allows multi-lines in the table cell and then break-up the data to fit the table cell size in an XSLT before importing. Then you don't taint your source code...and it is quite easy to do this is an XSLT...

  • Setting table cell data dynamically

    All
    If I have the server sending me data. And I want to lookup the row in a tableView to update it. When I try the following the screen does not refresh.
    ObservableList<DataRow> dataList = getTable().getItems();
    marketDataEvent.setNewValue(newValue);
    Do I need to call refresh on the table?

    No need. Found at the cells need to be set as SimpleDoubleProperty, and you need a getter on the SimpleDoubleProperty field.

  • Editing table cell data can be difficult

    There are times I click and click on a cell to get it to edit.  Is there any trick to making the cells more editable?  There are times I have to click 10 times to get the cell to edit.
    Matt
    Message Edited by mfitzsimons on 06-01-2006 12:28 PM
    Matthew Fitzsimons
    Certified LabVIEW Architect
    LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
    Attachments:
    profilesUpdateAll.vi ‏22 KB

    Hi matt,
    for me it works just fine (using LV 8.0.1). Maybe it's because you only have to click once (no dbl-click) and wait a bit, then it changes to editable. On Dbl-click, nothin happens.
    be cool.
    dave
    Greets, Dave

  • Cell data/text disappearing in document with long table

    I've got a document that has a table that spans about 10 pages. As I work on adding text here and there in the table, some text in cells downstream from the text I just updated will disappear randomly.
    For example, I make a change in a cell on my current page that causes the table to naturally grow/shrink...when I scroll down to the next page in the document...the cell data is gone in some of the cells!
    But, it's not really gone, it's just suppressed. If I use my cursor to fidget with the size of the object on the preceding pages, it all re-appears. It's like the table does not like to break to the next page sometimes.
    Any ideas? This happens on a co-workers ID installation as well...with different documents.
    Version 6.0.3
    Thanks for any help.

    Remove all manual formatting from your text (which is indicated with a "+"), delete generic generated character styles and build up your proper paragraph and character styles. Take observation on the basic character properties where you will find no break in both stye categories and in the keep options of the paragraph styles.
    Never have any text without paragraph styles, never any exception of formatting without a character style and don't use imported Word styles without checking and edition in InDesign, better is to avoid imported Word styles.

  • How to get the data from a table cell

    Could somebody suggest me how I can get the data value from a table cell if I set that cell a Double object previously.
    Thanks very much

    Thanks for camickr's information.
    And thanks uhrand,
    I haven't got it sloved. I am sick on this problem.
    I have the methods to let the table editable. My tableModel code is from Sun Tutorial.
    It has the code like this:
    public int getColumnCount() {
                return columnNames.length;
             public int getRowCount() {
                return data.length;
              public String getColumnName(int col) {
                return columnNames[col];
             public Object getValueAt(int row, int col) {
                return data[row][col];
             * JTable uses this method to determine the default renderer/
             * editor for each cell.  If we didn't implement this method,
             * then the last column would contain text ("true"/"false"),
             * rather than a check box.
            public Class getColumnClass(int c) {
                return getValueAt(0, c).getClass();
             * Don't need to implement this method unless your table's
             * editable.
            public boolean isCellEditable(int row, int col) {
                //Note that the data/cell address is constant,
                //no matter where the cell appears onscreen.
                if (col < 1) {
                    return false;
                } else {
                    return true;
             * Don't need to implement this method unless your table's
             * data can change.
            public void setValueAt(Object value, int row, int col) {
                if (DEBUG) {
                    System.out.println("Setting value at " + row + "," + col
                                       + " to " + value
                                       + " (an instance of "
                                       + value.getClass() + ")");
                data[row][col] = value;
                fireTableCellUpdated(row, col);
                if (DEBUG) {
                    System.out.println("New value of data:");
                    printDebugData();
            public void printDebugData() {
                int numRows = getRowCount();
                int numCols = getColumnCount();
                for (int i=0; i < numRows; i++) {
                    System.out.print("    row " + i + ":");
                    for (int j=0; j < numCols; j++) {
                        System.out.print("  " + data[i][j]);
                    System.out.println();
                System.out.println("--------------------------");
            }

  • Auto update of time/date in a table cell in pages

    I used to be able to do this in older versions.
    In pages when I have a table cell with time/date I would like to have the current date show up every time I open the document. Not on every date in the document, but just in a set cell in a  table.

    Hi Brian,
    Use the NOW function.
    Menu > Insert > Formula > Edit Formula
    Regards,
    Ian.

  • How to populate data in a new page when user place mouse on table cell

    Hi friends,
    i am working on OAF. I have one table with data coming from the backend. In a table some cells repersents wiht "P" or "C", till that Ok. but when user place mouse pointer over the cell, data should be populated in addtion text( babul text) or new page should be opened and it will show the related information about perticular cell.
    in my R&D. i created one OACellformateBean and attached messageStyled Text. MessageStyled text have property like " setMouseOver(MulInode, string)". i am really not aware what are the areguments i need to pass to this method ?. what is MultiInode.
    Pls help me in this reagard?. i am really in trouble ?????

    Thanks a lot. Tapash Ray, atleast should it possiable to open a new window when user click cell. could you please suggest some toher way similar to this , which we can get the data to diplay in a new window.

  • Importing tables with linked cell data from excel to indesign

    Hey,
    I'm designing a catalog and have been linking the tables in InDesign from a spreadsheet in excel. In my spreadsheet, I am linking cells from a master sheet to another sheet so that I when I update the information on one sheet, it will update throughout the spreadsheet.
    Now that I have the linked cells set up in my spreadsheet, I've inputed the tables into InDesign but: the table cells in InDesign containing linked cells from within the spreadsheet do not appear.
    I've gone through all the import table options in InDesign and cannot find a way to make it work.
    Does anyone have an answer or input?
    Thanks,
    KT

    When we are updating the excel sheet it automatically updates the link in InDesign and it's continually changing. Does CSV break the links in excel or does it keep them and allows InDesign to read the linked cells as well?
    Thanks for your response!

  • Certain Numbers templets allow you to drag and drop contacts to populate cell data, how can I create that functionality in my own tables?

    Certain Numbers templets allow you to drag and drop contacts to populate cell data, how can I create that functionality in my own tables?

    If you haven't come across the workarounds thread you may find helpful tips there on this and other ways to work with Numbers 3.
    ronniefromcalifornia discovered how to bring contacts into Numbers 3. As described in this post:
    "Open Contacts
    Select all the cards you want
    Copy
    In Numbers, in a table, select cell A1
    Paste
    Boom. Works great. Even brought in the pictures. Cool."
    So instead of drag and drop, just select in Contacts, copy, and paste into Numbers
    SG

  • Possible to hit enter on table cell & retrieve data without selecting line?

    Hi All,
    We're using ECC6.  I  I have a situation where the user wants to be able to hit a cell in a table which will then fire a report and pass the contents of that cell to the report. 
    So far I have been only able to get this working when the row is highlighted, I can easily pick up the values from the lead selection.  But the user does not want to have to highlight a row every time to run the report.  The user just wants to hit return a cell and for the report to be updated with the value in that cell.
    So, I'm just wondering if it is possible to hit enter in any table cell and retrive the data without highlighting the row?
    Many thanks in advance,
    Liz.

    Hi,
    You want complete row data or perticular cell data??
    Basic q's, without selecting a row how can we get data? without selecting means you get complete data on table,
    In that case which data you have to pass to report?
    Or if you dont want to select data means, create one more field of type button. so in thins button action get that row data
    and call report from here itself.
    Cheers,
    Kris.

  • How to display system date on table cells

    hi all,
    I would like to display the PC date onto a specified cell on a table. I have attached here my vis. I don't know how to get the date displayed at the table cell On the front panel when I run it. Please help.
    Attachments:
    data.vi ‏32 KB
    getPCdate.vi ‏9 KB

    Hi,
    The table control is simply a 2D array of string. So all you need to do is to pick up the Date from the appropriate .vi and replace the array element (using replace array subset) and write the whole table back again. (Example attached for LV 6.0.x)
    // it takes almost no time to rate an answer
    Attachments:
    Untitled_1.vi ‏13 KB

  • Keeping stats up to date for partitioned tables

    Hi,
    Oracle version 10.2.0.4
    I have a partioned table. I would like to keep stats up-to-date.
    Can I just run a single command to update table stats, indexes and partitions please?
    exec dbms_stats.gather_table_stats(user, 'TABLE', cascade=>true)or I also need to run exec dbms_stats.gather_table_stats(user, 'TABLE', granularity=>partition)
    thanks,
    Ashok
    Edited by: 902986 on 27-Oct-2012 11:06
    Edited by: 902986 on 27-Oct-2012 11:07

    thanks
    yes there were many indexes on the original non-partitioned table and I have created another table partitioned and now populating it with the data from the original table. the new table is partitioned on a date range column for all years before 2012, then for 2012, 2013 and so forth.
    the indexes are all created locally bar a unique index (as per original table), created globally to enforce uniqueness across the table itself. the search will always look to year to date say 1st jan 2012 tilll today for risk analysis. the partition is on that date column and there is also a local index on that date column as well, to avoid table scan (tested with disabling that index, predictably did table scan and was less efficient).
    in a DW environment, I don't see much value in having global index bar for primary key/unique constraint. I do realise that if the query crosses more than one partition, say 2 partitions, there will be two b-tree local index scans rather than one, but that would be rare (from the way they query the table).
    therefore my plan is to perform a full table stats with cascade=>true and measure the time it takes and plan to do the same if the maintenance window allows it.
    thanks again for your help
    Edited by: 902986 on 28-Oct-2012 13:24

  • Individual cell data buttons for each app keep turning on by themselves?

    I have a 4S iPhone, OS 7.0.6, and my problem is that the individual cell data buttons for each app keep turning on by themselves. I'll go in and turn them all off and the next time I look (whether in 5 min or 5 hrs) they are all turned back on again? I want to leave my cell data on so that I receive my iMessages but usually don't want everything else turned on until I get to a wifi zone. I used to be able to keep them all off until  I did  the last couple iOS updates. Help!

    Hey there Tylyssanna,
    It sounds like your cellular data options are not saving correctly. I recommend starting by turning off Cellular Data in Settings first. Then close all the running apps:
    iOS: Force an app to close
    http://support.apple.com/kb/ht5137
    Double-click the Home button.
    Swipe left or right until you have located the app you wish to close.
    Swipe the app up to close it.
    When you have done that and restart the phone, turn it back on, and test the issue again:
    iOS: Turning off and on (restarting) and resetting
    http://support.apple.com/kb/ht1430
    Thank you for using Apple Support Communities.
    Cheers,
    Sterling

  • 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));

Maybe you are looking for

  • ADF popups

    Hi All, I have a af:table (say main page) with list of rows of which some of the columns are editable and others are readonly. I also have a button on each row. When clicked, it opens up a popup. The popup in turn has a af:table(say popup) with list

  • Invitation E-mail is Never Received

    I have sent an invitation e-mail to one of my users, but the e-mail is never received. I have been monitoring our mail server log file, and the e-mail has never arrived (after more than 24 hours). Three other people received their invitations without

  • How to configure Cisco Airespace in Cisco Secure ACS v5.3

    Need some help regarding Cisco Airespace configuration in Cisco Secure ACS v5.3. We're migrating to ACS v5.3 but we're encountering an issue with Cisco Airespace. It is only working on ACS4.1 but when we tried to move it to Cisco Secure ACS v5.3, it

  • I just purchased Adobe ExportPDF Annual & it won't convert a pdf file to a word docx file?

    Yesterday I purchased & had my Adobe ExportPDF Annual account set up & working.  However I cannot convert a pdf file to a word file.  My pdf files are 774KB & 810 KB and my browser is Microsoft Outlook.  I keep getting the same error message " An err

  • Load Testing for IMS 5.2

    hi, is therer any tools available for load testing for ims 5.2? Can mailstone be used? Understand that this is used in NMS 4.x thxz cheerz marxz