Cannot remove table column

I have one column in dataTable. I want to remove it and add new one.
But it can never be removed. Pls help.
JTable dataTable = new JTable();
dataTable.removeColumn(dataTable.getColumnModel().getColumn(0));
dataTable.revalidate();
dataTable.getDefaultTableModel.addColumn("Code");

Maybe you must call a fireXxxChanged method in your table Model (assuming your table Model extends one of the Standard table models)

Similar Messages

  • How to add/remove table columns dynamically?

    Please help urgently!

    Don't access the view layout (UI element references) in action event handlers. You have to place this code in wdDoModifyView().
    In the action handler, store the information needed (e.g. table column ID, insertion position, whatever) in some context attribute or in some member variable of the view.
    In wdDoModifyView(), check if table modification should be done, get the table instance using view.getElement(<tableID>), use the IWDTable API to modify the table.
    Finally, reset the flag or configuration data indicating that the table should have been modified.
    This is not really elegant, but that's the way it is...
    Armin

  • Suddenly cannot adjust table width via sizing handles

    I have found the cause of this, and it is rather bizarre:
    Using Structured FM, 10.0.2.419, on a Windows 7 Ultimate (32-bit) OS.
    Today I noticed I cannot resize table columns in the usual way, by selecting more than one row in the column and dragging the sizing handles that appear at the edge of the column.  The sizing handles appear there when rows are selected, but I cannot "grab" them.  Instead, when I try to click on a handle, the row selection is lost.  The table has no straddled columns or rows, no hidden/conditional text.  I have tried on several different types of tables all with the same non-result.  The document is otherwise editable.
    I am forced to use the Resize Column dialog box, which is not so fast or easy as just grabbing the column edge and visually adjusting it.
    I have rebooted my machine with no change in the problem.
    ====================
    Resolution:
    The problem appears to occur when I have various panels/pods open (and set to stay open, not iconify after use).  In this case I was working with conditional text, deleting some no-longer-used conditions from my documents.  I had three conditional text panels open in my workspace, ADD/EDIT CONDITION TAG, SHOW/HIDE CONDITIONAL TEXT, and CONDITIONAL TEXT.  The last two were "merged" into a single panel, and all panels were set permanently open using the double right-arrows in the panel dark frame at the top.
    It turns out when I collapse some or all of these open panels, I can select the table resize handles and adjust the column widths visually.  When I have all three pod panels expanded, the resize handles are ungrabbable.
    Forgive me if I'm not using "pod" and "panel" precisely accurately - I just use them (or more often try to work around them) rather than worrying about the names Adobe has chosen.  By giving users SO much flexibility, I personally think they have made an awful usability mess of the product.
    In any case, the problem seems to be solved, and I am posting this in case it can be helpful to anyone else.
    Thanks.
    -- garyZ

    This sounds like a bug. Please post a formal bug report here: https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform The engineers can't fix it if they don't hear about it.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices    

  • 1.5PROD/EA3/EA2 - Issues removing indexed column through Edit Table dialog

    The Edit Table dialog does not cope well with removing a column which is used in indexes.
    If you simply remove the column and hit OK, you get a Validation Failed error saying that "Column <column> is not a column of table <table>". Given that you are trying to remove the column, this is confusing.
    Most times, you can navigate to the indexes but the column no longer shows in the index which contained (and all other columns in the index appear to be removed as well). At least you can remove the index and then accept the change. However, some times (couldn't reproduce consistently), the index didn't display properly (no name displayed) and I couldn't leave the record without entering a dummy name before removing it.
    Shouldn't the behaviour be equivalent to the "corresponding" alter table drop column command which automatically drops the indexes referring to the dropped column? I know that it isn't always nice to "silently" remove an index or indexes, but couldn't we display a dialog that indicates which indexes we are going to drop to warn the user?
    theFurryOne

    No response to this, but it is still a problem in EA3.
    I assume it is not intended that you cannot drop an indexed column through the Edit Table dialog, without having to first drop the index - it is certainly not required in direct SQL and the Drop Column via the Table context menu works as well (as that simply generates the SQL).
    theFurryOne

  • How to remove multiple components border inside a single table column cell

    Hi,
    I'm adding multiple components to a table cell. To provide a good layout I'm using the following component hierarchy in a table column - table-->groupPanel--> gridPanel-->staticText Components 1 ..2 ..3. Now when I do preview in browser or run the app, the table shows up fine, but textComponent s(1,2,3) in the column are each surrounded by a border (which is the width of gridPanel border). Is there a way to get rid of this border?
    This only occurs when you add multiple components in table cell, under gridpanel layout component.
    I've tried searching for a way to remove the grid pane layout component border but couldn't find any info. Used style class border setting to not set but that doesn't help either. I checked forums, tutorial, learning sections etc., but no success. Any help or direction is appreciated..
    Thanks
    -Vinod

    Hi ,
    Can you please post the query ..what u have tried ...
    SQL&gt; select sub from coa1;
    SUB
    XY
    XY
    XY
    XY
    XY
    HXY
    HXY
    HXY
    8 rows selected.
    SQL&gt; select obj from coa1;
    OBJ
    AM
    AM
    AM
    AK
    AK
    AK
    ATK
    ATK
    8 rows selected.
    SQL&gt; SELECT OBJ FROM COA1
    2 UNION ALL
    3 SELECT SUB FROM COA1;
    OBJ
    AM
    AM
    AM
    AK
    AK
    AK
    ATK
    ATK
    XY
    XY
    XY
    OBJ
    XY
    XY
    HXY
    HXY
    HXY
    16 rows selected.
    SQL&gt; insert into coa2 (obj)
    2 (
    3 SELECT OBJ FROM COA1
    4 UNION ALL
    5 SELECT SUB FROM COA1
    6 );
    16 rows created.
    SQL&gt; select * from coa2;
    OBJ SUB MCU DOC F
    AM
    AM
    AM
    AK
    AK
    AK
    ATK
    ATK
    XY
    XY
    XY
    OBJ SUB MCU DOC F
    XY
    XY
    HXY
    HXY
    HXY
    16 rows selected.
    SQL&gt;
    i tried the same it worked fine .....
    so u can combine select and insert statements .. you can get the required result.....!
    Thanks
    Ananda
    Edited by: Ananda on Feb 2, 2009 7:38 PM
    Edited by: Ananda on Feb 2, 2009 7:52 PM

  • Problem in updating fa_additions SQL Error: ORA-01779: cannot modify a column which maps to a non key-preserved table

    Hi,
    After using sql loader to import informations in the table fa_mass_additions and after the functionnal uses a treatment to imputate this assets, it asks me to do an update on the table fa_additions to change the value of attribute1 but i get an error
    Error report:
    ORA-01779: cannot modify a column which maps to a non key-preserved table
    ORA-06512: at line 11
    01779. 00000 -  "cannot modify a column which maps to a non key-preserved table"
    *Cause:    An attempt was made to insert or update columns of a join view which
               map to a non-key-preserved table.
    *Action:   Modify the underlying base tables directly.
    please how can i do this update?

    Hi,
    The "fa_additions" is a view, not a table.
    You should update the base table "fa_additions_b".
    Regards,
    Bashar

  • ORA-01779: cannot modify a column which maps to a non key-preserved table

    define cusname='GEORGE';
    INSERT INTO (select s.prd_id, s.cus_id, s.qty_sold, s.price from sales s, customers c where s.cus_id=c.cus_id)
    VALUES (102,(select cus_id from customers where upper(c_name) like '%GEORGE%'),14,(select price from product where prd_id = 102)*14)
    I am getting the following error when I am trying to run the above query.
    SQL Error: ORA-01779: cannot modify a column which maps to a non key-preserved table
    01779. 00000 -  "cannot modify a column which maps to a non key-preserved table"
    *Cause:    An attempt was made to insert or update columns of a join view which map to a non-key-preserved table.
    *Action:   Modify the underlying base tables directly.
    CUSTOMERS TABLE
    Name   
    Null   
    Type        
    CUS_ID 
    NOT NULL
    NUMBER      
    C_NAME         
    VARCHAR2(50)
    C_LIMIT         
    NUMBER      
    CITY           
    VARCHAR2(20)
    PRODUCT TABLE
    Name 
    Null   
    Type        
    PRD_ID
    NOT NULL
    NUMBER      
    PRICE         
    NUMBER      
    COST           
    NUMBER      
    SALES TABLE
    Name   
    Null   
    Type  
    PRD_ID 
    NOT NULL
    NUMBER
    CUS_ID 
    NOT NULL
    NUMBER
    QTY_SOLD         
    NUMBER
    PRICE             
    NUMBER

    Hi,
    As the error message sugggested, INSERT directly into the sales table.  You can get the values from a sub-query that joins whatever tables are needed, including sales itself.  MERGE might be simpler and more efficient than INSERT.
    I hope this answers your question.
    If not, post  a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    If you're asking about a DML statement, such as INSERT, the sample data will be the contents of the table(s) before the DML, and the results will be state of the changed table(s) when everything is finished.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • ORA-12983: cannot drop all columns in a table

    Hi,
    I am creating a table with two columns.
    I have modified a column as unused using ALTER statement.
    After that i have tried to drop the another column by using ALTER statement.
    But it throws an error ORA-12983: cannot drop all columns in a table.
    is it not possible to achieve this via ALTER statement?
    thanks

    is there any other way to find the name of the columns which have been marked as unused?Don't think so, and you would not be able to do much about. You won't be able to reference it, you won't be able to un-unuse it, and you would even be able to add a new column having same name.
    Why are you using SET UNUSED in the first place?
    Regards
    Peter
    Quoting myself:
    You won't be able to reference itMaybe not good enough:
    SQL> select column_name, data_type, segment_column_id
      from user_tab_cols
    where table_name = 'T';
    COLUMN_NAME                    DATA_TYPE   SEGMENT_COLUMN_ID
    SYS_C00001_11051618:28:14$     NUMBER                      1
    B                              NUMBER                      2
    SYS_C00003_11051618:28:14$     NUMBER                      3
    3 rows selected.
    select "SYS_C00003_11051618:28:14$" from t
    Error at line 1
    ORA-00904: "SYS_C00003_11051618:28:14$": invalid identifier
    SQL> alter table t drop column "SYS_C00001_11051618:28:14$";
    Table altered.
    SQL> select column_name, data_type, segment_column_id
      from user_tab_cols
    where table_name = 'T';
    COLUMN_NAME                    DATA_TYPE   SEGMENT_COLUMN_ID
    B                              NUMBER                      
    1 row selected.
    Note: Both columns "disappeared"  Thanks MichaelS
    Edited by: Peter on May 16, 2011 9:29 AM

  • Removing a table column

    I want to remove absentee type column in approve/review timesheets iview in MSS.
    Can any one tell how to achieve it?

    Table columns are easily hidden using backend customisation
    CATS regular >
    Approve Working Time >
    Define Approval Views
    In the IMG (transaction SPRO), go to
    - SAP Customizing Implementation Guide
      - Cross-Application Components
        - Time Sheet
          - Specific Setting for CATS regular
            - CATS regular
              - Approve Working Time
                - Define Field Selection for Individual Approval View
                - Define Field Selection for Detail View
    for view V_PT_FIELD_SEL_C
    Screen area     CTD
    Field selection SLIN

  • Cannot see data in table column

    Hello All,
    There is no data being shown in my table columns as soon as I increased the amount of data that is being placed in each column. how should i fix this?
    Thanks

    Hi Vijay,
    Please explain your question in detail.
    Please check the table Datasource property and check the column data bindings.
    Regards, Anilkumar

  • Trans. Replication failing -- "Cannot update identity column ..." -- unable to use sp_browsereplcmds to view statement

    All, I'm trying fix an issue with transactional replication where replication monitor is showing the push to the subscriber is failing because of the error, "Cannot update identity column."  I've tried to use sp_browsereplcmds to pull up the
    command that's failing based on the xact_seqno but when I try that I get the error:
    Number: 102, State: 1, Procedure: , LineNumber: 0, Server: , Source: .Net SqlClient Data Provider
    Message: Incorrect syntax near '┻'.
    I'd like to fix the issue without having to rebuild replication during a maintenance window.  I know you cannot publish tables with primary keys, but I'm wondering if dropping the identity column on this table might fix the issue.  I'm considering
    that but I would prefer to be able to pull the command that's trying to update the identity column, throw in SET IDENTITY_INSERT ON and remove the commands from the distribution database, but if that doesn't work I'm open to ideas of just dropping the primary
    key on the replicated table.  I think that should be fine.
    Does anyone have any recommendations on how to view the command that's failing?
    Or if dropping the primary key on the subscriber table would create issues with the publisher (since it is also the primary key)?
    Or, know of any other ways in which to address this issue?  Thanks.

    Unfortunately, no.  The error was a bit of a red herring.  In the end the subscriber was missing all of the stored procedures needed to update data in the published tables (i.e., the procedures for performing inserts/updates/deletes were missing
    for every table in the subscriber database).  Additionally, I could not recreate these stored procedures using sp_scriptpublicationcustomprocs
    because another procedure which was required for that proc to work was also missing. In short, there were hundreds of missing stored procedures in the subscriber database on which transactional replication is dependent in order to replicate DML changes and
    function normally and this includes system sprocs which would've been used to recreate the missing DML procs. In short, the subscriber was badly damaged and deemed to be unrecoverable within a reasonable time frame.
    The solution was to tear down and start over, which we did successfully later in the evening. 

  • Hiding and restoring table columns from file?

    how i handle hiding and unhiding columns in a jtable is that i have a checkbox for each column, depending on which is checked "on" the tablecolumn is found and added to a vector and removed from the table.
    when the checkbox is checked "off" this vector is searched for the correct tablecolumn, and then added back to the table. this works fine.
    when i close out of the program, i go thru the table and write the visible column names along with its size to file.
    when i re-open the program, i create the table normally, then go thru the file and hide(remove) the tablecolumns found in it..this works fine.
    but when i go back to this checkbox list and try to unhide the tablecolumn, i get an exception
    java.lang.IllegalArgumentException: Cannot format given Object as a Number
         at java.text.NumberFormat.format(NumberFormat.java:219)
         at java.text.Format.format(Format.java:133)
         at javax.swing.JTable$DoubleRenderer.setValue(JTable.java:3397)
         at javax.swing.table.DefaultTableCellRenderer.getTableCellRendererComponent(DefaultTableCellRenderer.java:160)
         at javax.swing.JTable.prepareRenderer(JTable.java:3731)
         at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:1149)
         at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1051)
         at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:974)
         at javax.swing.plaf.ComponentUI.update(ComponentUI.java:142)
         at javax.swing.JComponent.paintComponent(JComponent.java:541)
         at javax.swing.JComponent.paint(JComponent.java:808)
         at javax.swing.JComponent.paintChildren(JComponent.java:647)
         at javax.swing.JComponent.paint(JComponent.java:817)
         at javax.swing.JViewport.paint(JViewport.java:722)
         at javax.swing.JComponent.paintChildren(JComponent.java:647)
         at javax.swing.JComponent.paint(JComponent.java:817)
         at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4787)
         at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4740)
         at javax.swing.JComponent._paintImmediately(JComponent.java:4685)
         at javax.swing.JComponent.paintImmediately(JComponent.java:4488)
         at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:410)
         at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:117)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)before i unhide the columns, the table is already populated with values. so it might have something to do with that...cuz there is no problems unhiding them if the table contains no data
    any ideas?
    thanks

    If you're interested, this method hides a table column without any modifications of its content:
       public static void setTableColumnVisible(JTable table, int col,                                                                             
                                                  boolean visible, int width) {
          try {
             TableColumn column = table.getColumnModel().getColumn(col);
             if (!visible) {
                column.setMinWidth(0);
                column.setWidth(0);
                column.setMaxWidth(0);
                column.setPreferredWidth(0);
             else {
                column.setWidth(width);
                column.setPreferredWidth(width);
          catch(Exception e) {
             e.printStackTrace();
       }Method use:
    . setTableColumnVisible(table, col, false, 0) hides the column
    . setTableColumnVisible(table, col, true, 100) restores the column to its size of 100
    Hope this helped,
    Regards.

  • Cannot remove current currency

    88 PL14
    No Transactions in system (New System).
    Changing the currencies in the system.
    1. Added new currencies
    2. Change all Account Currencies to All Currencies.
    3. Change all business partner currencies to the new currency code.
    4. Change Local and system currency to new currency.
    5. Remove old currencies.
    Error:  When trying to remove the original local and system currency, I get an error: Cannot remove current currency
    Business Partners and accounts are changed to the new currency.
    Rebooted and tryed again.  Same error.
    Rebooted, created new superuser and tried again.  Same error.
    Created a test database based off this database, created transactions with no problems.  The new local currency code is being used.  Ran trial balance to verify.
    Is there any where else in the system that attaches itself to the currency?

    There were draft purchase orders created.  Removed the draft purchase orders.  Then the currency could be deleted.
    How I found the tables with 'USD':
    1. Created a stored procedure to search all columns in all tables of the database using the following
              http://vyaskn.tripod.com/search_all_columns_in_all_tables.htm (SQL7/SQL2000 query but works in SQL2008)
    2. Execute the stored procedure EXEC SearchAllTables 'USD' to search all tables and columns for USD
    3. Looked up tables in SDK help
    4. Found there were draft purchase orders, in Business One:
            Purchasing A/P -> Purchasing Reports -> Document Draft Report
            Right click each row and select remove
    5. With all drafts removed, opened the currency table and was able to remove the currency.
    Looks like I am going to have to get after somebody for testing on the wrong database.

  • REPORT_ATTRIBUTE_ERROR_MESSAGE in table column?

    Hi all,
    I want to use REPORT_ATTRIBUTE_ERROR_MESSAGE on table column, how can we use this?? or any other way..
    and one more doubt.. i am displaying some message when no element is select on table, it is displaying error message,
    but lead selection is removing? i dont want to remove lead selection . how can we achieve this?
    thanks,
    Venkat.

    Hi,
    Please check this...
      DATA lo_nd_pack_mat TYPE REF TO if_wd_context_node.
      DATA lo_el_pack_mat TYPE REF TO if_wd_context_element.
      DATA ls_pack_mat TYPE wd_this->Element_pack_mat.
      DATA lt_pack_mat TYPE wd_this->Elements_pack_mat.
      DATA lv_pack_material TYPE wd_this->Element_pack_mat-pack_material.
      DATA: wa_temp TYPE REF TO if_wd_context_element,
            lt_temp TYPE wdr_context_element_set.
    navigate from <CONTEXT> to <PACK_MAT> via lead selection
      lo_nd_pack_mat = wd_context->get_child_node( name = wd_this->wdctx_pack_mat ).
      CALL METHOD lo_nd_pack_mat->get_selected_elements
        RECEIVING
          set = lt_temp.
    LOOP AT lt_temp INTO wa_temp.
        CALL METHOD wa_temp->get_static_attributes
          IMPORTING
            static_attributes = ls_pack_mat.
        lv_pack_material = ls_pack_mat-pack_material.
        if lv_pack_material is initial.
          lo_api_controller ?= wd_This->Wd_Get_Api( ).
          CALL METHOD lo_api_controller->GET_MESSAGE_MANAGER
            RECEIVING
              MESSAGE_MANAGER = lo_message_manager.
    report message
          CALL METHOD lo_message_manager->REPORT_ATTRIBUTE_ERROR_MESSAGE
            EXPORTING
              MESSAGE_TEXT         = 'Please Select Packing Material...'
              ELEMENT              = wa_temp
              ATTRIBUTE_NAME       = 'PACK_MATERIAL' .
       exit.
        endif.
        append ls_pack_mat to lt_pack_mat.
        CLEAR ls_pack_mat.
      ENDLOOP.
      lo_nd_pack_mat->bind_table( new_items = LT_PACK_MAT
                                     SET_INITIAL_ELEMENTS = abap_false ).
    Thanks,
    Venkat.

  • Move Table Column with AppleScript in Microsoft Word

    Microsoft Word has a flaw (in my opinion) with tables in that it aligns the left and right text with the margins rather than aligning the table columns with the margins. This results in sloppy tables, because the left and right borderlines lie outside the margins.
    I would like to fix the word tables by
    calculating the left cell padding and right cell padding in points and setting them to variables {left_pad,right_pad} respectively
    move left column by left_pad to the right
    move right column by right_pad to the left
    The script I was working on does not work, but I will post it to show my thought process as I hone in on my solution.
    tell application "Microsoft Word"
        --595 points is width of A4 paper
        -- Set page margin in points to variables
        set {l_margin, r_margin, t_margin, b_margin} to {(get left margin of page setup of active document), get (right margin of page setup of active document), get (top margin of page setup of active document), get (bottom margin of page setup of active document)}
        get {l_margin, r_margin, t_margin, b_margin}
        -- Set specific Paragraph margins
        -- NOTE: If you select a table thinking you wish to drag just the left margin to the right, or the right margin to the left, this code does not accomplish this because each cell has its own paragraph formatting. This code will set the margin for every single cell, because each cell has its own margins! (separate from padding).
        set para_sel to paragraph format of selection
        set paragraph format left indent of para_sel to (centimeters to points centimeters 0.5)
        -- Aligning left and right columns of table with the margins
        -- NOTE: There is a command to set left row indent, but not right row indent (very stupid of Microsoft)
    end tell

    I have worked up something that seems to work (although I cannot promise it is the best way). Hope it helps anyone else who has this need.
    tell application "Microsoft Word"
    activate
    set findRange to find object of selection
    clear formatting findRange -- clear any previous formatting used in a find operation
    set forward of findRange to true -- find forward
    set style of findRange to "List Bullet" -- the style to look for
    tell findRange
    set gotIt to execute find find text "" -- do the search w/o matching any text
    end tell
    if gotIt is true then -- if a match was found
    copy object selection -- copy it to the clipboard
    set mySelection to (the clipboard) -- then put clipboard into a variable
    set myOffset to ¬
    (get selection information selection information type ¬
    (horizontal position relative to page)) -- now put selection info into a variable
    display dialog mySelection & return & (myOffset as text) -- then display it
    end if
    end tell

Maybe you are looking for

  • Add New Row in Table on click of a button

    Hi All, I am using JDeveloper 11.1.5 I have a af:table with a detailFacet. In this detailFacet there is an af:commandButton. On click of this commandButton I want a new row to be added to the table programmatically. In my Backing Bean I have followin

  • Oracle SOA Suite DB Adapter with BPEL

    Hi All, I am using an inbound DB Adapter to poll a tabe and fetch any new inserted records. My implemented flow DBAdapter (Reads Data from database) > BPEL Process In my table i have a status column which needs to be updated if the record fetched is

  • Reading data from multiple excel sheets

    hi all i have to read the data from excel file's sheet1 and sheet3. how can i do this using forms6i thanks.

  • IPhone 4S - slow and Facebook

    Hi all. My iphone has started doing strange things. Facebook use to work fine but now it won't work. It opens but before anything loads it closes again. I have switched on /off and  uninstalled and reinstalled the app. Still doesn't work. Also my iph

  • Can't log in to bank that I've used for years

    I'm in Europe and use a bank in U.S. that I've logged on to for years.  It won't let me log on.  I don't believe there were any updates.   I do other financial institution log-ons.  No problem.   I zapped cookies, no help.  I upgraded to Lion.  no He