Problems with adding a new row in my table

Im an ADF beginner but I thought it would be simple to to do some basic CRUD stuff in ADF. Im now even struggling when i try to add a new row to my table.
Seems that the primary key id is not set correctly...
could someone help?

Hi,
Have a look to this page CREATE SEQUENCE
Regards,
Sébastien
Creating a Sequence: Example
The following statement creates the sequence customers_seq in the sample schema oe. This sequence could be used to provide customer ID numbers when rows are added to the customers table.
CREATE SEQUENCE customers_seq START WITH     1000 INCREMENT BY   1 NOCACHE NOCYCLE;

Similar Messages

  • Problem in adding a new row in a table.. plsss hlppp

    Hi Friends,
    I have a table defaulted to 4 rows. I have a add button to add a new row in the table.
    When i have already 4 rows in table, and when i click add its adding that 5th row correctly( and i used set_lead_selection for this new row ).
    But i want to automatically make a next page once i hit the ADD button here. Each time now i m hitting next page then only  able to see hte 5th row. I need once ADD is clicked, i want to see the 5th row visible..
    Can someone tell me how to code or do this
    thanks friends,,,
    Niraja

    hi niraja,
    Plz refer to the following code:
    method onactiononadd .
    node_material type ref to if_wd_context_node.
    elem_material type ref to if_wd_context_element.
    stru_material type sflight.
    node_material =  wd_context->get_child_node( name = 'ANNA' ).
    elem_material = node_material->get_element(  ).
    if ( elem_material is initial ).
    call method node_material->create_element
    receiving
    element = elem_material.
    endif.
    call method elem_material->get_static_attributes
    importing
    static_attributes = stru_material .
    call method node_material->bind_structure
    exporting
    new_item = stru_material
    set_initial_elements = abap_false.
    endmethod.
    i hope it helps
    regards
    arjun

  • Problem with adding a new row in JTable

    Hi,
    I've created a JTable using DefaultTableModel with DefaultTableModel(Object[][] obj,Object[] col) constructor.I've written actionListener for a JButton which should add new row to the tablemodel.Now, the listener adds the row to the model.But its throwing an ArrayOutofBoundsException and the added row is not visible unless I click on any column of the table.
    Kindly help me to resolve this problem
    TIA
    Regards
    Gopi

    Thanks a lot for the reply. Here is the complete code
    TableImpl.java
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.table.*;
    import java.util.Vector;
    public class TableImpl extends JFrame {
    DefaultTableModel dataModel;     // TableModel Variable
    /* Constructor to add table and button to the frame     */
    TableImpl() {
              getContentPane().setLayout(null);
              setSize(800,600);
              myModel();
              final JTable table = new JTable(dataModel);
              JScrollPane scrollpane = new JScrollPane(table);
              getContentPane().add(scrollpane);
              scrollpane.setBounds(10,10,700,300);
              TableColumn tcCol = table.getColumnModel().getColumn(1);
              /* Adding ComboBox to the CellEditor of Column 2 of table     */
              JComboBox jcbComboBox = new JComboBox();
              final ReturnVector vctDBAccess = new ReturnVector();
              jcbComboBox.addItem(vctDBAccess.vctGetOidList().elementAt(0).toString());
              jcbComboBox.addItem(vctDBAccess.vctGetOidList().elementAt(2).toString());
              jcbComboBox.addItem(vctDBAccess.vctGetOidList().elementAt(4).toString());
              tcCol.setCellEditor(new DefaultCellEditor(jcbComboBox));
              /*     Adding Listener for Table      */
              dataModel.addTableModelListener(new TableModelListener() {
                   public void tableChanged(TableModelEvent e) {
              /* Columns Manipulation */
                        if(dataModel.getColumnName(e.getColumn()).equals("Second")) {
                        int iRow = e.getFirstRow();
                        int iColumn = e.getColumn();
                        String strColName = dataModel.getColumnName(iColumn);
                        String strData = (String)dataModel.getValueAt(iRow,iColumn);
                        String strNextColumn = dataModel.getColumnName(iColumn+1);
                        dataModel.setValueAt(vctDBAccess.vctGetOidList().elementAt(vctDBAccess.iGetIndex(strData)+1),iRow,iColumn+1);
              /* Adding button to Frame     */
              JButton jbInsert = new JButton("Insert");
              /* Adding new row to the Tablemodel -- Probelm is here     */
              jbInsert.addActionListener(new ActionListener(){
              public void actionPerformed(ActionEvent e){
                        try {
                   Object[] nrow = {"what", "ever", "you"};
                   dataModel.addRow(nrow);
                   }catch(Exception ex) {
                   System.out.println("Exception at adding row = " + ex);
    getContentPane().add(jbInsert);
    jbInsert.setBounds(100,350,100,20);
    addWindowListener(new WindowAdapter() {
              public void windowClosing(WindowEvent e) {
                   System.exit(0);
         /* Method to initialise new tablemodel     */
         public void myModel() {
              Object[][] data = { {new Integer(10),"two","three"},
                                                 {new Integer(5),"two","three"},
                                                 {new Integer(4),"two","three"},
              String[] col = { "First", "Second", "Third"};
              dataModel = new DefaultTableModel(data,col);
    public static void main(String arg[]) {
              TableImpl ct = new TableImpl();
              ct.setVisible(true);
    /* Class that returns a Vector of String for populating ComboBox entries and
              for getting the index of a particular element of the vector          */
    class ReturnVector {
                   Vector vctOidName=null;
                   ReturnVector() {
                        this.vctOidName = new Vector();
                        vAddOidList();
                   public void vAddOidList() {
                        String[] dbResult = {      "system", "1.3.6.1.2.1.1" ,
                                                      "interface", "1.3.6.1.2.1.2" ,
                                                      "snmp", "1.3.6.1.2.1.3" };
                        for(int i=0;i<dbResult.length;i++) {
                             System.out.println("Value = " + dbResult);
                             vctOidName.addElement(dbResult[i]);
                   public Vector vctGetOidList() {
                        return vctOidName;
                   public int iGetIndex(String strData) {
                        System.out.println("Index = " + vctOidName.indexOf(strData));
                        return vctOidName.indexOf(strData);

  • Problem while adding a new row to the table.

    hello,
    In my ADF form i have a table. and when i click on CreateInsert it add a new to the table but at the first. i want all the new rows to be added at the end of the table in a sequence. how can i do this?....
    Thanks and Regards,
    Rakshitha

    Hi,
    Try this:
    DCIteratorBinding dciter;
    BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
    dciter = (DCIteratorBinding) bindings.get("findAllTestAndryIter");
    ViewObjectImpl vo = dciter.getViewObject();
    if (vo != null)
    Row row = vo.createRow();
    int rangeSize = vo.getRangeSize();
    int rowsInRange = vo.getAllRowsInRange().length;
    int insertPos = rowsInRange < rangeSize? rowsInRange: rangeSize - 1;
    vo.insertRowAtRangeIndex(insertPos, row);
    vo.setCurrentRow(row);
    }

  • Problem with deleting a new row in table

    Hi
    I'm using JDev 11.1.1.2.0
    Please someone tell me if he/she experience the same issue:
    - I have an simple entity with PrimaryKey other than RowID. I have a ViewObject on top of the Entity.
    - From this view I create Editable table and add createInsert and Delete buttons.
    This is one of the most common scenarios.
    Now when I click createInsert a new blank row is added to the table. I enter it's primary key (because is mandatory) and move selection to some other row (let say X).
    When I go back and select my new Row and press Delete -> it is not deleted but the row X is deleted.
    This is because the table is not refreshed and it cant select the new row.
    How can I deal with this problem?
    Thanks
    Angel

    I tried with adding my selectionListener method like this:
            Object next = selectionEvent.getAddedSet().iterator().next();
            Object prev = selectionEvent.getRemovedSet().iterator().next();
            System.out.println(prev + " " + next);      
            DCBindingContainer bc = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
            DCIteratorBinding iter = (DCIteratorBinding)bc.get("TestDopSyotvIterator");
            FacesCtrlHierBinding object1 = (FacesCtrlHierBinding)bc.get("TestDopSyotv");
            FacesCtrlHierBinding.FacesModel collectionModel = (FacesCtrlHierBinding.FacesModel)object1.getCollectionModel();
            collectionModel.makeCurrent(selectionEvent);I add new row, enter data and change selection. Then the system.out prints the right keys of the rows.
    But when I go back to the new added row, the system.out prints "null" for the "next" value (that means the rowKey was lost).
    Any ideas how to fix this?

  • Problem with adding a new InfoProvider in Report Designer

    Hey experts,
    I have a problem to add a new Infoprovider in Report Designer. I get the following message:
    Query consists variables. Please use a query view (variables are filled).
    Can anyone tell me what the problem is.
    Thanks in advance.
    Best Regards
    Ali

    Hi Ali,
    Note 931838 describes this issue.
    Best regards,
    Janine

  • Problem with checkbox group in row popin of table.

    In table row popin I have kept Check Box Group.I have mapped  the texts property of checkbox group to the attribute which is under the subnode of the table.the subnode properties singleton=false,selectioncardinality=0-n,and cardinality=0-n.
    if there are 'n' number of records in the table.each record will have its own row popin and in the row popin there is check box group.
    the check box group in the row popin  belongs to that perticular row.
    but the checkboxegroup values in row popins of all the  rows are getting changed to the row which is lead selected.
    The same scenario  (table in the row popin is showing the values corresponding to its perticular row and all the table values in popin are not getting changed to the one lead selected in the main table)is working fine with the table in place of  checkbox group in row popin with datasource property of table  binded to the subnode
    I cant trace out the problem with checkbox group in place of table.
    Please help me in this regard.I have to place check box group in place of table in row popin.
    Thanks and Regards
        Kiran Kumar K

    I have done the same thing successfully with normal check box ui element. Try using check box in your tabel cell editor instead of check box group.

  • Problems with adding a new device in Common Services

    Hello,
    I have the following problem: I need to add a new device in my Cisco Works. What I do is I go to Common Services >> Device and Credentials >> Device Management. There I click "Add" and I add the new device with the corresponding credential set.
    Then, in the RME >> Job Management >> RME Jobs I can see a new job created (
    CDA:CDA job due to Device Add. ) because of this addition but this jobs stays always in status Running and it never finishes. Most probablt because of that this newly added device never actually appears in the RME so I cannot operate with it - deploy software, save configs, etc.
    I did this test a few times and all the times this is the result.
    I tought that it might be a firewall issue blocking some protocol needed for the communication, as SNMP, telnet or something else. But if I go to Decice Center and I select this newly added device (which there appears with the question mark icon, not with the right device icon) I can see all the information for it, like Detailed Device Report, etc.
    Then I noticed that in the RME Jobs section I have some more jobs that are like running forever - "
    CredEditCDA: CDA job due to Credential Edit".
    See the attached image for details:
    So, my question is what might be the reason for this behaviour and what can I do in order to unblock these jobs and add my device normally?
    What I use is:
    Windows Server
    LMS 3.2
    RME 4.3.0
    Thank you in advance,
    Vesko

    OK,
    first of all, have you intergrated lms with ACS ? - check in common services - server - security - single-server mgmt - local user policy setup.
    If this is in ACS, check if the newly added devices is in ACS... Check if this devices is reflecting in common services itself...make sure that the device type is selected properly ???
    Next do a snmp test in device center for this machine..how would you do this --" in device center, select the device, do a management to station and select the snmpv2 and ok it" you will get if snmp is failing or not...As you mentioned it is coming in question mark..this is because the correct device type is not selected in common services.
    Do an update inventory & archive and check the status..
    ~ rate if this was helpful.
    -rajesh

  • Problems with adding a new city to the weather on ipod touch

    I try to add a new city on the weather page of my ipod itouch and it does nothing.. so when i go into safari, it says safari is not connected to the internet and yet, i got full bars on my wifi. I am pretty new to this and the manuals don't help much. any info would be greatly appreciated.

    Ok, you are not connected to WiFi. Just because the wireless indicator is on doesn't mean you are actually connected, so
    Tap Settings > WiFi and look at which networks come up. If they have a lock symbol in the listing, you can't just tap on them to connect as they are encrypted and need a password to connect.
    Do you have a home wireless network setup? If you do and are using WEP, you need to do a couple of things: 1) set encryption to WPA-personnel or WPA2-personnel if you can; 2) if you can't set your router to those, use 128 bit WEP; 3) If using WEP, write down the hex key generated by the router in response to your password; 4) When you sign on, tell your touch which encryption you are using; 5) Enter your password or hex key (WEP only) to log on.
    Write back with more details if you can't connect. BTW, here's some info on WiFi on the touch: http://support.apple.com/kb/TS1398

  • CSM 3.1, problem with adding a new firewall context

    Hi,
    when trying to add and deploy a new firewall context I get this error message " Please create the interface roles on devices".
    Could you please advice me on this issue?
    Thank you,
    Trond

    You probably need to go under the system context and create the interface and also allocate vlans to it in CSM before you configure the context itself.
    I hope it helps.
    PK

  • Add a new Row to a table in HCM forms and Processes

    Dear All,
    I am haunted with the problem of adding a new line to a table on clicking a "ADD new Line" button on the Adobe form, how can this be achieved.
    What I have done
    I have created the table and followed the instruction of OSS note 1043692, i have kept a 1 initial line. Though this adds a line everytime I click on add new line as I have maintained 1 initial line, but this creates a problem in next stage of approval as it shows an extra line(because of the 1 initial line maintained).
    Anybody has any other logic of adding a new line to a tabular display in HCM P&F(Infotype 0014)
    Note : I have tried all ways of adding extra lines through Javascript, though it adds lines, it is not captured. So  I have dropped the idea of javascript.

    Did you resolve this?

  • Problem with adding Sun JSF RI v1.2 as a new library in JDeveloper 10.1.3.1

    Hi,
    I have a problem with adding a latest JSF 1.2 RI from Sun (https://javaserverfaces.dev.java.net/files/documents/1866/44998/jsf-1_2_03.zip) to JDeveloper as a new library.
    I created a new User library and added into it jsf-impl.jar and jsf-api.jar from JSF 1.2 RI.
    Then I try to create two new JSP Tag libraries based from .tld files.
    When a .tld file is placed in "TLD File:" field there is no information below about Library Version and Required JSP Version. If I check "Execute Tags in JSP Visual Editor" and click "Customize" button - list of tags in "Customize Tag Library" window is empty.
    I have errors when I try to use JSF Tags from this new library in JSP page like :
    "Can't create tag instance: f:view (class: null). Make sure, that the tag class or a library contained this class is available in this application"
    (free translation to English)
    Is this possible to add JSF RI v1.2 as another library in Jdeveloper 10.1.3.1 ?
    thanks for help
    koli

    Hi,
    This solution is not exactly for Jdeveloper 10.1.3.x I think.
    - "Create a JSF system library." section, point 2. - there is not possible to add library in folder other than User I see, so I added it in User folder.
    - "Register the JSF JSP tag libraries." section, point 5. - in JD 10.1.3 there is no dialog box, I checked checkbox "Show Tag Library in Palette". A new library was added to User folder but there is no new libraries in component Palette.
    Even as I use "Edit tag libraries .." from Component Palette context menu and add manually new tag libraries to selected, there is no libraries in Component Palette after it.
    I feel so problem is with different .tld files format, not with adding libraries method.
    Sun RI tld file (from version 1.2_03) fragment:
    <taglib xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
    version="2.1">
    <!-- ========== Tag Library Description Elements ========================= -->
    <description>
    The core JavaServer Faces custom actions that are independent of
    any particular RenderKit.
    </description>
    <tlib-version>1.2</tlib-version>
    <short-name>f</short-name>
    <uri>http://java.sun.com/jsf/core</uri>
    tld included in JD:
    <!DOCTYPE taglib
    PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
    "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
    <taglib>
    <!-- ========== Tag Library Description Elements ========================= -->
    <tlib-version>1.0</tlib-version>
    <jsp-version>1.2</jsp-version>
    <short-name>f</short-name>
    <uri>http://java.sun.com/jsf/core</uri>
    <description>
    The core JavaServer Faces custom actions that are independent of
    any particular RenderKit.
    </description>
    Did JDeveloper 10.1.3.x maintain with taglib version 1.2 ?
    Regards
    koli

  • Problem with adding new field to the mass change screen in FBL5N

    Hi,
    We have a problem with adding the field XREF3 to the mass change screen. We followed steps described in the SAP Note 640908, but the result is that when we try to mass change some documents in FBL5N and enter some values in the mass change screen, a message appears: "Please enter at least one new value" and nothing is changed.
    If you have faced with such a problem, we would be grateful if you give us some tips.
    Regards,
    Miłosz Włodarczyk

    The problem has been resolved: we didn't activate a code in SE80.

  • How do you set the number of rows in a spreadsheet, so that even when you drag data in, in writes over those rows instead of adding a new row?

    How do you set the number of rows you want in a spreadsheet, so that even when you drag data in, in writes over those rows instead of adding a new row?

    After the discovery reported above, I filed this report :
    Bug ID# 10073038
    Summary:
    When Numbers is used on a system with decimal comma a csv file may be good AND wrong
    Steps to Reproduce:
    With Numbers v2, you introduced an interesting enhancement.
    In system using the comma as decimal separator, Numbers requires csv files using the semi-colon as values delimiter.
    In fact it’s true if we OPEN the document dragging its icon on Numbers one or thru the open dialog.
    This said.
    (1) Drag and drop a csv built with the 'semi-colon' standard on a table or on a sheet
    (2) Drag and drop a csv built with the 'comma' standard on a table or on a sheet
    Expected Results:
    Every normally constituted user assume that in
    case (1) he will get a perfectly built table
    case (2) he will get every cells of a row in a single cell
    Actual Results:
    In fact you forgot the drag and drop way of use and in
    case (1) every values separated by semi-colon are inserted in a single cell
    case (2) values separated by comma are correctly spread in a table
    isn’t it ridiculous ?
    Regression:
    Except looking in  QuickView to see which is exactly the structure of the file to decide the way we will insert it in a Numbers document, we may use an applescript fair enough to replace the semi-colons by TAB characters
    or
    to replace the commas by TABs and the decimal periods by commas
    Notes:
    While I am on this subject, I wish to make two proposals:
    (1)  It would be fine to format the date according to the ISO format year-mm-dd when you export a Numbers doc to csv.
    Doing that, dates would be imported correctly in every countries.
    At this time, on an English system, you export as mm/dd/year.
    If the doc is open on a system using the format dd/mm/year, the results will be odd.
    On a system using the format dd/mm/year, you export this way and so, if the doc is open on a system using the format mm/dd/year the results are odd too.
    As every localized versions accept the ISO format (at least on entry), using it in the export scheme would give a correct behavior everywhere.
    (2) It would be fine to add the format Tab Separated Values in the Export pane.
    TSV + ISO date format would give documents opening flawlessly everywhere.
    Yvan KOENIG (VALLAURIS, France) dimanche 4 septembre 2011 21:27:41
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community

  • Problems with adding Library for a MySQL JDBC driver

    Good day,
    I am new with the JDeveloper package, so the following could be a user fault.
    I found the following:
    - I downloaded and installed Oracle JDeveloper 10.1.2.1.10 (latest version).
    - I downloaded the latest JDBC drivers for MySQL. ( mysql-connector-java-3.1.10 )
    Now, I did the following steps extracted from the link http://www.oracle.com/technology/products/jdev/tips/duff/mysql_and_oc4j3.html it should be quite easy to add the JDBC Drivers to the project.
    I did the steps with the following results:
    When I Edit the Project properties, follow Profiles -> Development -> Libraries
    When I do ' New' , fill in at JS2E the value 'MySQL' and fill in the Class Path (in my case 'C:\javaInstalls\mysql-connector-java-3.1.10\mysql-connector-java-3.1.10-bin.jar').
    In that case the [OK] is disabled. I should expect the [OK] button was enabled!
    My question: Is this a bug? When not, what am I doing wrong!
    Regards,
    Mike

    I tried it on an other system and had no problems with adding the libraries. It still is a problem on that particular system using the Dutch version of XP. The problem is that the Ok button stays disabled !
    Could it bw a version problem with Java? How ever no changes are made to the original configuration, so it should pick up as default the java version of JDeveloper self.

Maybe you are looking for

  • Purchase Requsition is not closing automatically During ME59 PO creation

    Hi, We are using PO creation through ME59, In ME59 we have set the indicator 1 Set reqs. to "closed" In PR we have 1 qty and in PO was created for 1 qty. But the PR was not closed. When we check the F1 help for the filed it say it will work with resp

  • Runtime error r6034 when try to open itunes

    How do I fix runtime error r6034?

  • How to access class variables in anonymous class??.

    I have a boolean class level variable. Fom a button action , this boolean will set to true and then it used in anonymous class. In anonymous class, I am getting default value instead of true. Could u anyone help in this plzzz.

  • Servlet filter in portal irj?

    Hi, I am trying to create and deploy a servlet filter in portal irj. Here is what I have done: 1. Created filter class(TestFilter.java). 2. Created a jar file for the above TestFilter.class. 3. Copied the jar file to C:\usr\sap\DW1\JC00\j2ee\cluster\

  • OC4J CLassloading Information

    gday All -- Classloading questions are quite common on this forum. It's a complicated area and each container will more than likely have slightly different nuances in how it works. We have a very good technical paper which explains general classloadi