FireTableStructureChanged losses the Re-ordering of Columns in JTable

Hello All:
I have a JTable which uses a TableModel. (I would call PipeFilterTableModel) (The TableModel is based on swingx ). The PipeFilterTableModel takes a Sorter which in turn takes a TableModel.
One of the filterring mechanism I have is hiding the columns. The way I hide the column is I just reduce the ColumnCount by 1. My method getColumnCount returns one less than the previous filter. I know I can hide the colums by just making the preferred size to zero. But the reason am doing at the TableModel level is becuase i have export and print and other functionality :).
Anyway, the Table allows Re-ordering of the columns i.e user can move/dragg the columns. But when a ColumnHideFilter is callled I have to use "fireTableStructureChanged" since my table structure is changing (Columns are decreased my one). When that happens I lose the reorderring. Is there anyway I can preserve the reorderring after the firetableStructureChanged ?? I would really appreciate for any help..
I do have access to JTableHeader (before and after the firetableStructureChanged), but not sure how to reorder the columns after the firetableStructureChanged.
Thanks
-Pankaj

Hi:
I agree with you guys... that I can remove the column from the TableColumnModel and it would work great. the table won't show the column.
But in my case I have the export data, print data and all the other functionality written around the tableModel. So as I mentioned previously.. I am using PipeFilterTableModel which filters out data and columns (which are asked to be hidden). So i have to implement the hidden column stuff at the tableModel level.
So even if I remove the column from Table the export , print and other functionality will get that column (hidden) values from the tableModel.
As i said I got almost all the things to work except this Reorderring stuff.
Once I get everything to work fully, I would post it so others can also use it :)
Thanks
-Pankaj

