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

Similar Messages

  • 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;

  • 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 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);

  • 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?

  • 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

  • How to set a default value in an ADF table when adding a new row

    Hi Guys,
    I have a view object which I am using to create an ADF table. I also have a button which uses a CreateInsert binding to add a new row to the table. I have four fields: created_by, creation_date, last_update_by and last_update_date.
    I want these values to be set automatically when I click add new row.
    The values I want are:
    created_by - admin
    creation_date - sysdate
    last_update_by - admin
    lsat_update_date - sysdate
    Any suggestions on how to do this would be appreciated
    Thanks
    -Mark

    mark,
    Those four fields can be set completely declaratively in the Entity Object (check out the History Colum feature). Copied from the (11g) documentation:
    If you need to keep track of historical information in your entity object, such as when an entity was created or modified and by whom, or the number of times the entity has been modified, you specify an attribute with the History Column option selected (in the Edit Attribute dialog).
    If an attribute's data type is Number, String, or Date, and if it is not part of the primary key, then you can enable this property to have your entity automatically maintain the attribute's value for historical auditing. How the framework handles the attribute depends which type of history attribute you indicate:
    * Created On: This attribute is populated with the time stamp of when the row was created. The time stamp is obtained from the database.
    * Created By: The attribute is populated with the name of the user who created the row. The user name is obtained using the getUserPrincipalName() method on the Session object.
    * Modified On: This attribute is populated with the time stamp whenever the row is updated/created.
    * Modified By: This attribute is populated with the name of the user who creates or updates the row.
    * Version Number: This attribute is populated with a long value that is incremented whenever a row is created or updated.
    John

  • Problem in adding the new column in VO : ADF

    Hi,
    I am using jdev 10.1.3.2 with ADF.
    I added a new column in a table in the database. In my ADF application, I right clicked on the entity object of the changed table, and selected ‘Synchronize with DB’ which added the new column in the entity object also.
    I had a jsp which uses this view object’s (VO). I had to change the VO also to add this new column.
    After all this, in the jsp page, I dragged and dropped this new column as an input text field.
    But while running this page, the field is empty. Also when I drag and drop it, this field doesn’t have the ‘id’ attribute.
    Below is the code. Please let me know how I can fix this issue.
    <af:inputText value="#{bindings.RebillNumber.inputValue}"
    label="#{bindings.RebillNumber.label}"
    required="#{bindings.RebillNumber.mandatory}"
    columns="#{bindings.RebillNumber.displayWidth}">
    <af:validator binding="#{bindings.RebillNumber.validator}"/>
    </af:inputText>
    Thanks,
    Venki

    Hi Venki,
    Please check if the object on the page is bound to the same iterator as the other components. Sometimes dragging and dropping new attributes makes JDev create a new iterator, and the two iterators will not be in sync.
    You can check this in the pageDef file and correct any strange things you may find.
    Jeroen van Veldhuizen

  • Creation of new Row in Tree Table

    We are creating a new row using CreateListener which is written in Bean, after creating the row, we are adding it to the iterator and the new row is not getting highlighted and focus is not in new row in the table by default. It takes an click to make it editable. 'setActiveRowKey()' method didnot help here which is used in the af:table component to achieve the same.
    Any pointers regarding this issue would be helpful..
    Thanks,
    Shruthi

    Hi Max:
    According to what you described, it's really wierd. An ADF table is Surrounded by a panelCollection or not doesn't matter in terms of CreateInsert operations, I think. Also each step you said OK doesn't mean that step is 100% problem free towards your final goal. For example, when you drag and drop and ADF table onto a JSF page, you forget to turn on 'row selection', it will be OK, you won't get any error message, but later on when you find that you need to turn it back on, you have to go back to JSF page source, to manually added codes to do so.
    The simpliest solution and quickest one is to reinitiate a clean ADF project and do it all over again. It's simple straightforward in my view. Probably don't use PanelCollection first, just drop your ADF table on a form, or af:panelForm, but make sure your table and 'CreateInsert' button is surrounded by a form, otherwise, when you click on 'CreateInsert', nothing will happen. When everything works, then probably back it up and replace your form or af:panelForm with panelCollection. See how it goes.
    Thanks,
    Alex

  • New Row in a Table View

    Hi,
    I need to add a new row to a table without using any NEW button. The first column in my table is a drop down . Whenever user selects a value in drop down a new row should be created .
    Also am not able to see drop down options throughout my tableview , Only for created rows am able to see drop downs. How do i activate that ?
    Plz help me....
    Regards,
    Divya

    HI
    GOOD
    go through this link,hope this ll help you to solve your problem
    http://help.sap.com/saphelp_nw2004s/helpdata/en/28/4bae407e69bc4ee10000000a1550b0/content.htm
    thanks
    mrutyun^

  • How to add new row to adf table progrmatically

    Hi,
    I have a bean with a list and correspoding getter & setter methods inside it.
    I created a datacontrol out of the bean and I am displaying af:table in the ui
    binded to this list.
    Ex:
    public class StudentBean {
    private List<Student> students;
    // getter & setter methods.
    jsp
    <af:table value="#{bindings.students.collectionModel}" var="row"
    rows="#{bindings.students.rangeSize}"
    emptyText="#{bindings.students.viewable ? 'No data to display.' : 'Access Denied.'}"
    fetchSize="#{bindings.students.rangeSize}"
    rowBandingInterval="0"/>
    How to add a new row programitically to this adf table.
    I dragged and dropped 'Create' from operations menu on to jsp.
    But on click of that.no new row is being added to the current table.
    On click of a button in u.i I want to add a new row to the table.
    Thanks,
    Praveen

    Hi,
    The source code is as below.
    <af:table value="#{bindings.students.collectionModel}" var="row"
    rows="#{bindings.students.rangeSize}"
    emptyText="#{bindings.students.viewable ? 'No data to display.' : 'Access Denied.'}"
    fetchSize="#{bindings.students.rangeSize}"
    rowBandingInterval="0"
    filterModel="#{bindings.rscGroupsQuery.queryDescriptor}"
    queryListener="#{bindings.rscGroupsQuery.processQuery}"
    filterVisible="true" varStatus="vs"
    selectedRowKeys="#{bindings.rscGroups.collectionModel.selectedRow}"
    selectionListener="#{bindings.rscGroups.collectionModel.makeCurrent}"
    rowSelection="single" id="t1"/>
    <af:commandButton actionListener="#{bindings.Create.execute}"
    text="Create" disabled="#{!bindings.Create.enabled}"
    id="cb1" partialTriggers="t1"/>
    Please let me know where am I doing wrong?
    On click of this button,it is not adding a row dynamically.
    Thanks,
    Praveen

  • Focusing a field/column in the new row of adf table

    Hi all,
         I am using JDeveloper 11.1.2.4.0. and UI-Shell Template in Main application and sub applications are added to this master application as ADF library jar files. Application is working fine.
    I am trying to focus to make focus on a column in the newly created row in one of the sub application by referring the below link
    http://adfnbpel.wordpress.com/2013/08/14/focusing-a-fieldcolumn-in-the-new-row-of-adf-table/
    I created a single application and found that its working
    But in my application focus is not working.
    When i checked the java script by using FireBug console it is found that comp = AdfPage.PAGE.findComponent(‘”+inputId+”‘); is getting as "undefined" , where inputId = table.getClientId(facesCtx) + “:” + rowId + “:” + “it3″; I am getting the exact row id also. When i tried with by passing the table id as input id like inputId = table.getClientId(facesCtx) ; the fire bug console then showing the table id. So its sound strange.
    What may be the cause of not able to find the input text it3 by using findComponent ?
    Is any body can suggest a solution for this.
    Thanks in advance,
    Gijith

    Hi,
    read up about "findComponentByAbsoluteLocator" in http://www.oracle.com/technetwork/developer-tools/jdev/1-2011-javascript-302460.pdf
    or check ...
    AdfPage JS doc
    Frank

  • Addig a new row in a table in Ess/cats

    Hello all,
    I am working on Ess/cats application.
    By default it is displying me 8 rows.I have to put a button to add a new row in the table.
    but i could not find a way to add a new row.
    Thanks and Regards.
    Punit Pawar

    Hi,
    In the onAction of button Add one more element in node which is bounded to the table. You can use following code.
    public void onActionAddRow(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionAddRow(ServerEvent)
           IWDNodeElement element = wdContext.node<Node_Name>().create<Node_Name>Element();" Here Node_Name is the name of node which is bounded to your table.
           wdContext.node<Node_Name>().addElement(element);
        //@@end
    I hope it helps.
    Regards,
    Rohit

  • Create a new row in a table without using add new row button

    I want to add a new row to the table without using the add new row button of the table. I'm not able to display default row in the table. Though if click on apply the record appears after saving in the database. Any thoughts how to implement this functionality.

    Here is what you have to do.
    1) You have to handle this in processRequest()
    2) In the AM code , u need to check if there is already a row exisit or vo is blank
    if (vo.getFetchedRowCount() == 0)
    // first time
    vo.setMaxFetchSize(0); // THIS IS REQUIRED.
    Row row = vo.createRow();
    vo.insertRow(row);
    row.setNewRowState(Row.STATUS_INITIALIZED);
    else
    //If already rows are there then you suppose to insert in the end
    // i assume you would have execute your vo
    YourVORowImpl row= (YourVORowImpl)vo.getRowAtRangeIndex(0);
    vo2.insertRowAtRangeIndex();
    It should work.

  • Add new row to a table

    Hello!
    I'm using JDev 11.2 and I'm trying to add a new row to a table object (using create insert)
    the catch is this-
    and the new empty row that will appear- I want a value set instead of one of the values- so the user can choose which value to insert
    do you know how can this be done?
    (just to be clear- i know how to add a value set, I know how to add new row- dont know how to make the new row contain value set field)
    tnx for your time
    Talya

    If you use a model driven list of value on the attribute in question this should work automatically.
    Have you setup a LOV on the attribute? Have you (on the attribute) checked that the ui-hint is set to selectOneChoice?
    Timo

Maybe you are looking for