Update of JTable after inserting row with beans binding

I have a little problem. When i create a little app with netbeans which uses the beansbinding with a table it is not possible to get updates of the list into the table.
i use nearly the same methods as if i create a database application with the wizzard. The only difference i see (so far) is that i don't use the Swing application framework.
if i try to repaint the table or the ScrollPane, nothing happens. The list is changed but not the table....

You should be updating the TableModel, not the "list". When you update the model it will notify the table to repaint itself.

Similar Messages

  • How to Display a message after inserting row in table............

    Hi
    I want to display a message after inserting rows in table like *'you have inserted a new row successfully*'.
    i am using the createinsert ADF Button to insert the rows in table.after that i am comitting it.
    after commiting i want to display message for the user.for this what i need to do.
    Please help me.
    Sailaja.

    user10860137
    Can you please explain me the each line in the code briefly.
    +public String saveButton_action(){+
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("Commit");
    Object result = operationBinding.execute();
    +// note "!" operator has been removed from the default code.+
    +if(operationBinding.getErrors().isEmpty()){+
    FacesContext ctx = FacesContext.getCurrentInstance();
    FacesMessage saveMsg = new FacesMessage("Record Saved Successfully");
    ctx.addMessage(null,saveMsg);
    +}+
    return null;
    +}+
    And i have requirement to show the message on favcet "status bar".not in a popup window.(from the above code the message is showing in popup window. )the Layout i am using is PanelCollection.
    can you tell me what i need to do.
    Thanks
    Sailaja.
    Edited by: sj0609 on Mar 19, 2009 8:03 AM

  • Is there a update for adobe after effects compatible with the mac os x 10.9.5 ?

    is there a update for adobe after effects compatible with the mac os x 10.9.5 ?

    If you are using After Effects CS6 (11) or After Effects CC (12), then install the updates:
    http://adobe.ly/AE_CC_1201_Mavericks

  • Transient VO insert error-Attempting to insert row with no matching EO base

    Hi ,
    I have a transient Vo (created using option - rows populated programmatically, not based on Query) and I need to uptade/insert rows in vo on click of a button.
    when i nsert row, i get following error
    oracle.jbo.InvalidOperException: JBO-26020: Attempting to insert row with no matching EO base
    This is what I am doing in my code
    ViewObject vo2 = am.findViewObject("TransientVO1");
    vo2.executeQuery();
    if (vo2 == null) {System.out.println("vo2 is null");}
    if (vo2 != null)
    System.out.println("in vo2 != null");
    Row row2 = vo2.createRow();
    row2.setAttribute("PlatformName", "ss");
    row2.setAttribute("UserName", "ss");
    vo.insertRow(row2);
    System.out.println(" vo2.getRowCount()"+ vo2.getRowCount());
    Why is it saying no EO base... is it mandatory to have EO for transient VO? Please help.
    Thanks

    The EO handles all DML, hence you need it if you have to set attributes in a VO. An EO handles the storage of a the single row (or part if your VO consists of multiple tables).
    You can try and overwrite the setter method of the attributes in ViewRowImpl class and store the changes somewhere else.
    Timo

  • Is it possible to insert row with timestamp field without to TO_TIMESTAMP

    hello
    is it possible to insert row with timestamp column without using to_timestamp unction
    somthing like insert into app.master values (3,333, 'inser tmstmp', 6.7, '2010-11-10 15:14', 'f','9','2010-12-22')

    784633 wrote:
    hello
    is it possible to insert row with timestamp column without using to_timestamp unction
    somthing like insert into app.master values (3,333, 'inser tmstmp', 6.7, '2010-11-10 15:14', 'f','9','2010-12-22')If you don't like the answers in your previous thread (Re: how can i set timestamp format don't expect to get different answers just because you start a new thread.

  • JBO-26020: Attempting to insert row with no matching EO base

    Hi All,
    I have a bit of a problem here. The following is some background information. Please help if possible.
    Aim: I have a custom application whereby I need to add the sequence value (assuming the sequence.nextval is already taken and stored into a variable/original table) to my custom table.
    Procedures taken: I have found the EO which gets the sequence value for the original application and the VO that gets the EO. I have added both EO and VO to my project and tried to add the VO to my custom AM. In my custom AM I have added the following code to initialize the create function of the standard EO:
    **********CODE******************
    OAViewObject vo3 = (OAViewObject)getRegRequestsVO1();
    if (!vo3.isPreparedForExecution())
    vo3.executeQuery();
    Row row = vo.createRow();
    vo3.insertRow(row);
    row3.setNewRowState(Row.STATUS_INITIALIZED);
    Problem: However when I use the code vo3.insertRow(row); it prompts me with the applicaiton error of JBO-26020: Attempting to insert row with no matching EO base. I don't quite understand what I am doing wrong.
    Can anyone please help.
    Cheers

    This i have find out .
    FYI...
    JBO-26020: InvalidOperException
    Cause: The application code tried to take a row from one row set (or view object) and insert it into another row set (view object). In response, the framework will make a "copy" of the row in the new row set. This new row will share references to the underlying entity objects. However, if the source and destination row sets do not share any entity object bases at all, this operation will fail as it does not find any entity rows to share.
    Action: When attempting to take a row from one row set and insert into another, make sure that they share at least one entity object base.
    Thanks

  • DBMS_SCHEDULER after insert row

    Hi,
    I have probably simple question..
    Is there any trick to run job after insert row?? I try to find some example, but all have repeat_interval :/ Thanks for all sugestions :)

    Why can't you use trigger? Or if it must be a job you can probably run job from trigger. By the way - repeat_interval is not the time when job is starting but the time between job executions. The time when job is starting can be set by start_date parameter of DBMS_SCHEDULER.CREATE_JOB procedure.

  • After Insert Trigger with DML on the subject table?

    I am trying to set up e-mail notifications, so I created a procedure, which accepts the argument of an id. In the procedure, it queries the table and sends out mail based on the result set. (in the trigger, I pass in the value of :NEW.id). The procedure then queries the table for that row id.
    First, for the after update I was getting the error:
    ORA-04091: table is mutating, trigger/function may not see it ORA-06512
    So, I was advised to do in the declare block: pragma autonomous_transaction; I did that, and that solved the problem there. SO I did the same in the after insert trigger, but then I get the error:
    ORA-00060: deadlock detected while waiting for resource ORA-06512
    I asked our DBA and he said you are not able to query the table of which the trigger is a subject of. I thought it would be possible since its After insert or update?
    Can anyone offer any suggestions ? :)
    Thanks,
    Trent

    Any reason why it would work in an after update trigger then?
    So, I was advised to do in the declare block: pragma autonomous_transaction; I did that, and that solved the problem therePRAGMA AUTONOMOUS_TRANSACTION "bends" the restriction against SQL against base table.
    It is the equivalent to tap dancing across a mine field.
    You might get the desired results most of the time or you might get a tasty surprise when you least expect it.
    What happens to your application in the future, if/when the UPDATE has a ROLLBACK issued & PRAGMA AUTONOMOUS_TRANSACTION has successfully completed?
    Inquiring minds would like to know the answer.

  • Insert row with same formatted cells

    I am a newbye with Numbers.
    I have created a spreadsheet with some columns and every cell formatted, such as a list or a box to check.
    Until now every time I have inserted a new row the system create a row with the same formattated cells,
    now the system insert a blank row without formattated cells.
    Please, help me! Thanks.

    Vin,
    Being new to Numbers, you should read the Numbers User Guide, available as a free download from the help menu.
    The problem you are experiencing may be in another column. The condition that Barry mentioned, having the same expression or special format in every body row, applies to every column in the table.
    Jerry

  • ME11 update error : Error during insert EINE with key

    HI All,
    I am facing the below problem..For one particular user update request is failing in ME11 transaction.Error was found in function module name ME_UPDATE_INFORECORD.I also check if it is number range problem but it is not the case..
    Please help me out..
    Thanks in advacne.

    Hi,
    The problem is that only one user is getting sporadic failed update messages (since last 3-4 days) when using transaction ME11. The error as recorded in SM13 is "Error during insert EINE with key <Inforecord #> <Pur Org>".
    I checked the table EINE for the key mentioned in the above message and found that there is a 2 years old record with the same key. Now, what I do not understand is that while creating a new Inforecord, why does SAP comes up with an old number instead of generating a new one from the number range object. I tried to search on SDN as well as OSS Notes, but could not find any mention to this problem.
    And yes, it is an abend message with no short dump...
    Thanks,
    Gaurav
    Edited by: Gaurav Malhotra on Feb 24, 2012 3:08 PM

  • JTable: After one row is modified, the row should have red color background

    After one row is modified(using setValueAt()),
    I want the modified row to have red color background color.
    How can I do that? I tried.
    JTableInstance.setBackground( Color.RED);But it sets all the rows not the only modified row.

    import java.awt.*;
    import java.util.ArrayList;
    import javax.swing.*;
    import javax.swing.table.*;
    public class TableChangeTest extends JFrame {
        public TableChangeTest() {
            initComponents();
            renderer = new MyTableRenderer();
            table.setDefaultRenderer(String.class, renderer);
            int row = 0;
            table.setValueAt("test1",row,0);
            rowsChanged.add( row );
            row = 2;
            table.setValueAt("test2",row,1);
            rowsChanged.add( row );
        private void initComponents() {
            panel = new JPanel();
            scrollPane = new JScrollPane();
            table = new JTable();
            setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
            setTitle("Table Change");
            panel.setLayout(new BorderLayout());
            table.setModel(new DefaultTableModel(
                    new Object [][] {
                        {"1", "a"},
                        {"2", "b"},
                        {"3", "c"},
                        {"4", "d"}
                    new String [] {
                "Title 1", "Title 2"
                Class[] types = new Class [] {
                    java.lang.String.class, java.lang.String.class
                public Class getColumnClass(int columnIndex) {
                    return types [columnIndex];
            scrollPane.setViewportView(table);
            panel.add(scrollPane, BorderLayout.CENTER);
            getContentPane().add(panel, BorderLayout.CENTER);
            Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
            setBounds((screenSize.width-357)/2, (screenSize.height-241)/2, 357, 241);
        public static void main(String args[]) {
            new TableChangeTest().setVisible(true);
        private JPanel panel;
        private JScrollPane scrollPane;
        private JTable table;
        private TableCellRenderer renderer;
        private ArrayList rowsChanged = new ArrayList();
        class MyTableRenderer extends DefaultTableCellRenderer {
            public Component getTableCellRendererComponent(
                    JTable table,
                    Object value,
                    boolean isSelected,
                    boolean hasFocus,
                    int row,
                    int column) {
                super.getTableCellRendererComponent(table,
                        value, isSelected, hasFocus, row, column);
                setBackground( Color.white );
                if( rowsChanged.contains(row) ) {
                    setBackground( Color.red );
                return this;
    }

  • After insert trigger with :NEW.ROWID

    Hi All,
    I am using a After insert trigger to generate history record as following:
    CREATE TABLE TB_TEST (classID number(3), classNm varchar2(12));
    CREATE TABLE TB_HIST_TEST (hist_dttm timestamp(6), classID number(3), classNm varchar2(12));
    CREATE or REPLACE TRIGGER air_test AFTER INSERT ON tb_test FOR EACH ROW
    BEGIN PK_SRVC.CRT_NewRec('TB_TEST', 'TB_HIST_TEST', :new.ROWID); END:
    In PK_SRVC package, I use the following statment to create new record in TB_HIST_TABLE:
         Insert into tb_hist_test (hist_dttm, classID, classNm)
         values (select systimestamp, classID, classNm from tb_test where rowid = ROWID )
    The trigger DOES fire when a new row is inserted into TB_TEST. However there is no record inserted into TB_HIST_TEST. Any suggestion?
    Thanks,

    The PK_SRVC.CRT_NewRec is a generic service package that can be shared by many tables. It uses dynamic SQL to get all the collumns for different tables based on USER_TAB_COLUMNS.  The following is the code of this package:
    PROCEDURE CRT_NewRec ( p_TableName IN VARCHAR2, p_AudTableName IN VARCHAR2, p_RowID)
    IS
           TYPE TabCol_RecTyp IS RECORD (COLUMN_NAME VARCHAR2(30), COLUMN_ID NUMBER);
           TYPE TabCol_CurTyp IS REF CURSOR;
            c_TabCol TabCol_CurTyp;
            rc_TabCol TabCol_RecTyp;
            v_Sql_TabCol VARCHAR2(1000);
            v_ColNames VARCHAR2(1000);
            v_Sql VARCHAR2(1000);
            PRAGMA AUTONOMOUSE_TRANSCATION;
    BEGIN
            v_SQL_TabCol := ' SELECT column_name, column_id FROM USER_TAB_COLUMNS'
                                      ||  ' WHERE table_name = ' || CHR(39) || p_TableName || CHR(39)
                                      || '  ORDER BY column_id';
            v_ColNames := NULL;
            OPEN c_TabCol FOR v_Sql_TabCol;
            Loop
                   FETCH c_TabCol INTO rc_TabCol; Exit WHEN c_TabCol%NOTFOUND:
                   v_ColNames := v_ColNames || ',' || rc_TabCol.COLUMN_NAME;
            End Loop;
            CLOSE c_TabCol;
            v_Sql := 'INSERT INTO ' || p_AudTableName || '(HIST_DTTM, ' || v_ColNames || ' )'  
                      || ' SELECT systimestamp, ' || v_ColNames || ' FROM ' || p_TableName
                      || ' WHEN ROWID = chartorowid(' || CHR(39) || p_RowId || CHR(39) || ')';
             EXECUTE IMMEDIATE v_Sql;
             COMMIT;
    END;    
    (charmingholidays-yyz)

  • Strange Behaviour: Inserting Rows with OrdVideoDomain using JDeveloper

    Dear Sirs...
    i created two tables each containing OrdVideoDomainField.
    i use the same function to fill the rows with values. the code is like this:
    ViewObject V=GetViewObject(V);
    Row R=V.CreateRow();
    byte b[]=new byte[10];
    OrdVideoDomain O=new OrdVideoDomain(b);
    R.setAttribute("f",O);
    R.setAttribute("name",AnyName);
    V.insertRow(R);
    R=null;
    GetTransaction.postChanges(); // gets the appmodule and then gets the transaction object within and finally posting the change
    GetTransaction.commit();
    When i use the function of the viewobject A, all the data is stored correctly when dealing with table A. But when dealing with table B, all the data are stored correctly but the OrdVideoDomain field is filled with null. i get no error at all.
    i checked the names of the fields in the tables, and they are correct.
    i tried to upload files into both tables and these are working perfectly fine.
    i tried to get the data from both tables and they are working perfectly fine.
    the problem is only when i store data programatically into the table b.
    does any one have a similar problem?
    how to solve it?
    i am using ADF UIX in jdeveloper 10g 10.1.2 with oracle database 10g release 2 and both are under windows.
    thanks for any help in advance
    best regards

    Sorry, i have found the problem, it is a programming error
    best regards

  • PB with beans binding in a netbeans 6 java project with ant script existing

    Hi all,
    I am using netbeans 6.01.
    I want to use beans binding in a simple swing form created with Matisse designer. If i do beans binding in a Netbeans java project with existing ant script i have the following error :
    java.lang.UnsupportedOperationException: No PCPE/PCPMI found for classpath/compile in MasterFileObject@25 .... etc
    Beans binding works very well in normal java project ( Java Desktop App for instance ).
    How can i make it work in an existing java ant script project ?

    You need to add the Beans Binding (beansbinding-1.2.1) that come with NetBeans 6 in your projects class path.

  • Refresh jTable after inserting new data into the Database

    Hey all,
    I'm using Netbeans 6.5 to create a Desktop Application which is connected to a Java DB (Derby).
    The first simple steps were all very successfull:
    Create the jTable and bind it to the Database => everything works fine. When the application starts it correctly shows all data from the database.
    The problem starts when I try to insert new data to the database.
    For that reason I've created textfields and a button "Save". When I press the button it successfully inserts the data to the database but they are not displayed in the jTable (when the application starts they are all there, they are not updated at runtime) . I've tried table.invalidate() and table.repaint() but they just don't work.
    Any help will be GREATLY appreciated. But please have in mind that most of the code is Netbeans-generated and most of it not editable.
    Many thanks in advance.
    George

    Once again you are right my friend. I jumped to conclusion way too fast, when I shouldn't. (Give me a break, I've been busting my head with this well over a week). The response I saw when I did that was that indeed a line is added to the jTable. Because I falsly set the index of the object to be added to be second to last the row appeared on the table, what I didn't see at the time was that the last one disappeared. Hmm...
    A new adventure begins...
    So after a few hours of messing around with it here are my observations:
    1) It was not an observable list. When I add the new element with employeesList.add(newEmp); , the table gets notified but a get a bunch of exceptions:
    xception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 84, Size: 84
            at java.util.ArrayList.RangeCheck(ArrayList.java:546)
            at java.util.ArrayList.get(ArrayList.java:321)
            at org.jdesktop.swingbinding.impl.ListBindingManager$ColumnDescriptionManager.validateBinding(ListBindingManager.java:191)
            at org.jdesktop.swingbinding.impl.ListBindingManager.valueAt(ListBindingManager.java:99)
            at org.jdesktop.swingbinding.JTableBinding$BindingTableModel.getValueAt(JTableBinding.java:713)
            at javax.swing.JTable.getValueAt(JTable.java:1903)
            at javax.swing.JTable.prepareRenderer(JTable.java:3911)
            at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:2072)
            at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1974)
            at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:1897)
            at javax.swing.plaf.ComponentUI.update(ComponentUI.java:154)
            at javax.swing.JComponent.paintComponent(JComponent.java:743)
            at javax.swing.JComponent.paint(JComponent.java:1006)
            at javax.swing.JViewport.blitDoubleBuffered(JViewport.java:1602)
            at javax.swing.JViewport.windowBlitPaint(JViewport.java:1568)
            at javax.swing.JViewport.setViewPosition(JViewport.java:1098)
            at javax.swing.plaf.basic.BasicScrollPaneUI$Handler.vsbStateChanged(BasicScrollPaneUI.java:818)
            at javax.swing.plaf.basic.BasicScrollPaneUI$Handler.stateChanged(BasicScrollPaneUI.java:807)
            at javax.swing.DefaultBoundedRangeModel.fireStateChanged(DefaultBoundedRangeModel.java:348)
            at javax.swing.DefaultBoundedRangeModel.setRangeProperties(DefaultBoundedRangeModel.java:285)
            at javax.swing.DefaultBoundedRangeModel.setValue(DefaultBoundedRangeModel.java:151)
            at javax.swing.JScrollBar.setValue(JScrollBar.java:441)
            at javax.swing.plaf.basic.BasicScrollBarUI.scrollByUnits(BasicScrollBarUI.java:907)
            at javax.swing.plaf.basic.BasicScrollPaneUI$Handler.mouseWheelMoved(BasicScrollPaneUI.java:778)
            at javax.swing.plaf.basic.BasicScrollPaneUI$MouseWheelHandler.mouseWheelMoved(BasicScrollPaneUI.java:449)
            at apple.laf.CUIAquaScrollPane$XYMouseWheelHandler.mouseWheelMoved(CUIAquaScrollPane.java:38)
            at java.awt.Component.processMouseWheelEvent(Component.java:5690)
            at java.awt.Component.processEvent(Component.java:5374)
            at java.awt.Container.processEvent(Container.java:2010)
            at java.awt.Component.dispatchEventImpl(Component.java:4068)
            at java.awt.Container.dispatchEventImpl(Container.java:2068)
            at java.awt.Component.dispatchMouseWheelToAncestor(Component.java:4211)
            at java.awt.Component.dispatchEventImpl(Component.java:3955)
            at java.awt.Container.dispatchEventImpl(Container.java:2068)
            at java.awt.Component.dispatchEvent(Component.java:3903)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4256)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3965)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3866)
            at java.awt.Container.dispatchEventImpl(Container.java:2054)
            at java.awt.Window.dispatchEventImpl(Window.java:1801)
            at java.awt.Component.dispatchEvent(Component.java:3903)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
            at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 84, Size: 84
            at java.util.ArrayList.RangeCheck(ArrayList.java:546)
            at java.util.ArrayList.get(ArrayList.java:321)
            at org.jdesktop.swingbinding.impl.ListBindingManager$ColumnDescriptionManager.validateBinding(ListBindingManager.java:191)
            at org.jdesktop.swingbinding.impl.ListBindingManager.valueAt(ListBindingManager.java:99)
            at org.jdesktop.swingbinding.JTableBinding$BindingTableModel.getValueAt(JTableBinding.java:713)
            at javax.swing.JTable.getValueAt(JTable.java:1903)
            at javax.swing.JTable.prepareRenderer(JTable.java:3911)
            at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:2072)
    ... and a lot morewhich from my poor understanding means that the jTable succesfully notices the change but it is not able (??) to adjust to the new change. What is more interesting is that when I plainly add the element to the end of the list (without an idex that is), a blank row appears at the end of my Table. The weird thing is that I've bound the table to some text fields below it, and when I select that empty row all the data appear correctly to the text fields.
    I tried going through:
                    org.jdesktop.observablecollections.ObservableCollections.observableList(employeesList).add(newEmp);as well as
                    help = org.jdesktop.observablecollections.ObservableCollections.observableListHelper(employeesList);
                    help.getObservableList().add(newEmp);
                    help.fireElementChanged(employeesList.lastIndexOf(newEmp));and
                    obsemployeesList = org.jdesktop.observablecollections.ObservableCollections.observableList(employeesList);
                    obsemployeesList.add(newEmp);and I still get the same results (both the exeptions and the mysterious empty row at the end of the table
    So, I'm again in terrible need of your advice. I can't thank you enough for the effort you put into this.
    Best regards,
    George
    Edited by: tougeo on May 30, 2009 11:06 AM
    Edited by: tougeo on May 30, 2009 11:21 AM
    Edited by: tougeo on May 30, 2009 11:30 AM

Maybe you are looking for

  • TS3198 how to check my phone is unlocked

    how to check my phone is unlocked

  • Port open but no access.

    Dear All, I have created a simple listener program listening on port 9000. So when I do netstat -a I can see the port is listening. I have gone to my router and forwarded that port to my pc. Then in the windows firewall I have added the exception as

  • Font not showing up in xfontsel [SOLVED]

    Hello everybody, I've been trying to install Anonymous Pro from the AUR, and while I can use it from certain programs (LibreOffice, for instance), it won't show up in xfontsel. Reading through the wiki and other posts, the only two possible solutions

  • Can SAP B1 handel this case?

    Hi all! We have a prospect in retail  electronic home appliance  industry. With some survey about data per day: - Invoice : 3000 invoice/day/store. They have 10 stores and will grow up more 5 in the future. My question: 1.Can we handle this case for

  • Unable to drag variables in "Use Associations" when implementing a task

    Nothing happens when i try to drag variables from right panel into fields on the left in "Use Association" window, when implementing a script task (or human task). i've cleared the repository and re-installed jdeveloper, but the problem is still ther