Similar Messages

  • How to set the Selected row and Column in JTable

    Hi,
    i have a problem like the JTable having one Method getSelectedRow() and getSelectedColumn to know the Selected row and Column but if i want to explicitly set the Selected Row and Column,then there is no such type of Methods.If anybody has any solution then i will be thankful to him/her.
    Praveen K Saxena

    Is that what you're looking for? :myTable.getSelectionModel().setSelectionInterval(row, row);
    myTable.getColumnModel().getSelectionModel().setSelectionInterval(column, column);

  • How do I change the order of columns in the responses table?

    How do i change the order of columns in the responses table in FormsCentral?  The default setting puts them in reverse order!

    Hi,
    The issue with the default ordering of columns in the response table is something that we hope to address in the next update to FormsCentral. In the meantime, you can reorder the columns by selecting them then click/drag using the gray area above the column name. As shown below, an orange marker will show you where the columns will be placed when you release the mouse button.
    Sorry for the inconvenience.
    Regards,
    Brian

  • Finder - changing sort order in column view

    Anyone know a way to change the sort order when using the COLUMN view in Finder? It's defaulting to alpha and I'd like to change it so when I'm viewing a particular folder the contents are displayed by Date Modified like I can when using the other views.
    THANKS!

    Hi VFRJOEY,
    there is no way to change the sort order in column-view. This was under discussion since the very first release of MacOS X but never made it into any one of the releases.
    If this answered your question please consider granting some stars: Why reward points?

  • Sum of two columns of Jtable in Jclient (summarized columns)

    I want to display the sum of two columns of Jtable in a text box, just as we use to do in Forms developer.
    How is this possible in Jclient.
    I would be glad if someone can give a detail info about it.

    Actually I wanted to sum the values of a column when a user enters a value in the Jtable when a new record is created. before it is commited
    That summarized value which I want in the textbox will then be used in the validation rule.

  • How to change the order of columns in a speadsheet?

    It seems this would be completely straight-forward. However I can find nothing in help to tell me how to do this. I am using a spreadsheet for data so want to be able to rearrange in the order of the columns. How does one do this?
    Thanks.
    John

    I don't want to move or sort the data. What I want
    to do is change the order of the columns. I have
    columns A through P. I want to move columns M, N,
    O, and P to come after A and B so I can see the
    information in these 6 columns in one glance.
    How does one do that?
    One doesn't, but there are altenatives.
    1.
    Select columns C..L by clicking and dragging across the column headers.
    Go Format (menu) > Column width.
    Set the width to 0 (zero) and click OK.
    This hides columns C..L, showing A, B, M, N, O, P...
    You can still enter data into cells in columns C..L by clicking on a cell in column B, then pressing tab to move through the hidden columns.
    To restore the display, select columns B..M then reset the column width to a visible value (the current width of column B will be the default).
    2.
    Copy the values in columns A, B, M, N, O, and P into a set of contiguous columns. Set a New View to show these columns in a separate window.
    Example:
    Go Window > New View
    Drag the new window that opens up and left to cover the initial window.
    In AA1, enter =A1
    Select AA1..AB1 then Fill right (command-R)
    In AC1, enter =M1
    Select AC1..AF1 then Fill right
    Select AA1..AFn where n is the last row in which you have data then Fill down (command-D)
    This copies the contents of the cells you want to view together into a set of cells that are together. You can view them by going to the Window menu and switching between the two views of the same spreadsheet. Or you can skip the step of creating a second View, and scroll from one location in the sheet to the other.
    The usual caveat applies: Anytime you're making extensive changes to a document, work with a COPY and keep the original as a backup you can revert to should a misstep along the way result in data loss.
    Regards,
    Barry

  • What is the order of Column Names in Sqlite query results?

    I am writing an application using Adobe Air, Sqlite, and Javascript.
    After writing the following select statement:
              SELECT field1, field 2, field 3, field 4 FROM TableA;
    I would like to get the columnName/data combination from each row -- which I do successfully with a loop:
              var columnName="";
              for (columnName in selResults.data[i]) {
                   output+=columnName + ":" + selResultsdata[i][columnName] + ";";
    My issue is that the column names come out in a different order every time I run the query and never once have they come out in the desired order -- field 1, field 2, field 3, field 4.  If I run the query in Firefox's Sqlite Manager, the columns come out in the "proper" order. When I run them in Adobe Air, the order will be the same if I run the query mulitple times without closing the app.  If I make a change such as declaring the columnName variable with "" before the for column, or declare it as (var = columnName in selResults.data) , then the order changes.  If I shut down my app and re-open after lunch and run query, it comes out in another order.  At this time, I'm not interested in the order of the rows, just the order of the columns in each output row.  I've even tried assiging an index to columnName which seems to just pick up a single letter of the columnName.
    I'm in the process of changing my HTML presentation of the data to assign a precise columnName to an HTML table title, but I'm reluctant to let go of the above concept as I think my separation of HTML/presentation and Javascript would be better if I could use the solution described above.
    So, does anybody know how to force the order of the columnNames in my output -- or what I'm doing to cause it to come out in a different order?
    Jeane

    Technically there isn't any "order" for the return columns. They aren't returned as an Array -- they're just properties on an Object instance (a "generic object"). The random order you're seeing is the behavior of the for..in loop iterating over the properties of the object. Unfortunately, with a for..in loop there is no guaranteed order for iterating over properties (and, as you've seen, it tends to vary wildly).
    The only solution is to create your own list of the column names and sort it the way you want to, then use that to create your output. For example, use the for..in loop to loop over the properties, but rather than actually get the values, just dump the column names into an Array:
    var columnName="";
    var columns = [];
    for (columnName in selResults.data[i]) {
        columns.push(columnName);
    columns = columns.sort(); // just uses the default alphabetical sort -- you would customize this if desired
    var j = 0;
    for (j = 0; j < columns.length; j++) {
        columnName = columns[j];
        output+=columnName + ":" + selResultsdata[i][columnName] + ";";

  • Change the order of columns in a report

    hi all.
    i can't change the order of columns in a report not just by altering the select statement. where can i change it?
    thanks.

    hi master
    sir i use 6i report i see full report but i culd not found
    report region and report attributes
    sir please give me step or idea or tree where report region and report attrinutes"
    thanking you
    aamir

  • Is there any performance difference in the order of columns referencing index?

    I wish to find out if there is any performance difference or efficiency in specifying those columns referencing index(es) first in the WHERE clause of SQL statements. That is, whether the order of columns referencing the index is important???.
    E.g. id is the column that is indexed
    SELECT * FROM a where a.id='1' and a.name='John';
    SELECT * FROM a where a.name='John' and a.id='1';
    Is there any differences in terms of efficiency of the 2 statements??
    Please advise. Thanks.

    There is no difference between the two statements under either the RBO or the CBO.
    sql>create table a as select * from all_objects;
    Table created.
    sql>create index a_index on a(object_id);
    Index created.
    sql>analyze table a compute statistics;
    Table analyzed.
    sql>select count(*)
      2    from a
      3   where object_id = 1
      4     and object_name = 'x';
    COUNT(*)
            0
    1 row selected.
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=1 Card=1 Bytes=29)
       1    0   SORT (AGGREGATE)
       2    1     TABLE ACCESS (BY INDEX ROWID) OF 'A' (Cost=1 Card=1 Bytes=29)
       3    2       INDEX (RANGE SCAN) OF 'A_INDEX' (NON-UNIQUE) (Cost=1 Card=1)
    sql>select count(*)
      2    from a
      3   where object_name = 'x'   
      4     and object_id = 1;
    COUNT(*)
            0
    1 row selected.
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=1 Card=1 Bytes=29)
       1    0   SORT (AGGREGATE)
       2    1     TABLE ACCESS (BY INDEX ROWID) OF 'A' (Cost=1 Card=1 Bytes=29)
       3    2       INDEX (RANGE SCAN) OF 'A_INDEX' (NON-UNIQUE) (Cost=1 Card=1)

  • Does the order of columns in an index matter?

    Hi,
    I have a table having composite index, five columns. (col1,col2,col3,col4,col5)
    Currently , my index is beginning with the column which having low distinct values and so on.
    ( in my case the first column have 1 distinct values due to functional behavior ). the second column have 3 distinct values , the third column have many distinct value ( half of the table).
    There are many DML queries on this table with different clauses.
    Examples:
    query 1 : where col1 =val1 and col2 = val2
    query 2 : where (col3,col4) in ( select col1,col2 from another_table ) ( for this we can add col1 =val1 and col2 = val2)
    My question is : what this best way to create index on this case ?
    The order of columns on index depends on its distinct values?
    Thanks

    BIJGA wrote:
    Hi,
    I have a table having composite index, five columns. (col1,col2,col3,col4,col5)
    Currently , my index is beginning with the column which having low distinct values and so on.
    ( in my case the first column have 1 distinct values due to functional behavior ). the second column have 3 distinct values , the third column have many distinct value ( half of the table).
    There are many DML queries on this table with different clauses.
    Examples:
    query 1 : where col1 =val1 and col2 = val2
    query 2 : where (col3,col4) in ( select col1,col2 from another_table ) ( for this we can add col1 =val1 and col2 = val2)
    My question is : what this best way to create index on this case ?CREATE INDEX
    The order of columns on index depends on its distinct values? yes
    Handle:     BIJGA
    Status Level:     Newbie (5)
    Registered:     Aug 24, 2009
    Total Posts:     66
    Total Questions:     18 (14 unresolved)
    I extend my condolences to you since you rarely get answers to your questions.

  • Is the time column in VA05 the time the sales order created?

    i have added a time column in VA05. May i know whether it is the time the sales order is created? How do i know if it it the created time? Need to know the sales order created time, for example at 7:00. Thank you

    Hi
    Yes this is the order creation date. You can cross check by seeing the time by checking the entry in table (VBAK-EZERT) by passing the VBAK-VBELN as the order number.
    Thanks
    Indranil

  • IDOC order of columns not same as the data source

    Hi,
    I am from non SAP background. We are using Informatica to pull data from SAP ECC using the Business Content for Integration by pulling data from IDOCS. Here is my problem:
    1) We identified a particular data source (0FI_GL_4) for full mode data pull using Informatica. However, during extraction we found that the order of ports (columns) in the datasource and that generated in the IDOC are not the same. As a result, the loads are failing due to data conversion or mismatch errors.
    Question is,how do we ensure that the order of columns in the IDOC generated is the same as that in 0FI_GL_4?
    Thanks,
    R.

    Hi,
    Please find the below link may useful.
    http://wiki.ittoolbox.com/index.php/Re-Connect_R/3_and_BW
    Reg,
    Venkat

  • Controlling the sort order for a column?

    I have a column which uses strings that I want to sort on. But, I don't want to do simple string sorting. Can I effect the sort order somehow? Maybe enumerate the values and assign integers to them?
    For example, I want to use Low, Medium, and High. Or maybe: L-, L, L+, M-, M, M+, H-, H, H+
    Any pointers on how to do this?

    Todd,
    Not knowing what you're trying to sort, it is difficult to make specific suggestions. Basically, two approaches come to mind. 1) start the lines of the column you want to sort with some type of sort code or 2) place that sort code in another column and sort on two columns - possible hiding the one with the codes.
    The next problem is designing a code that fits your situation. In the example you gave something like 1L-,2L,3L,...,8H,9H may work because there are only 9 categories. If more than 9, two digit numbers may work but remember to use leading zeros to pad single digit numbers.
    The code could also be alpha characters with relevance such as "Auto", "Clot", "Food", "Hous", "Misc", etc. But again, if these alphabetic categories are not in the order you like you may have to precede them with some sequence device to get what you want. Maybe something like "aFood", "bClot", "cHous", etc. would work. Designing a code applicable to a given situation that one can easily remember is not always easy.
    Hope this gives to something to think about and if you care to give more details you'll surely get some specific suggestions.
    pw

  • Displaying report region columns in the correct order

    I have a report region in which the first 4 columns that are displayed are listed at THE END of the “Column Attributes” section.
    Why is this happening? Does some other setting have to be made to make them display at the end, where I want them?

    Thanks Matthew.
    I had actually figured that out already and was about to post that fact.
    Evidently, the order of the columns in the Action menu is set to the original order of the columns in the “Column Attributes” section. But if the column order is then changed in “Column Attributes”, the order in the Action menu remains at its original value, and thus needs to be manually reset.

  • In my music i have lost the column right with the alphabetic order ... how can i get back ?

    in my music i have lost the column right with the alphabetic order .. how can i get back ?

    Hello Camcam369,
    It sounds like you are not seeing the alphabet listed on the right when perusing songs, artists, or albums in the Music app.  I recommend a couple of steps you can take to get it back.
    The first thing I recommend is quitting and relaunching the applications on your iPod touch:
    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.
    You can find the full article here:
    iOS: Force an app to close
    http://support.apple.com/kb/ht5137
    If you are still seeing the same issue after quitting and relaunching the Music app, I recommend restarting your iPod and then resetting if it's still not working:
    Restarting your device
    Press and hold the Sleep/Wake button for a few seconds until the red "slide to power off" slider appears, and then slide the slider.
    Press and hold the Sleep/Wake button until the Apple logo appears.
    Note: Reset your device only if you are unable to restart it.
    Resetting your device
    Press and hold the Sleep/Wake button and the Home button together for at least ten seconds, until the Apple logo appears.
    You can find the full article here:
    iPhone, iPad, iPod touch: Turning off and on (restarting) and resetting
    http://support.apple.com/kb/ht1430
    If the issue persists, the last thing I recommend is backing up and restoring your iPod touch:
    iOS: How to back up and restore your content
    http://support.apple.com/kb/HT1766
    iTunes: Restoring iOS software
    http://support.apple.com/kb/HT1414
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

Maybe you are looking for