Can't add row using table sorter

I had a jtable with my own mytableModel that implements AbstractTableModel. In mytableModel, I have addRow, removeRow... so I can delete/add row dynamically by calling mytableModel.addRow(..). Everything works fine.
However, after I added the table sorter and table map (got the code from the tutorial).
MyTableModel myModel = new MyTableModel();
TableSorter sorter = new TableSorter(myModel);
JTable table = new JTable(sorter);
sorter.addMouseListenerToHeaderInTable(table);
Now, when i call mytableModel.addRow(..), it doesn't work anymore. It doesn't add a row anymore, why?
Thank you so much for your help.

I don't have a addRow method in TableSorter. My addRow method is in myTableModel. So, when I need to addRow, I called myTableModel.addRow, In my addRow method, I have fireTableRowsInserted method. This used to work using integrating with TableSorter.
Do I need to move all my addRow, addCol....DelRow... to TableSorter? The table data are stored in myTableModel. I guess I really doesn't know how the TableSorter work :(
Thanks

Similar Messages

  • Problem  in 2007 :----MasterData Type UserTable can not add row

    hi  all
    i have create a "masterline" UDT.
    In 2005 i have written a code to insert data in that table.
    eg..
    SAPbobsCOM.UserTable UDT;
    UDT=Company.UserTables.Item("TableName");                    
    UDT.Code ="ABC";
    UDT.Name ="1";
    UDT.UserFields.Fields.Item("U_USNM").Value ="XYZ";
    int nErr=UDT.Add();
    In "2005" it working fine but in "2007" it gives exception "MasterData Type UserTable can not add row"
    Regards,
    Rajesh Saini
    Edited by: Rajesh Saini on Feb 5, 2008 2:21 PM

    Hi Rajesh,
    What kind of User Data Table is your table? MasterData, Document or NoObject?
    I have tested and the error shows only when you are trying to fill a table of type MasterData or Document. For tables of type "NoObject" it works fine.
    The only UDTs that you should fill by using UserTable object are the ones of type "NoObject". AddOns that want to be certified cannot update UDO tables (only via UI API for the moment).
    But you are right in version 2005 SP01 it worked fine. I'll ask development whether it has been changed deliberately in B1 2007 or it is a problem.
    Thanks for sharing this information with us, it is very important in order to improve the quality of the final version.
    Regards
    Trinidad.

  • Can't add rows to existing spreadsheet Numbers OS X Yosemite

    I created a numbers spreadsheet with column filters and also popup menus for some columns I am trying to add additional rows to the spreadsheet I followed instructions from numbers:
    Add or delete a row or column at the edge of the table: Click at the bottom or at the top of the table. (Drag the control to add or delete more than one row or column.) You can delete a row or column only if all of its cells are empty.
    Insert or delete a row or column within the table: Click the table, move the pointer over a numbered or a lettered bar, click the arrow, then choose a command from the menu that appears.
    but the options to add rows are shaded gray so you can't add rows but can add columns. the II for add columns is active but there is a double circle where the = should be at the top of the table.
    I am a 20 year windows and excel user but am new to Apple and numbers

    Just guessing, but have you turned off the filters before trying to add rows? You can uncheck the box shown here:
    After clicking the table, you can find this in the Filter panel at the right after choosing Sort & Filter from the toolbar.
    SG

  • How to add rows using DefaultTableModel?

    I'm trying to figure out the ins-and-outs of creating a dynamic table.
    I looked for a tutorial, but none of the example programs I found dealt with my particular issue, nor did they explain anything.
    For instance, most of the examples looked like this:
            table = new JTable();
            defaultModel = new DefaultTableModel(10,5);
            setModel(defaultModel);But that doesn't work for me -- I'm creating a class that EXTENDS DefaultTableModel, and so if I want to send in parameters, I have a problem.
              public MyTableModel() {
                            super(data, columnNames);
                    ...The above code complains that "you can't access data or columnNames until you call super()!"
    But I've seen plenty of example code that DOES send in parameters to super(). How do they get away with that? Is it because they are parameters to the constructor, whereas private/public members of the class are somehow different?
    I thought a variable is a variable -- why is one allowed but not the other?
    Lastly, I'm trying to figure out, practically speaking, how to load a database with X items, and be able to add rows later. Does that mean I need to use a vector for my data instead of Object[][]?
    I've seen BOTH AbstractDataModel and DefaultTableModel used with dynamic tables -- is there any difference between them as far as dynamic tables are concerned?
    I was under the impression that I needed to "switch" from ADM to DTM if I wanted to be able to add rows to my table at runtime.
    Here are some references to previous discussions I found/participated in on this topic:
    http://forum.java.sun.com/thread.jspa?threadID=5224966
    http://forum.java.sun.com/thread.jspa?threadID=439141&start=0&tstart=0
    Thanks in advance for any help,
    Matthew

    -> I'm creating a class that EXTENDS DefaultTableModel, and so if I want to send in parameters, I have a problem
    Well, you would pass in the data and columnNames as parameter when you create your table model.
    -> Lastly, I'm trying to figure out, practically speaking, how to load a
    -> database with X items, and be able to add rows later. Does that
    -> mean I need to use a vector for my data instead of Object[][]?
    You just said you extended DefaultTableModel. Well you don't need to do anything it already manages the data for you. You just use the methods provided to update and change the data.
    -> I've seen BOTH AbstractDataModel and DefaultTableModel used with dynamic tables
    No you haven't. You really don't understand what an AbstractDataModel is do you? Its nothing. You can't use it. It doesn't have any storage for the data, and since there is no data storage you can't access the data or change it. You can't even create an AbstractTableModel. Read your Java text on what an Abstract class it.
    The DefaultTableModel extends the AbstractTableModel to provide data storage and ways to get the data and change the data. It notifies the table when any change is made to the data so the table can repaint itself.
    -> How to add rows using DefaultTableModel?
    Finally, the DTM provides methods that make the model dynamic. Methods for adding and removing rows or adding and removing columns. Read the API for more information.
    If you still don't understand how how the methods work then search the forum for examples that use the methods you don't understand. I've posted an example the uses the methods required to add rows or columns.

  • Add row in table

    Hi,
    can i add row in the middle of the data table, not append (in the last of table)
    Thanks
    Walid

    Hi!
    Function appendRow(RowKey row) appends row to the end. Unfortunately function insertRow(RowKey row) is not implemented in standard cachedRowSetDataProvider, but You can extend cachedRowSetDataProvider and implement this function.
    Then in you application You should call setCursorRow(RowKey row) and then insertRow(RowKey row).
    Thanks,
    Roman.

  • How can i add rows in a tabular form

    Hi,
    How can i add rows in a tabular form with out updating in database and after adding the rows one by one and after filling the data then iwant to submit them all at once.Please help me on this.
    Thanks

    Hello Leandro,
    In the Add_Rows page process, there is a box for "Number Of Rows". Change that value and you change the number of rows that get added. The default is 1.
    Don.
    You can reward this reply by marking it as either Helpful or Correct :)

  • Can't add row to sorted tabular form

    I have a very basic tabular form created using the wizard. The only significant change I made was to the sort order. When I click on the add row button, the new blank row is created at the top of the table. When the number of rows in the table grew beyond the page size (10), the blank row seems to be created at the top, but the form goes to the last page of data so the blank row is never displayed.
    If I remove the ordering then the blank row is added at the bottom and the automatic navigation to the last page shows the blank row.
    How can I modify this behaviour - either add the blank row at the end, or display the first page when adding rows.
    Table Structure
    dt_id (populated by trigger)
    dt_date
    dt_meal_type varchar2
    dt_food varchar2
    Sort order is (dt_date desc, dt_meal_type)
    Apex 2.1.0.00.39 on XE

    Vikas,
    I've had a look at your javascript idea. It took a little bit of figuring out but I think I understand it. I had to modify it a bit so that it cleared the values (I'm not trying to clone anything - I just want a blank record).
    After spending a whole morning on this I still have 2 fairly serious outstanding issues:
    a) When I enter some values into my new blank record and hit Submit nothing seems to be saved and the record just seems to get lost (I suspect I have cleared out some important hidden fields or something)
    b) It doesn't work if the table is blank and I am trying to enter the very first record.
    I'm sure it's possible to fix these issues but I am no javascript expert and I have come to the conclusion that it just isn't worth investing any more time.
    The benefit of Application Express to me is that it is a simple declarative development environment. There are many things I need to be concerned about and javascript just isn't one of them.
    Whilst I wait for the tabular forms functionality to mature, I think I will go back to the good old report + Edit button style.
    Thanks,
    Alastair
    PS. Here is the script I added to the region header (I removed everything I didn't understand and added it back in as and when I needed it):
    <script>
    function addRow()
    var col = html_GetElement('NAME'); // NAME is just an arbitrary column in my table
    var tab = html_CascadeUpTill(col,'TABLE');
    var row1 = tab.rows[1];
    var clone = row1.cloneNode(true);
    var elements = clone.getElementsByTagName('input');
    for (var j=0;j<elements.length;j++) elements[j].value="";
    myNewRow = tab.insertRow(tab.rows.length);
    myNewClone = myNewRow.replaceNode(clone);
    </script>

  • How can i add rows to a JTable at run time ??????

    hi there
    how can i add a row to a JTable at run time? and display the table after the change? thank you.

    For adding or removing the rows from the JTable, you have to use the methods on the table model. I would show you a simple implementation of table model.
    public class MyTableModel extends AbstractTableModel {
    private ArrayList rowsList = null;
    private String [] columns = { "Column 1" , "Column 2", "Column 3"};
    public MyTableModel() {
    rowsList = new ArrayList();
    public int getRowCount() {
    return rowsList.size();
    public int getColumnCount() {
    return columns.length;
    public void addRow(MyRow myRow) {
    //MyRow is any of your object.
    rowsList.add(myRow);
    fireTableDataChanged();
    public void removeRow(int rowIndex) {
    rowsList.remove(rowIndex);
    fireTableRowsDeleted(rowIndex, rowIndex);
    public Object getValueAt(int row, in col) {
    MyRow currentRow = (MyRow)rowsList.get(row);
    switch (col) {
    case 0:
    //return the value of first cell
    break;
    case 1 :
    //return the value of second cell
    break;
    case 2 :
    //return the value of third cell
    break;
    }Then create the table using the TableModel using the constructor new JTable(TableModel) and then when you want to add/remove a row from the table, call myTableModel.addRow(MyRow) or myTableModel.removeRow(rowIndex)....I hope that this solves your problem.

  • Can't add subrows to table

    Hi...I'm trying to add a subrow to test 1 in the attached example.  I followed livecycle help, but it doesn't add a subrow when clicked.
    This is an example of what I'm trying to do.               
    Header 1
    Header 2
    Header 3
    Header 4
    Header 5
    Header 6
    add subrow
    delete subrow
    test 1
    add subrow
    delete subrow
    test 2
    I want there to be a add row/delete row button next to each row that will allow you to add a subrow to that row.
    Is this possible.  I have the table set up in my example with the code from the livecycle help at http://livedocs.adobe.com/livecycle/8.2/acrobat_designer/wwhelp/wwhimpl/common/html/wwhelp .htm?context=Adobe_LiveCycle_Designer_Help&file=000286.html
    but i can't get it to work....any ideas??
    I appreciate the help!

    Hi,
    In the "test4_online(3).pdf" example, I have taken the "+" add button out of the repeater row. Therefore this is not repeating.
    If you also want to ake out the "-" delete button, you have two choices:
    Do not give the user the ability to delete rows (probably not a good idea);
    Number the rows and then place a numericfield in the form, where the user can input a number for the row they want to delete. Next to this you would have a button that would apply the removeInstance using this number -1. (this is a cumbersome solution and it is likely that a user will input an incorrect number and end up deleting something they did not want to).
    You can keep the "-" (and "+") button as it is (in a subform within a cell in the table. This keeps it small and resizeable. If you want you can take the button out of the subform and have it fill the whole cell (this can then be resized as you want, see below).
    On balance, I would recommend including the "-" delete button in each repeating row, so that the user gets a visual indication of the row they are about to delete.
    Hope that helps,
    Niall

  • How can I add a fillable table to my form?

    How do I create a form that includes a fillable table in FormsCentral?  I need to create a form that is similar to an order form with multiple spaces available for Quantity, Item Description, and Cost.  Then I need it to calculate a total cost for all items.  Can I do that using FormsCentral?  If not, what is your solution?  Keeping in mind that I want people to be able to complete the form electronically instead of pringing it and filling it out.
    Thanks,

    Forms created/designed in FormsCentral don't support calculations. FormsCentral also doesn't support tables on the form. You can add fields side by side but it won't be exactly like a table. You best solution is to create a PDF outside of FormsCentral. You can use Acrobat to add form fields and caulculations to your form.
    Once you have the PDF Form you can import it in FormsCentral to collect data electronically. People will need to fill out your Submission enabled PDF Form using Adobe Acrobat, Adobe Reader or Adobe Reader Mobile and then press the submit button added by FormsCentral to send the data electronically to your Response Table inside FormsCentral.
    hope this helps
    Gen

  • Row: can't delete, can't hide, can't add row above, can't add row below

    My row has no options! None on the drop down at far left of row, nor on the Table drop-down menu at top of Numbers.
    What happened to my row? What happened to my table? I'm going nuts...I can't add more rows to my table.
    Anyone know why this might be happening? Thanks in advance.

    Is this a problem with only one row of a multi-row table or with every row of the table? Can you enter data into the table? Are the row numbers and column letters visible or are there x's at the corners of the table (indicating the table is locked)?

  • How can I add a small table andfour colored corners to my PDF drawings?

    Hi,
    I have been sent some plans/drawings in PDF to which I need to add a small table at the bottom right side and a coloured logo to each of the corners of the drawings.
    I have tried in so many ways, but it doesn't seem possibe. Does anybody know how or if it is at all possible?
    I am using Adobe Acrobat XI standard.
    Thank you very much.

    Hello,
    maybe in this special case (your drawings) you shold not be afraid to use and buy a professional program like I use sometimes: 
    http://www.nuance.com/for-business/document-imaging-and-scanning/power-pdf-converter/index .htm
    German wbsite: http://www.nuance.de/for-business/document-imaging-and-scanning/power-pdf-converter/index. htm
    To see how it works and if it can help you, you could download a trial version first.
    Hans-Günter

  • How can i add row selector

    Hi,
    i want to add row selector in my reports. as we do in sql command promt.
    i want to create select list with values like 500,1000,2000,6000 and so on. if i choose 500 in select list it show 500 records in report,if i choose 1000 then show 1000 rows in report.how can i do this.
    is it possible? if it is then how can i do this.
    Thanks & Regards
    nisha

    In the Report pagination Settings( report Attributes ->pagination" ) , there is a field by the name "*Number of Rows (Item)*" , Choose your item there.

  • How I can insert one row on table,  with columns settings: readonly = true

    I have a problem. (jdeveloper 11.1.1.2.0)
    How I can insert row on table (EditingMode= clickToEdit), with columns settings: ReadOnly = true.
    When I make click on button create insert, ADF create one row on the table with output text invisible ( ReadOnly = true.)
    I make double click, then output text is visible (ReadOnly = false)
    I dont want make double click. I want output text is visible (ReadOnly = false), when I make click on button create insert
    Thanks

    Hi,
    try changing the edit mode of the table when pressing the button and refresh the button. This of course turns the whole table into editable mode, but this is how it needs to work. Alternatively, you create an input form for the user to edit the new record and show the form in a popup or beneath the table. Then when the user submits the created row data, you refresh the table to shwo the new row
    Frank

  • Please!!!!!!   How can i add rows in html table dynamically [use jsp,bean]

    hello, i am a fresher in jsp. i want to add new rows in html table dynamically.In my coding, just only shows in one row . please help my problem with correct coding and i don't want to use database. Thanks ...............!
    Here is my coding-------------------
    ---------------- form.jsp --------------------->
    <%@ page import="java.util.*,newtest1.Validation" %>
    <jsp:useBean id="mybean" scope="page" class="newtest1.Validation" />
    <jsp:setProperty name="mybean" property="name" param="name" />
    <jsp:setProperty name="mybean" property="age" param="age" />
    <% s[i][j] %>
    <html>
    <head><title>Form</title></head>
    <body>
    <form method="get">
    <table border="0" width="700">
    <tr>
    <td width="150" align="right">Name</td>
    <td width="550" align="left"><input type="text" name="name" size="35"></td>
    </tr>
    <tr>
    <td width="150" align="right">Age</td>
    <td width="550" align="left"><input type="text" name="age" size="35"></td>
    </tr>
    </table>
    <table width="100%" border="0" cellspacing="0" cellpadding="5">
    <tr><td> </td></tr>
    <tr><td><input type="submit" name="submit" value="ADD"></td></tr>
    <tr><td> </td></tr>
    <tr><td width="100%" align="center" border=1>
    <% int count=mybean.getStart();
    for(int i=count; i<count+1; i++) { %>
    <tr>
    <td><jsp:getProperty name="mybean" property="name" /></td>
    <td><jsp:getProperty name="mybean" property="age" /></td>
    <td><%= count %></td>
    <% count+=1; %>
    </tr>
    <% } %></td></tr>
    </table>
    </form>
    </body>
    </html>
    ----------------- Validation.java ----------------->
    package newtest1;
    import java.util.*;
    public class Validation {
    private String name;
    private String age;
    static int start=0;
    public Validation() {    name=null;
    age=null;
    ++start;}
    public void setName(String username) { if(username!="")
    name=username;
    public String getName() { return name;  }
    public void setAge(String userage) {  if (age!="")
    {age=userage;}
    public String getAge() {  return age;   }
    public int getStart() {
    return start; }

    Hi, Do you mean to say,
    You have an HTML page in which you have a text field and an add button. If you enter anything in that text field and click on Add button the text field contents should be displayed in the same HTML page and you should be able to go on entering new values into the text field and you should be able to retain and display all the previously entered values..
    and finally the list of added items are not stored in the database..
    If this is the case
    i. Your html form should be submitted to the same page.
    ii. You need to have a Vector which holds the entered values.
    iii. Bind the vector object to the request object and collect the same vector object from the request and display its contents...
    I think this would help...

Maybe you are looking for

  • Not assigned values in 0ic_c03

    Hello experts. We have the 0ic_c03 cube for movements and values. We've been ckecking the results and so far so good, until we start to use in the drilldown of the reports some characteristics such as "0strge_type" where we get too many results as "n

  • File Server Resource Manager 2012 - Fails to generate storage report - Event ID: 8242 and 602

    Installed file server resource manager roll on new 2012 file server.   When I attempt to run a dup report on the local volume, I received an error message: "the report generation task failed with the following errors: Error generating report job with

  • Statement not accessible error - Any ideas please.

    Hello all:           We were using macro from TRMAC table in 4.6C version and it used to give a warning but after upgrading to ECC6.0 it is syntax error! Please look at the code below: *SELECTION SCREN / PARAMETERS                                    

  • Restoring photos from Iphone 4

    I backed up my computer last week using an external hard drive, and for some reasons the pictures I had recently added to my computer are gone. It almost looks like my computer reverted to an older iphoto backup. However, the new pictures are on my I

  • ORA-01102: cannot mount database in EXCLUSIVE mode

    Hello, I am working with an Oracle VM Template: Oracle Application Server 10g Release 3 WebCenter (x86 32-bit). In this template exists an Oracle database (version: 10.2.0.3.0), I am trying to do something operation (ie create a new user, query a sys