How to Create multiple rows in Rich table programatically

Hello ADF Exparts.
I am Using below Code to create Rich Table Programatically on Clicking a button but I can't able to Create multiple tables will you please help me to create new row programatically
public class NewTable {
    private RichInputText txtSearching;
    private RichShowDetailItem resultTab;
    private RichShowDetailItem simpleSearchTab;
    private RichColumn firstColumn;
    private RichOutputText outPutText;
    private String searchString;
    AdfFacesContext ctx=AdfFacesContext.getCurrentInstance();
    Connection conn;
    RichTable table;
    Statement stmt;
    private RichShowDetailItem basicSearchTab;
    private RichTable basicResultTable;
    private RichPanelGroupLayout panelGL;
    public NewTable() {
    public String buttonClicked() {
        // Add event code here...
        //Starrt Creating Table
        table =new RichTable();
        table.setId("demo");
        table.setVisible(true);
        table.setWidth("1024px");
        table.setValue("mat_search");
        table.setVar("Search");
        table.setFilterVisible(true);
        table.setAllDetailsEnabled(true);
        table.setRowKey("0");
        table.setFetchSize(25);
        table.setRows(10);
        table.setRowBandingInterval(0);
        table.setRowSelection("single");
       // table.setHorizontalGridVisible(false);
        //table.setVerticalGridVisible(false);      
        //Start Table Header Text Declaretion and Assignment
        RichOutputText colTextMat_No = new RichOutputText(); 
        colTextMat_No.setValue("Material No ");
        RichOutputText colTextShotDes = new RichOutputText(); 
        colTextShotDes.setValue("Short Description");
        RichOutputText colTextLongDes = new RichOutputText(); 
        colTextLongDes.setValue("Long Description");
        //Start Table Columan Creatin
        RichColumn colMat_No = new RichColumn(); 
        colMat_No.setVisible(true);
        colMat_No.setHeader(colTextMat_No);
        colMat_No.setWidth("100px");  
        colMat_No.setSortProperty("Material No");
        colMat_No.setSortable(true);
        colMat_No.setFilterable(true);
        colMat_No.setSeparateRows(true);
        RichColumn colShotDes = new RichColumn(); 
        colShotDes .setVisible(true);
        colShotDes .setHeader(colTextShotDes);
        colShotDes.setWidth("500px");
        colShotDes.setSortProperty("Short Description");
        colShotDes.setSortable(true);
        colShotDes.setFilterable(true);
        colShotDes.setSeparateRows(true);
        RichColumn colLongDes = new RichColumn(); 
        colLongDes .setVisible(true);
        colLongDes .setHeader(colTextLongDes);
        colLongDes.setWidth("500px");
        colLongDes.setFilterable(true);
        colLongDes.setSeparateRows(true);
        //End Table Columan Creatin
        //Start Creating table Children
        List<UIComponent> tblChild;
        tblChild=table.getChildren();
        //Start adding Columan to Table
        tblChild.add(colMat_No);
        tblChild.add(colShotDes);
        tblChild.add(colLongDes);
       List<UIComponent> displayPanel;
       displayPanel=panelGL.getChildren();
        List<UIComponent> matChild;
        matChild=colMat_No.getChildren();
        RichOutputText rot=new RichOutputText();
        rot.setValue("15000");
        matChild.add(rot);
       displayPanel.add(table);
         System.out.println("RowIndex="+table.getRowIndex());
         System.out.println("Row Count="+table.getRowCount());
        return null;
Thank you very much

Maybe you can get some ideas from here -
http://adfdeveloper.blogspot.com/2011/07/simple-implementation-of-af.html

Similar Messages

  • How to delete multiple rows from ADF table

    How to delete multiple rows from ADF table

    Hi,
    best practices when deleting multiple rows is to do this on the business service, not the view layer for performance reasons. When you selected the rows to delete and press submit, then in a managed bean you access thetable instance (put a reference to a managed bean from the table "binding" property") and call getSeletedRowKeys. In JDeveloper 11g, ADF Faces returns the RowKeySet as a Set of List, where each list conatins the server side row key (e.g. oracle.jbo.Key) if you use ADF BC. Then you create a List (ArrayList) with this keys in it and call a method exposed on the business service (through a method activity in ADF) and pass the list as an argument. On the server side you then access the View Object that holds the data and find the row to delte by the keys in the list
    Example 134 here: http://blogs.oracle.com/smuenchadf/examples/#134 provides you with the code
    Frank

  • How to create multiple rows in a child table from the multi select Lov

    Hi
    We have Departments and EmployDept and Persons tables and each employee can associate multiple departments and vice versa.While creating a Department page there should be a Multi Select LOV(values from Persons table) with search option for the Persons.From the search panel we can select multiple persons for that department.Suppose we have selected 5 persons and click on submit, then it should create 5 rows in the EmployDept table for 5 persons with that department id.
    Any inputs on how to implement this scenario please..

    Maybe you can get some ideas from here -
    http://adfdeveloper.blogspot.com/2011/07/simple-implementation-of-af.html

  • How to insert multiple rows in same table at once

    hi ,
    How can I insert more than one row in the same database table on single submit button.
    (i am using the ADF , EJB and Toplink for this example.)
    EMPLOYEEand DEPARTMENT tables will hold a common coloum deptno
    The method I have tried is as follows.
    I have created the UI that holds EMPLOYEE(DETAIL) details and a DEPARTMENT(MASTER) table and I have created two separate bean classes which hold the getters and setters for the corresponding tables.
    I have created a method in Department bean which will be called when we add the employee details
    public String addEmpdetails() {
    this.employeedetailslist.add(empdetails);
    return null;
    where employeedetailslist is a Arraylist and I want to pass the reference of employeebean in the array list.
    But this method will fail as I need to create the new employee bean object every time when ever I need to pass.
    How can I store values of multiple rows in bean.
    In the EJB session bean how can I commit multiple EMPLOYEE rows and DEPARTMENT values at once.

    The use of &variable in a script is actually syntax for a "substitution variable" in the SQL*Plus tool (other tools may also do the same), not an inherent part of SQL or PL/SQL itself.
    Whenever SQL*Plus is given a script it parses through it and if it encounters one of these it prompts for a value. This value is then substituted into the script before the script actually get's sent to the SQL or PL/SQL engine (process) on the database server. Once the script has gone to the database server it executes there and the results are passed back for SQL*Plus to display. However, the SQL and PL/SQL processes on the database server have no way to interface to the client machine, so they themselves cannot prompt for input from the client and you can't expect to prompt inside a loop as you are doing.
    What you need is a user interface on the client that can prompt repeatedly for values and then re-send the script, or call a procedure on the database each time. This can be done using shell scripts or dos batch files (depending on your client being unix/dos based) or using a front end application tool such as Java, .NET, Powerbuilder, PHP, Application Express (APEX) etc.

  • How to get multiple rows from database table?

    hello !
    I need to get multiple rows from a OLEDB database table and display them on a table object.
    I did "Wrap in subfrom" on the table,  set  subform of the table to "flowed", and checked "Repeat row for each data item" of Row1 of the table.
    But I can get only one row on the table object.
    I need your help.
    Thanks

    Hi,
    best practices when deleting multiple rows is to do this on the business service, not the view layer for performance reasons. When you selected the rows to delete and press submit, then in a managed bean you access thetable instance (put a reference to a managed bean from the table "binding" property") and call getSeletedRowKeys. In JDeveloper 11g, ADF Faces returns the RowKeySet as a Set of List, where each list conatins the server side row key (e.g. oracle.jbo.Key) if you use ADF BC. Then you create a List (ArrayList) with this keys in it and call a method exposed on the business service (through a method activity in ADF) and pass the list as an argument. On the server side you then access the View Object that holds the data and find the row to delte by the keys in the list
    Example 134 here: http://blogs.oracle.com/smuenchadf/examples/#134 provides you with the code
    Frank

  • How to create a Row in a table in SMARTFORMS

    Dear All,
    I'm working with SAP 4.6C.
    I have created a table under the Main Window. After that I have activated the Heade and Footer Check Box in the EVENT TAB of the TABLE. But, Main Area option is not there.
    Because of that it is displaying the TABLE Node like
    TABLE
       Header
       Footer
    Not Like
    TABLE
       Header
       Main Area
       Footer
    Under the Header I want to create a row. After creating  the row only I can create the cells.
    I have defined the line type as %LTYPE1. Even though it is not dispalying the ROW under Header
    It should display
    TABLE
       Header
          Row
             Cell1
                 Text1
             Cell2
                 Text2
       Main Area
       Footer
    But, it is not displaying the ROW after creating the line type .
    How to overcome this problem...
    <<Text removed by moderator>>
    Regards,
    Bhaskar
    Edited by: Matt on Feb 28, 2009 7:02 PM - Please do not offer rewards or points

    Hello,
    u have posted this question 2 times
    When you work on a table node in your form, the node is marked with the table icon . In the
    maintenance frame, you get a new type of tab, the Table tab. See below.
    On this tab, you can define the table characteristics, and turn on the Table Painter to help lay out
    the rows and columns. Turn on the Table Painter by choosing-> Table Painter.
    May this link helps u
    http://www.scribd.com/doc/7375795/Smart-Form
    Thank u,
    santhosh

  • How to create dublicate row in af:table ?

    Hi All,
    In my use case i have to add one custom button name as duplicate just above of af:table where user have option to click that button to create a row in table which contains duplicate value of the current row.
    How would i achieved this scenario
    Please let me know
    Thanks
    Edited by: ADFORCLE on Jan 16, 2012 6:48 PM

    Take a look at the blog post which provides the solution for the use-case:
    http://www.adftips.com/2010/10/adf-model-creating-duplicate-row.html
    Thanks,
    Navaneeth

  • How to create multiple rows (manual) in jdeveloper (ADF) 11.1.1.1.0 ?

    Hi,
    I want create a multiple rows in detail section(data grid) for manual entries.
    can you give me an example regarding this?

    Is it just me, or is this question basically incomprehensible?
    I want to create multiple rowsthat I can parse
    in detail sectiondon't have a clue what that is
    (data grid)don't know what that is, either - are you talking about some specific component?
    for manual entriesI'm guessing that when you get the multiple rows created "in detail section (data grid)" that a user will be able to key in the values. Is that correct?
    Sorry to pick on you, but your question is so vague as to defy anyone being able to help.
    Best,
    John

  • How to delete multiple rows in a table of web dynpro for abap?

    hi,
    Experts ,
    I want to delete the selected multiple records from a table from that i have inserted a check box ui element in a first column of a table what ever checkbox ix checked i want to delete those selected records from table .
    please suggest me on
    Thanks in advance

    Hi,
    If you have DELETE button, in that action you write this code -
    DATA lr_node type ref to if_wd_context_node.
    lt_set  = lr_node->get_elements( ).
    loop at lt_set into ls_set.
    ls_set->get_staitc_attributes
    importing
    static_attirbutes = ls_row.
    if ls_row-check = 'X'.
    lr_node->remove_element( ).
    endif.
    endloop.
    Check the methods and thier types.
    Regards,
    Lekha.

  • How to create multiple rows in  HFR-- need help urgent

    I want to create a row template in HFR, there are almost 500 members in rows and we already have them listed in an excel sheet in rows. They are not under a particular hierarchy so cannot choose the relationship functions ( like idesc or children and all). Is there a way we can copy paste it some way in HFR from excel or do we need to pick every member in HFR separately.
    Please help.

    Firstly format the members in excel such that they end with a comma, then "Copy" and "Transpose" paste these on a new cell in excel.
    Copy the transposed line and paste in financial reporting studio in the formulae bar & click save.

  • Question: How to dynamically create multiple rows in a table together

    I'm sure this is obvious to a seasoned person but I'm a newbie (just working with Forms for 1 week).
    In the snapshot below I'm trying when I hit the Add button I'd like the two rows below the header in the table to replicate themselves below in the table.
    Eventually there will be many rows to replicate. The problem is that I can't find a way to group these and then reference them by the javascript in the "add button" so that they replicate together.
    any help/pointers etc. are much appreciated.
    Thx

    You can only add 1 row at a time .....so if you want to add three rows then you would have to run the command three times.
    Make sense?
    Paul

  • How to create dynamic rows in a table

    Hi All,
    in my application i want to create rows dynamically by pressing enter button or else i can use button,once i click the button new row should come,that row should allow to enter values,like input field.
    please can any one help me in this.
    regards,
    sush

    Hi Sushma,
    If i'm right ,u want to add a new row on button...
    for(int i=0; i<1;i++)
    IPrivateContractOverView.I<table Node>Element elem=wdContext.create<table node>Element();
      elem.set<table value attrbute1>("");
    elem.set<table value attrbute2>("");
    wdContext.node<table Node>.addElement(elem);
    Here you  can set any default values in place of "".
    hope it hlps u..
    Regards
    Khushboo

  • Problem to create multiple rows in adf table.

    Hi All,
    i am using jdev version 11.1.1.5.0. i have facing very strange problem to create row on table.
    In my use case i have create row on table under loop statement. so no of rows created based on loop condition. each time on loop we supply diffrenet value for column like subpkgid,sno but row created with same value.
    code is following-
        public void createRowOptHdr()
                  boolean flag=false;
                ViewObject reqhdrvo= getService().getView("StmReqhdrView1Iterator");
               Row reqhdrrow= reqhdrvo.getCurrentRow();
                ViewObject pkglist= getService().getView("PkgListOptHdr1Iterator");         
               ViewObject tskcdvo= getService().getView("GetTskSubtskCd1Iterator");
                System.out.println("Subtype===>"+reqhdrrow.getAttribute("Subtype"));          
                tskcdvo.setNamedWhereClauseParam("stype",reqhdrrow.getAttribute("Subtype"));
                Row tskrow=tskcdvo.first();
                int count =pkglist.getRowCount();
                ViewObject opthdr= getService().getView("StmOpthdrView2Iterator");
                           opthdr.executeQuery();
                Row optrow=null;
                Row pkgrow=null;
                for(int i=1;i<=count;i++)
                    if(i==1)
                    pkgrow=pkglist.first();
                    else
                        pkgrow=pkglist.next();
                    if(pkgrow.getAttribute("Mark")!=null)
                 flag=(Boolean)pkgrow.getAttribute("Mark");
                    else
                        flag=false;
                    if(flag)
                        optrow = opthdr.createRow();  
            optrow.setAttribute("Reqdt",reqhdrrow.getAttribute("Reqdt"));
            System.out.println("Pkg Id====>"+pkgrow.getAttribute("Id"));
            String id=(String)pkgrow.getAttribute("Id");
            System.out.println("id val==>"+id);
            optrow.setAttribute("Pkgid",reqhdrrow.getAttribute("V_Pkgid"));
            optrow.setAttribute("Subid",id);
            optrow.setAttribute("Sno",opthdr.getRowCount());
            optrow.setAttribute("ReqStatus","WAIT");
            optrow.setAttribute("LHier",reqhdrrow.getAttribute("LHier"));
            optrow.setAttribute("Subtype",reqhdrrow.getAttribute("Lanweb"));
            optrow.setAttribute("Divn",reqhdrrow.getAttribute("Divn"));
            optrow.setAttribute("Status","Y");
            optrow.setAttribute("TaskCd",tskrow.getAttribute("TaskCd"));
            optrow.setAttribute("SubtaskCd",tskrow.getAttribute("SubtaskCd"));
            opthdr.insertRow(optrow);
            try
            optrow.validate();
            catch(Exception e)
                System.out.println("Error to validate opt hdr row===>"+e);
            //opthdr.executeQuery();
                } i have called this method on a button click so no of row selected on pkglist vo same no of row created. and these row are different pkgid but when i again select some row from pkglist and click on button thease row created with same sno ,subpkgid as first row.

    Have you used the debugger and dropped through the code?
    Have you checked that opthdr.getRowCount() returns a different value each time?
    Using the method isn't optimal as it will iterate over the towards each time. Next you'll get duplicate numbers if more then one user works with the application and end up clicking the button. You should use a sequence for this.
    Timo

  • Inserting multiple rows in child table

    i have two entity beans (main and child) with relationship one to many .... when i insert one row in main table (ie when i make one object for main entity bean)... how to insert multiple rows in child table...

    Can anyone pls provide some sample code for the above.. how to pass a collection and populate it in the child table.
    1.Where to pass the collection, to the childbean directly or to the parent bean and then itereate to the collectio and create child bean.
    Much obliged if you could paste some code for the above..

  • Selecting multiple rows of a table

    Hi Forum,
    How to select multiple rows of a table at a time? Please help me..
    Thanks
    Swapna

    Hi Swapna,
    To select more then one row in table, just set the selectionmode property of table to 'multi' or 'auto' and also change the selection property of the node (to which table is binded) to  0:n.
    I hope it helps.
    Regards
    Arjun
    Edited by: Arjun on Feb 4, 2009 11:52 AM

Maybe you are looking for

  • SAP BW Bex 7.3 Queries not working with Enterprise Portal (EP) 7.3 ABAP stack only

    SAP BW Bex 7.3 Queries not working with Enterprise Portal (EP) 7.3 ABAP Stack Dear Portal Gurus, we want to integrate SAP BW Bex Queries 7.3 into an Enterprise Portal 7.3 EP ABAP Stack only installation. 1) We have Done SSO between EP And BI System 2

  • Change the status in a ALV

    Hi!  I call a ALV in a subscreen, in the catalog there are 2 check box in edit mode, so the default status gui is diferent if I call it with no editable fields, I want to set the status in read mode, there's any way? Thanks, Luis

  • Button works in cp version, but not in swf

    I created a click button to take the user to a url in the last slide on my film.  The click works in the preview, but it does not work after I've published as an swf.  What could be the issue?

  • When sending a PDF, firefox sends a text / html

    When sending a PDF, firefox sends a text / html. They cant open the PDF there I send

  • Database name is missing a component....

    I'm doing a 3 server install on Windows 2000 Professional. While installing the infrastructure, while it tries to create the database I get the warning "database name is missing a component". I'm never asked to enter a database name, so I'm not sure