Create ADF Table at runtime

Hi,
I am trying to create ADF table at run time. Initially I tried to include all the tables at design time. Then I turned the setVisible property to false. Then , based on the condition, I turned it to true at runTime, so that to give the effect of the table getting created at run time.
But now, I would like to know , is there any option to extract the table component from the ViewObject or from the iterator, at run time.
say,
I have my ViewObject like this.
DCIteratorBinding dcIter=(DCIteratorBinding)bindings.getControlBinding("Table1View1Iterator");
ViewObject vo=dcIter.getViewObject();
Now, I have a panel, 'pb1'. I am able to add input boxes at run time. Now I want to add the table that corresponds to the above View also at run time.
Could someone pls give me the suggestion..
Thanks,
Sabarisri. N

well, in that case you can create table dynamically from managed bean. I am giving you a sample code which add row dynamically to a table on click of "Add" button.
jspx code:
<af:document id="d1" title="XXXX">
      <af:form id="f1">
        <af:commandButton text="Add" id="cb1" action="#{MyBean.add}"/>
        <af:table varStatus="rowStat" summary="table"
                  value="#{MyBean.collectionModel}"
                  rows="#{MyBean.collectionModel.rowCount}"
                  rowSelection="none" contentDelivery="immediate" var="row"
                  rendered="true" id="t1">
          <af:forEach items="#{MyBean.columnNames}"
                      var="name">
            <af:column sortable="true" sortProperty="#{name}"
                       rowHeader="unstyled" headerText="#{name}"
                       inlineStyle="width:100px;" id="c1">
              <af:activeOutputText value="#{row[name]}" id="aot1"/>
            </af:column>
          </af:forEach>
        </af:table>
      </af:form>
    </af:document>managed bean:
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.myfaces.trinidad.model.CollectionModel;
import org.apache.myfaces.trinidad.model.SortableModel;
public class MyBean {
    private SortableModel model;
    private List<String> columnNames;
    public MyBean() {
        System.out.println("Cntl in MyBean constructor :::");
        columnNames = new ArrayList<String>();
        columnNames.add("Col-1");
        columnNames.add("Col-2");
//        generateColumnModel();
    public void generateColumnModel() {
        this.model = new SortableModel(createRows(columnNames));
    private static List<Map> createRows(List<String> columnNames) {
        int i = 0;
        List<Map> mapListforRows = new ArrayList<Map>();
        //for (String name : columnNames) {
            Map newRow = new HashMap();
            mapListforRows.add(newRow);
            for (String col : columnNames) {
                newRow.put(col, "data");
        return mapListforRows;
    public String add() {
        System.out.println("Cntl in add method :::");
//        columnNames = new ArrayList<String>();
//        columnNames.add("Col-1");
//        columnNames.add("Col-2");
        generateColumnModel();
        return null;
    public CollectionModel getCollectionModel() {
        return model;
    public void setColumnNames(List<String> columnNames) {
        this.columnNames = columnNames;
    public List<String> getColumnNames() {
        return columnNames;
}I hope this will help you to solve your use case
~Abhijit

Similar Messages

  • Not Able to create ADF Table In the Multiple model enviorment

    Hi All
    I am not able to create ADF Table or ADF Read-only Table
    I am having following thinks in my JWS Project
    2, Model Project(Different different name)
    2,faces-config.xml(Different different name)
    1 web Project (View Controller)
    and one Databinding.cpx file
    i am using following version of jdeveloper to develop application
    ADF Business Components     10.1.3.41.57
    BPEL Designer     10.1.3.3.0 (Build 070615.0525)
    Java(TM) Platform     1.5.0_06
    Oracle IDE     10.1.3.41.57
    Struts Modeler Version     10.1.3.41.57
    UML Modelers Version     10.1.3.41.57
    Versioning Support     10.1.3.41.57

    Are you dragging from the data control? what technologies did you use for the data controls?Ans:I am using data controll as ADF BC
    Are the two faces-config.xml files in your web project?
    Ans:Yes with one name with faces-config.xml and antoher with different name

  • How to create hashed table in runtime

    hi experts
    how to create hashed table in runtime, please give me the coading style.
    please help me.
    regards
    subhasis

    Hi,
    Have alook at the code, and pls reward points.
    Use Hashed Tables to Improve Performance :
    report zuseofhashedtables.
    Program: ZUseOfHashedTables                                        **
    Author: XXXXXXXXXXXXXXXXXX                                 **
    Versions: 4.6b - 4.6c                                              **
    Notes:                                                             **
        this program shows how we can use hashed tables to improve     **
        the responce time.                                             **
        It shows,                                                      **
           1. how to declare hashed tables                             **
           2. a cache-like technique to improve access to master data  **
           3. how to collect data using hashed tables                  **
           4. how to avoid deletions of unwanted data                  **
    Results: the test we run read about 31000 rows from mkpf, 150000   **
             rows from mseg, 500 rows from makt and 400 from lfa1.     **
             it filled ht_lst with 24500 rows and displayed them in    **
             alv grid format.                                          **
             It needed about 65 seconds to perform this task (with     **
             all the db buffers empty)                                 **
             The same program with standard tables needed 140 seconds  **
             to run with the same recordset and with buffers filled in **
    Objetive: show a list that consists of  all the material movements **
             '101' - '901' for a certain range of dates in mkpf-budat. **
    the columns to be displayed are:                                   **
             mkpf-budat,                                               **
             mkpf-mblnr,                                               **
             mseg-lifnr,                                               **
             lfa1-name1,                                               **
             mkpf-xblnr,                                               **
             mseg-zeile                                                **
             mseg-charg,                                               **
             mseg-matnr,                                               **
             makt-maktx,                                               **
             mseg-erfmg,                                               **
             mseg-erfme.                                               **
    or show a sumary list by matnr - menge                             **
    You'll have to create a pf-status called vista -                   **
    See form set_pf_status for details                                 **
    tables used -
    tables: mkpf,
            mseg,
            lfa1,
            makt.
    global hashed tables used
    data: begin of wa_mkpf, "header
          mblnr like mkpf-mblnr,
          mjahr like mkpf-mjahr,
          budat like mkpf-budat,
          xblnr like mkpf-xblnr,
          end of wa_mkpf.
    data: ht_mkpf like hashed table of wa_mkpf
          with unique key mblnr mjahr
          with header line.
    data: begin of wa_mseg, " line items
          mblnr like mseg-mblnr,
          mjahr like mseg-mjahr,
          zeile like mseg-zeile,
          bwart like mseg-bwart,
          charg like mseg-charg,
          matnr like mseg-matnr,
          lifnr like mseg-lifnr,
          erfmg like mseg-erfmg,
          erfme like mseg-erfme,
          end of wa_mseg.
    data ht_mseg like hashed table of wa_mseg
          with unique key mblnr mjahr zeile
          with header line.
    cache structure for lfa1 records
    data: begin of wa_lfa1,
          lifnr like lfa1-lifnr,
          name1 like lfa1-name1,
          end of wa_lfa1.
    data ht_lfa1 like hashed table of wa_lfa1
          with unique key lifnr
          with header line.
    cache structure for material related data
    data: begin of wa_material,
          matnr like makt-matnr,
          maktx like makt-maktx,
          end of wa_material.
    data: ht_material like hashed table of wa_material
            with unique key matnr
            with header line.
    result table
    data: begin of wa_lst, "
          budat like mkpf-budat,
          mblnr like mseg-mblnr,
          lifnr like mseg-lifnr,
          name1 like lfa1-name1,   
          xblnr like mkpf-xblnr,
          zeile like mseg-zeile,
          charg like mseg-charg,
          matnr like mseg-matnr,
          maktx like makt-maktx,
          erfmg like mseg-erfmg,
          erfme like mseg-erfme,
          mjahr like mseg-mjahr,
          end of wa_lst.
    data: ht_lst like hashed table of wa_lst
            with unique key mblnr mjahr zeile
            with header line.
    data: begin of wa_lst1, " sumary by material
          matnr like mseg-matnr,
          maktx like makt-maktx,
          erfmg like mseg-erfmg,
          erfme like mseg-erfme,
          end of wa_lst1.
    data: ht_lst1 like hashed table of wa_lst1
            with unique key matnr
            with header line.
    structures for alv grid display.
    itabs
    type-pools: slis.
    data: it_lst            like standard table of wa_lst with header line,
          it_fieldcat_lst   type slis_t_fieldcat_alv with header line,
          it_sort_lst       type slis_t_sortinfo_alv,
          it_lst1           like standard table of wa_lst1 with header line,
          it_fieldcat_lst1  type slis_t_fieldcat_alv with header line,
          it_sort_lst1      type slis_t_sortinfo_alv.
    structures
    data: wa_sort         type slis_sortinfo_alv,
          ls_layout       type slis_layout_alv.
    global varialbes
    data: g_lines type i.
    data: g_repid like sy-repid,
          ok_code       like sy-ucomm.
    selection-screen
    "text: Dates:
    select-options: so_budat for mkpf-budat default sy-datum.
    "text: Material numbers.
    select-options: so_matnr for mseg-matnr.
    selection-screen uline.
    selection-screen skip 1.
    "Text: show summary by material.
    parameters: gp_bymat as checkbox default ''.
    start-of-selection.
      perform get_data.
      perform show_data.
    end-of-selection.
          FORM get_data                                                 *
    form get_data.
            select mblnr mjahr budat xblnr
                into table ht_mkpf
               from mkpf
              where budat in so_budat. " make use of std index.
    have we retrieved data from mkpf?
      describe table ht_mkpf lines g_lines.
      if g_lines > 0.
    if true then retrieve all related records from mseg.
    Doing this way we make sure that the access is by primary key
    of mseg.
    The reason is that is faster to filter them in memory
    than to allow the db server to do it.
        select mblnr mjahr zeile bwart charg
                 matnr lifnr erfmg erfme
          into table ht_mseg
          from mseg
            for all entries in ht_mkpf
         where mblnr = ht_mkpf-mblnr
           and mjahr = ht_mkpf-mjahr.
      endif.
    fill t_lst or t_lst1 according to user's choice.
      if gp_bymat = ' '.
        perform fill_ht_lst.
      else.
        perform fill_ht_lst1.
      endif.
    endform.
    form fill_ht_lst.
      refresh ht_lst.
    Example: how to discard unwanted data in an efficient way.
      loop at ht_mseg.
      filter unwanted data
        check ht_mseg-bwart = '101' or ht_mseg-bwart = '901'.
        check ht_mseg-matnr in so_matnr.
      read header line.
        read table ht_mkpf with table key mblnr = ht_mseg-mblnr
        mjahr = ht_mseg-mjahr.
        clear ht_lst.
    * note : this may be faster if you specify field by field.
        move-corresponding ht_mkpf to ht_lst.
        move-corresponding ht_mseg to ht_lst.
        perform read_lfa1 using ht_mseg-lifnr changing ht_lst-name1.
        perform read_material using ht_mseg-matnr changing ht_lst-maktx.
        insert table ht_lst.
      endloop.
    endform.
    form fill_ht_lst1.
      refresh ht_lst1.
    Example: how to discard unwanted data in an efficient way.
             hot to simulate a collect in a faster way
      loop at ht_mseg.
      filter unwanted data
        check ht_mseg-bwart = '101' or ht_mseg-bwart = '901'.
        check ht_mseg-matnr in so_matnr.
    * note : this may be faster if you specify field by field.
        read table ht_lst1 with table key matnr = ht_mseg-matnr
        transporting erfmg.
        if sy-subrc <> 0. " if matnr doesn't exist in sumary table
        " insert a new record
          ht_lst1-matnr = ht_mseg-matnr.
          perform read_material using ht_mseg-matnr changing ht_lst1-maktx.
          ht_lst1-erfmg = ht_mseg-erfmg.
          ht_lst1-erfme = ht_mseg-erfme.
          insert table ht_lst1.
        else." a record was found.
        " collect erfmg.  To do so, fill in the unique key and add
        " the numeric fields.
          ht_lst1-matnr = ht_mseg-matnr.
          add ht_mseg-erfmg to ht_lst1-erfmg.
          modify table ht_lst1 transporting erfmg.
        endif.
      endloop.
    endform.
    implementation of cache for lfa1.
    form read_lfa1 using p_lifnr changing p_name1.
            read table ht_lfa1 with table key lifnr = p_lifnr
            transporting name1.
      if sy-subrc <> 0.
        clear ht_lfa1.
        ht_lfa1-lifnr = p_lifnr.
        select single name1
           into ht_lfa1-name1
          from lfa1
        where lifnr = p_lifnr.
        if sy-subrc <> 0. ht_lfa1-name1 = 'n/a in lfa1'. endif.
        insert table ht_lfa1.
      endif.
      p_name1 = ht_lfa1-name1.
    endform.
    implementation of cache for material data
    form read_material using p_matnr changing p_maktx.
      read table ht_material with table key matnr = p_matnr
      transporting maktx.
      if sy-subrc <> 0.
        ht_material-matnr = p_matnr.
        select single maktx into  ht_material-maktx
          from makt
         where spras = sy-langu
           and matnr = p_matnr.
        if sy-subrc <> 0. ht_material-maktx = 'n/a in makt'. endif.
        insert table ht_material.
      endif.
      p_maktx = ht_material-maktx.
    endform.
    form show_data.
      if gp_bymat = ' '.
        perform show_ht_lst.
      else.
        perform show_ht_lst1.
      endif.
    endform.
    form show_ht_lst.
      "needed because the FM can't use a hashed table.
      it_lst[] = ht_lst[].
      perform fill_layout using 'full display'
                           changing ls_layout.
      perform fill_columns_lst.
    perform sort_lst.
      g_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program       = g_repid
                i_callback_pf_status_set = 'SET_PF_STATUS'
                is_layout                = ls_layout
                it_fieldcat              = it_fieldcat_lst[]
               it_sort                  = it_sort_lst
           tables
                t_outtab                 = it_lst
           exceptions
                program_error            = 1
                others                   = 2.
    endform.
    form show_ht_lst1.
      "needed because the FM can't use a hashed table.
      it_lst1[] = ht_lst1[].
      perform fill_layout using 'Sumary by matnr'
                           changing ls_layout.
      perform fill_columns_lst1.
    perform sort_lst.
      g_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program       = g_repid
                i_callback_pf_status_set = 'SET_PF_STATUS'
                is_layout                = ls_layout
                it_fieldcat              = it_fieldcat_lst1[]
               it_sort                  = it_sort_lst
           tables
                t_outtab                 = it_lst1
           exceptions
                program_error            = 1
                others                   = 2.
    endform.
    form fill_layout using p_window_titlebar
                   changing cs_layo type slis_layout_alv.
      clear cs_layo.
      cs_layo-window_titlebar        = p_window_titlebar.
      cs_layo-edit                   = 'X'.
      cs_layo-edit_mode              = space.
    endform.                    " armar_layout_stock
    form set_pf_status using rt_extab type slis_t_extab.
    create a new status
    and then select extras -> adjust template -> listviewer
      set pf-status 'VISTA'.
    endform.        "set_pf_status
    define add_lst.
      clear it_fieldcat_lst.
      it_fieldcat_lst-fieldname     = &1.
      it_fieldcat_lst-outputlen     = &2.
      it_fieldcat_lst-ddictxt       = 'L'.
      it_fieldcat_lst-seltext_l       = &1.
      it_fieldcat_lst-seltext_m       = &1.
      it_fieldcat_lst-seltext_m       = &1.
      if &1 = 'MATNR'.
        it_fieldcat_lst-emphasize = 'C111'.
      endif.
      append it_fieldcat_lst.
    end-of-definition.
    define add_lst1.
      clear it_fieldcat_lst.
      it_fieldcat_lst1-fieldname     = &1.
      it_fieldcat_lst1-outputlen     = &2.
      it_fieldcat_lst1-ddictxt       = 'L'.
      it_fieldcat_lst1-seltext_l       = &1.
      it_fieldcat_lst1-seltext_m       = &1.
      it_fieldcat_lst1-seltext_m       = &1.
      append it_fieldcat_lst1.
    end-of-definition.
    form fill_columns_lst.
    set columns for output.
      refresh it_fieldcat_lst.
      add_lst 'BUDAT' 10.
      add_lst   'MBLNR' 10.
      add_lst  'LIFNR' 10.
      add_lst  'NAME1' 35.
      add_lst  'XBLNR' 15.
      add_lst    'ZEILE' 5.
      add_lst    'CHARG' 10.
      add_lst   'MATNR' 18.
      add_lst   'MAKTX' 30.
      add_lst   'ERFMG' 17.
      add_lst   'ERFME' 5.
      add_lst   'MJAHR' 4.
    endform.
    form fill_columns_lst1.
    set columns for output.
      refresh it_fieldcat_lst1.
      add_lst1 'MATNR' 18.
      add_lst1 'MAKTX' 30.
      add_lst1 'ERFMG' 17.
      add_lst1 'ERFME' 5..
    endform.
    Regards,
    Ameet

  • How to Create adf table from java bean

    Hi,
    How to Create adf table from java class (Not from ADF BC).
    Thanks
    Satya

    @vlsn -- you have to follow what shay said.
    Do the following in Model layer ::
    create a table property java class with your columns setters and getters like :
    *public class gridProps {*
    private int sno;
    private String orderNum;
    *public void setSno(int sno) {*
    this.sno = sno;
    *public int getSno() {*
    return sno;
    *public void setOrderNum(String orderNum) {*
    this.orderNum = orderNum;
    *public String getOrderNum() {*
    return orderNum;
    Create another table java class which will populate the values to your column values and return the collection :
    *public class gridPopulate {*
    private  List<gridProps> gridValues ;
    *public List<gridProps> setToGrid(ArrayList<ArrayList> valuesToSet) {*
    *if (valuesToSet == null) {*
    return gridValues;
    gridValues = new ArrayList<gridProps>();
    if(btnValue.equals("completeBtn"))
    return gridValues;
    for(ArrayList<String> tempArr:valuesToSet)
    gridProps gp = new gridProps();
    gp.setSno(Integer.valueOf(tempArr.get(0)));
    gp.setOrderNum(tempArr.get(1));
    return gridValues;
    Right click gridPopulate class and create this as data control.This class will be seen in Data control list.Under this data control,Drag the grid property collection(created earlier) to your page.Then execute your binding(gridPopulate) according to your logic.
    Thanks.(My jdev version 11.1.1.5.0)

  • How to Create ADF table from backing Bean

    Currently I am working on Jdeveloper11g.
    I have a requirement to create Table dyanamically .For that i will get info about table from config file.
    <?xml version="1.0" encoding="UTF-8"?>
    <Pages>
              <page1>
              <Type sortable = "false">TYPE</Type>     
                   <Decription sortable ="true">Description</Decription>
                   <Date sortable = "true" >Date</Date>
                   <Amount sortable ="false">Amount</Amount>
              </page1>
              <page2>
                   <Type sortable = "false">Account Number</Type>     
                   <Decription sortable ="true">Account Name</Decription>
                   <Date sortable = "true" >Creation Date</Date>
                   <Amount sortable ="false">Current Balance</Amount>
              </page2>
    </pages>
    Can you guide me what classes i have to use in backing bean.any sort of code or usefull Links will be highly appriciated.
    Thanks
    Jaydeep

    Hi Jaydeep,
    you can create ADF table using this code,
    RichTable table = new RichTable();
    table.setEmptyText("no rows yet");
    table.setVar("row");
    // add columns
    RichColumn column = new RichColumn();
    column.setHeaderText("Name");
    column.setId("id_column1");
    column.setAlign("right");
    column.setWidth("100");
    // Set output.
    RichOutputText output = new RichOutputText();
    output.setValue("value", "John M.");
    // Add output into column.
    column.getChildren().add(output);
    // Add column into table.
    table.getChildren().add(column);
    Good Luck.

  • Using SQL view object to create ADF table

    Hi,
    I have created a column called "Month" (which extracts month from the date column) and another column to count the no. of requests.
    i want to create an ADF table with 2 columns, a column showing the month and another is showing the no. of requests for that month.
    However, now I only managed to achieve the ADF table to show the overall total requests, which means if i add up all the requests for all the months and i get 500
    My ADF table shows this:
    Jan: 500
    Feb: 500
    Mar: 500
    How should I create the view or what should I do to make it such that the no. of request is based on the month?
    Please advice.
    Thanks (:

    Hi,
    For the given situation you can create a Query Based View Object with the following query
    SELECT
    COUNT(TEMP1.DT) REQUEST,
    TO_CHAR(TEMP1.DT, 'Mon') MONTH
    FROM
    TEMP1
    GROUP BY
    TO_CHAR(TEMP1.DT, 'Mon')
    where DT is the date column and temp1 is the name of the database table.
    Following are the steps that i followed to get this query :
    i have taken the following sample table :
    create table temp1
    (srno number primary key,
    dt date)
    *Note you may use any existing column instead of srno or use dt only (i took an extra column as u know we need a primary key /row id)
    the following is the sample data
    insert into temp1 values (1,sysdate);
    insert into temp1 values (2,sysdate);
    insert into temp1 values (3,add_months(sysdate,1));
    insert into temp1 values (4,add_months(sysdate,1));
    insert into temp1 values (5,add_months(sysdate,3));
    insert into temp1 values (6,add_months(sysdate,5));
    the table appears as follows
    SRNO DT
    1 22-JUN-12
    2 22-JUN-12
    3 22-JUL-12
    4 22-JUL-12
    5 22-SEP-12
    6 22-NOV-12
    To start with ADF View Object Creation (Using Jdeveloper 11.1.2):
    Create the view object using Create View Object wizard
    In Step 1. Name window
    set the value for Name : Viewab (you can use any of ur choice)
    In the data source section : select query
    In Step 2. Query window
    a. Click Query builder (it will pop up sql statment window)
    b. In the SQL Statement window
    in quick-pick objects section -> select temp1 table -> shuttle the columns from available list to selected list
    in select clause section -> select srno column from select list-> choose count() function from function drop down list -> insert function -> set alias to REQUEST-> click validate
    now select dt column from select list -> choose to_char() function -> click insert function -> alter the function to to_Char(temp1.DT,'Mon') -> set alias to Month -> click validate
    in the group by clause section -> Click the green symbol to add -> from the expression palette insert dt column -> insert the to_char function -> alter the function to to_char(temp1.DT,'Mon') -> click validate
    in the Entire SQL Query section -> click test query -> in the test query window -> click query result-> you will see the result -> click close -> click ok
    Click next
    Step 3: Bind Variables
    Click Next
    Step 4: Attribute Mappings
    click Finish
    So the view object is ready :)

  • Error while creating adf table in jdev 11.1.1.2.0

    Hi
    I am getting below error while running the jsf page.
    =======
    <UIXInclude><_setupIncludeContext> Illegal call to setup the context of an include that is already in context
    <UIXInclude><_tearDownIncludeContext> Illegal call to tear down the context of an include that is not in context
    <UIXPageTemplate><tearDownVisitingContext> Tear down of page template context failed due to an unhandled exception.
    java.util.NoSuchElementException
    =======
    In this jsf page I just dragged view object to create a table.
    What could be the reason?
    Thanks

    Hi,
    Did you drop it as ADF table? Can you post the code snippet of your jspx page?
    -Arun

  • Problem in creating a table at runtime

    Hi SDN,
      I am trying to create a Table UI Element at runtime.
    To do So I have written the following code in the "wdDoModifyView" method of the view
    if(firstTime)
             IWDTable table =(IWDTable)view.createElement(IWDTable.class, null);
             table.bindDataSource("TableNode");
             IWDTableColumn column1=(IWDTableColumn)view.createElement(IWDTableColumn.class,null);
         table.addColumn(column1);
         IWDInputField editor=(IWDInputField)view.createElement(IWDInputField.class,null);
         editor.bindValue("TableNode.no");
         column1.setTableCellEditor(editor);
                //   create and add second table column
           IWDTableColumn column2 = (IWDTableColumn) view.createElement(IWDTableColumn.class, null);
          table.addColumn(column2);
           IWDTextView editor1 = (IWDTextView) view.createElement(IWDTextView.class, null);
           editor1.bindText("TableNode.name");
           column2.setTableCellEditor(editor1);
           IWDUIElementContainer root = (IWDUIElementContainer) view.getRootElement();
           root.addChild(table);
    After executing the application the table is created successfully. But both the columns are in TextView mode. What i need is one column should be in input mode and other in TextView mode. So please suggest me what more stuff i have to add to make the field to accept the input.
    Thanks in advance.
    Regards
    Basha

    Hi Armin,
    I need to display a table with 5 rows and 7 columns.
    5 of the columns are drop downs from R/3,
    My requirement is the table should be in editable mode such that the user is allowed to enter some values(rows). on clicking the save button the table values are to be sent to R/3 table through bapi.
    Please help me in resolving this.
    Thanks & Regards,
    Sai Krishna.

  • Unable to create ADF Table based on view object

    Hi
    I am using Jdeveloper 11.1.1.5
    I have created a view object based on the entity object. I am trying to drag and drop view object from data controls in to a blank page and choosing table -> ADF Table. The table is not getting created and at the same time I am not seeing any error message.
    Please help me
    Thanks
    Edited by: 880409 on Aug 19, 2011 5:58 AM

    http://st-curriculum.oracle.com/obe/jdev/obe11jdev/ps1/ria_application/developriaapplication_long.htm
    http://st-curriculum.oracle.com/obe/jdev/obe11jdev/ps1/adfbc_new_features/adfbc.html

  • Is there a way to create ADF Table using a bean

    Hi,
    I am using JDev 11g 11.1.1.2.0.
    I am reading an excel sheet and want to generate an ADF table using the same. I already have hold on excel data.
    But when I go through the RichTable API, I find that there is no method to add Columns and Rows. Most or all the methods work on the table UI Looks attribute.
    Any suggestion? Am I missing a method OR 2 here?
    Pls note: The excel (CSV file) using which I am populating my table, will vary for different user. i.e.
    say user 1 will upload a CSV file with 7cols and 100 rows while
    user 2 will upload the CSV file that has 2 cols and 100 rows.
    Hope this makes it clear of my requirements and why I want to populate the table from a bean.
    Thanks in advance.
    Edited by: user8925296 on Feb 24, 2010 7:09 PM

    Thanks a lot Joseba, I am now atleast getting column headings. I have questions on the soln given but first here is the code that I use
    PS NOTE: on my .jpsx file I have dragged dropped an ADF table, removed its default columns and have bounded it with my bean attrib '_dynaTbl' that is used below.
    // ---- Few imports that I use
    import oracle.adf.model.adapter.dataformat.csv.CSVParser;
    import oracle.adf.view.rich.component.rich.data.RichColumn;
    import oracle.adf.view.rich.component.rich.data.RichTable;
    import oracle.adf.view.rich.component.rich.data.RichTableUtils;
    import oracle.adf.view.rich.component.rich.output.RichOutputText;
         public String getFileData() {
    try {
    FacesContext fc = FacesContext.getCurrentInstance();
    ExpressionFactory elFactory = fc.getApplication().getExpressionFactory();
    ELContext elCtx = fc.getELContext();
    CSVParser pfile = new CSVParser(getFile().getInputStream());
    ArrayList colData = new ArrayList();
    ArrayList colHdr = new ArrayList();
    pfile.nextLine();
    String colArr[] = pfile.getLineValues();
    int colLth = colArr.length;
    int rows =0;
    /* _dynaTbl.setVar("row");    */
    for(int hdr=0 ; hdr < colLth; hdr++){
    RichColumn colNm = new RichColumn();
    colNm.setHeaderText(colArr[hdr]);
    colNm.setRowHeader(true);
    colNm.setRendered(true);
    colHdr.add(hdr, colNm);
    colNm.setVisible(true);
    while (pfile.nextLine()){
    String arr[] = pfile.getLineValues();
    int u=0;
    while(u < colLth) {
    // CoreColumn colNm = (CoreColumn)app.createComponent(CoreColumn.COMPONENT_TYPE);
    //colNm.setId(colArr[   u   ] ) ;
                             //CoreOutputText rdata = (CoreOutputText)app.createComponent(CoreOutputText.COMPONENT_TYPE);
                             RichOutputText rdata = new RichOutputText();
                             rdata.setValue(arr[   u     ]) ;
                             rdata.setVisible(true);
                             rdata.setRendered(true);
                             rdata.setId((String)colArr[    u   ] + u) ;
    // System.out.print("\t\t" + rdata.getValue());
    /* ValueExpression value = elFactory.createValueExpression(elCtx, "#{row.attrName}", Object.class);
    rdata.setValueExpression("value", value);
                             ((RichColumn)colHdr.get(u)).getChildren().add(rdata);
                             //colNm.getChildren().add(rdata);
                        // _dynaTbl.setHeader(rcol);
                        // _dynaTbl.setVisible(true);
                        // _dynaTbl.setValue(arr[   u   ]) ;
                   // _dynaTbl.getChildren().add(colNm);
    u++; rows++;
    //break;
    _dynaTbl.setRows(rows);
                   for(int hdr=0 ; hdr < colLth; hdr++){
    _dynaTbl.getChildren().add((RichColumn)colHdr.get(hdr));
    _dynaTbl.setFetchSize(10);
    _dynaTbl.setVerticalGridVisible(true);
    System.out.print("\n\t child count" + _dynaTbl.getChildCount());
    _dynaTbl.setAllDetailsEnabled(true);
    _dynaTbl.setShowAll(true);
    _dynaTbl.setRowBandingInterval(1);
    _dynaTbl.setRendered(true);
    for(int i =0; i< _dynaTbl.getChildCount() ; i++) {
    System.out.print("\n\t count within child:" i " is :" +
    ((RichColumn)(_dynaTbl.getChildren()).get(i)).getChildCount());
    System.out.println(" isAllDetailsEnabled:"+ _dynaTbl.isAllDetailsEnabled());
    System.out.println(" isRowAvailable:"+ _dynaTbl.isRowAvailable());
    System.out.println(" isRowAvailable i:"+ _dynaTbl.isRowAvailable(i));
    System.out.println(" isShowAll i:"+ _dynaTbl.isShowAll());
    }catch (Exception exp){
    exp.printStackTrace();
    return "Done";
    Here is the problem. I am able to view only column headings but data is not visible.
    1. I get below out put for as many columns that I use
    a.
    count within child:4 is :24 isAllDetailsEnabled:true
    isRowAvailable:false
    isRowAvailable i:false
    isShowAll i:true
    b. Why is table data missing. What more do I need to do?
    Kindly guide.
    Thanks a lot in advance.

  • Issue while creating ADF Table programatically

    Hi,
    I am trying to create a table programatically...And i implemented like below:
                RichTable phoneTable = new RichTable();
                phoneTable.setEmptyText("No Phone Details yet");
                getContactPhone(contactObj.getPhone());
                phoneTable.setValue(contactObj.getPhone());
    // contactObj.getPhone() is a ArrayList<TelephoneBOD> in pojo Object...
    // Which is taken from a Object returned from DataControl Method (Captured in pageFlowScope)
                phoneTable.setVar("row");
                // Add Columns
                RichColumn column = new RichColumn();
                column.setHeaderText("Type");
                column.setId("phoneType");
                column.setAlign("right");
                column.setWidth("100");
                // Set output.
                RichOutputText output = new RichOutputText();
                output.setValue("#{row.phoneType}");
                // Add output into column.
                column.getChildren().add(output);
                // Add column into table.
                phoneTable.getChildren().add(column);When i try to implement like this i am getting fllowing error:
    popup:
    ZIP_STATE_FAILED
    ADF_FACES-60097:For more information, please see the server's error log for an entry beginning with: ADF_FACES-60096:Server Exception during PPR, #2log:
    Caused By: java.io.NotSerializableException: org.ieee.internal.ws.proxy.conf.types.TelephoneBOD
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
         at java.util.ArrayList.writeObject(ArrayList.java:570)
         at sun.reflect.GeneratedMethodAccessor252.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
         at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
         at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
         at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
         at org.apache.myfaces.trinidad.component.TreeState.writeExternal(TreeState.java:239)
         at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1421)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1390)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
         at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
         at org.apache.myfaces.trinidad.component.TreeState.writeExternal(TreeState.java:241)
         at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1421)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1390)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
         at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)I think this is happening because i am not serializing the object passing to Table. If this is the Reason.. How to serialize the object?
    Or i am missing something in the code?
    Thanks
    Thoom
    Edited by: User007 on Aug 31, 2011 1:47 PM
    Edited by: User007 on Aug 31, 2011 1:47 PM

    Thanks Timo.. for simple solution.
    Actually.. TelephoneBOD is auto-generated on creation of web service proxy from web service.
    I don't think.. updating those Java files directly is a best practice. Because they will be changing if there is any change in web service schema..
    You think there is any other way to do so?
    Thanks
    Thoom

  • Problem while creating ADF Table

    When I drag view object from data control palette and place it on jspx page as a ADF Table then it does not show any table fields in Edit Table Columns dialog box. I am using JDeveloper 10.1.3.2
    Please Help, its urgent.
    Thanks in advance.

    Hi,
    When you expand your view object in data control can you see those fields?
    Bogdan

  • Create dynamic table at runtime and bind it with ViewObject

    Hi everyone.
    I have the following task.
    I need to create a multiple ViewObjects at runtime (using different constructed sql queries) and then bind ViewObjects with created (also in runtime) tables.
    Tables are to be created on PanelTabbed component. Each tab contains one table.
    So the problem - is there a way to perform this task?
    A portion of code:
    ApplicationModule am = ADFUtils.getApplicationModule("AppModule");
    ViewObjectImpl vo = null;
    if (am.findViewObject("SQLVo") != null)
    am.findViewObject("SQLVo").remove();
    System.out.println("object removed!");
    vo = am.createViewObjectFromQueryStmt("vo", "select ...");
    RichTable newTable = new RichTable();
    newTable.setVar("row");
    newTable.setVarStatus("rowStat");
    RichShowDetailItem newDetItem = new RichShowDetailItem();
    newDetItem.setText("New Detail");
    newTable.setInlineStyle("width:100%;height:180px");
    newTable.setRowSelection("single");
    DCBindingContainer dcBindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    String iterBindingName = vo.getName() + "Iterator";
    JUIteratorBinding iterBinding =
    (JUIteratorBinding)dcBindings.findIteratorBinding(iterBindingName);
    if (iterBinding != null) {
    dcBindings.removeIteratorBinding(iterBindingName);
    BindingContext bcc = (BindingContext)JSFUtils.resolveExpression("#{data}");
    iterBinding =
    new JUIteratorBinding(bcc.findDataControl("AppModuleDataControl"), vo);
    String ctrlBindingName = vo.getName() + "Binding";
    FacesCtrlHierBinding clonedHierBinding =
    (FacesCtrlHierBinding)dcBindings.findCtrlBinding(ctrlBindingName);
    if (clonedHierBinding != null) {
    dcBindings.removeControlBinding(ctrlBindingName);
    =======================================
    Please, look here!
    What's the best practices to create a new FacesCtrlHierBinding?
    What a parameter _nodeBindings (type JUCtrlHierTypeBinding[]) should be?
    =======================================
    clonedHierBinding =
    new FacesCtrlHierBinding(null,
    iterBinding,
    new String[]{
    "BUILDING_ID"
    // "BUILD_NAME",
    // "FUNCTIONALITY_NAME",
    // "CITY_NAME",
    // "STREET_NAME",
    // "FLOORS"
    _nodeBindings
    dcBindings.addControlBinding(ctrlBindingName, clonedHierBinding);
    newTable.setValue(clonedHierBinding.getCollectionModel());
    for (int g=0; g < vo.getAttributeCount(); g++){
    RichColumn col = new RichColumn();
    col.setId("c" + Integer.toString(g));
    col.setHeaderText(vo.getAttributeDef(g).getProperty(AttributeHints.ATTRIBUTE_LABEL).toString());
    ValueExpression valExp =
    facesContext.getApplication().getExpressionFactory().createValueExpression(facesContext.getELContext(),
    "#{row." + vo.getAttributeDef(g).getName() + "}",String.class);
    RichOutputText text = new RichOutputText();
    text.setId(vo.getAttributeDef(g).getName() + "txt");
    text.setValueExpression("value", valExp);
    col.getChildren().add(text);
    newTable.getChildren().add(col);
    newDetItem.getChildren().add(newTable);
    myBean.panelTabbed.getChildren().add(newDetItem);
    ...

    Shay, good day!
    You answer is good, but - it use only one dynamic view (and one table, iterator and FacesModel).
    I have task like topic started have - i need to create some unknows numbers of ViewObject (created by demad) and i must have a FacesModel for each created ViewObject.
    How can we do it?

  • How to create adf columns at runtime

    Hello
    I want to crete a component which will display results of arbitrary sql command.
    for that purpose I created 'declared component' with custom component class which obtains SQL query from passed attibute and executes it.
    so in my component I have
    public List<String> getColumnNames() {
    if (!loaded) {
    loadData();
    return columnNames;
    public List<List<Object>> getData() {
    if (!loaded) {
    loadData();
    return data;
    and in compDef.jspx following:
    <af:table value="#{component.data}" var="row">
    <af:column headerText="No">
    <af:outputText value="#{row}" />
    </af:column>
    <af:forEach items="#{component.columnNames}" var="col" varStatus="colStatus">
    <af:column headerText="#{col}">
    <af:outputText value="#{row[colStatus.index]}" />
    </af:column>
    </af:forEach>
    </af:table>
    query execution is ok and component.columnNames contains several columns (checked this with af:iterator)
    but it shows only 1 column (with header 'No').
    If I use
    <af:iterator value="#{component.columnNames}" var="col" varStatus="colStatus">
    <af:column headerText="#{col}">
    <af:outputText value="#{row[colStatus.index]}" />
    </af:column>
    </af:iterator>
    it shows 4 columns instead of 2 (and doesn't show any text - that is headerText is empy and all cells are empy too)
    So, can anybody tell me how is it ment to be ? Or where is the mistake ?
    Version: 11g TP 4.

    Thank you for your reply.
    Well, if I set headers to
    xx #{col} xx idx: #{colStatus.index} :idx
    it shows only static text and no EL values.
    (So in output I have 4 headers with text "xx xx idx: :idx")
    Actually if I use suck mix of af:table and af:forEach in usual jspx file (not in component's one) - it works as expected
    that is
    code
    <af:table value="#{Query1.data}" var="row">
    <af:column headerText="xxxxx">
    <af:outputText value="#{row}" />
    </af:column>
    <af:forEach items="#{Query1.columnNames}" var="col" varStatus="colStatus">
    <af:column headerText="#{col}">
    <af:outputText value="#{row [ colStatus.index ] }" />
    </af:column>
    </af:forEach>
    </af:table>
    where Query1 JSF bean performs the same functionality (executes arbitrary SQL query and stores results in data and columnNames)
    works OK.
    (colStatus.index is written in brackets - don't know how to disable its transformation to link, how to write preformatted code here ?)
    Another point that behaviour in component's jspx is a bug - the amount of columns.
    It produces 4 columns instead of 2. And I can't figure why because it doesn't show any information neither in var 'col' nor in varStatus 'colStatus'.
    And if I the query returns 3 columns - number of columns in generated table is 9.
    UPD. Specified behaviour is for af:iterator in the component's jspx. af:forEach produces no columns at all.
    Edited by: olegk on Mar 26, 2009 11:05 AM

  • Create ADF Table programmatically.

    I'm trying to populate an af:table programmatically from the backing bean. I have successfully generated the table and the rows/columns. I'm however unable to specify the value of each cell.
    Here's my code snippet for populating a dummy table with just one column displaying employee's name.
    public class Employee {
          private String name;
          // A bean class with getters/setters
    public RichTable generateTable(){
          //create an array list of Employee as data
          List<Employee> data = createSampleData(); 
          RichTable _t = new RichTable();
          //set id, visible, etc. omitted.
          _t.setValue(data);
          _t.setVar("row");
          RichColumn rc = new RichColumn();
          RichOutputText rot = new RichOutputText();
    /**** Here's where the problem occurs ****/
         rot.setValue("#{row.name}");
    //set id, header etc for RichColumn. omitted
    //add output text and rich column as children to the table. omitted
    return _t;
    Using the codes shown I can get the table rendered with however many rows I created in the array list. Yet in each cell, instead having the name of the employee, the table shows the string #{row.name}
    The EL is not resolved but interpreted as a literal string.
    How can I set the value of the output text to refer to the value of the name attribute of each row?
    Thanks

    Hi,
    ELContext elContext = FacesContext.getCurrentInstance().getELContext();
    ExpressionFactory efact = FacesContext.getCurrentInstance(). getApplication().getExpressionFactory();
    ValueExpression valExpr = efact.createValueExpression( elContext,elExpression,Object.class);
    rot.setValueExpression( "value", valExpr);
    Frank

Maybe you are looking for

  • Why is my numeric keyboard not working on windows 7 via boot camp?

    What ever I use the numeric keypad on the Apple Wired Keyboard on Windows 7 boot camp. It does not work. I have to use the number on the above of my letter case part. I tried using the numeric keys on calculator or games. It functions more like fn, h

  • How do I delete or change my number in my old iPhone, so that I can still use it for iMessages without issue?

    I have an iPhone 4S that was with Verizon. About a week ago I ported into Virgin Mobile and bought a new phone to use until the next iPhone comes out. I now still have my old iPhone, which I want to use for iMessages, as well as like an iPod, etc. Th

  • ITunes Media Folder location - on a data parition

    Hi, I use Mac with a partitioned hard drive. It lets me use a Snow Leopard and Lion. I use a third partition fror data, this is where my iTunes media folder is. iTunes Lion uses it just fine, but iTunes on Snow Leopard doesn't work that well - it can

  • Why do my applications disappear?

    When I export my applications from my dev instance and I import them into the prod instance in without the build option they disappear from the list when I log into the prod database as the schema owner. Looking in the App Builder they don't show up.

  • Why is the lock screen message not centered?

    In the Security & Privacy settings, we now have a graphical method for setting a login message instead of having to use terminal. I have noticed an issue though. On the login screen, the message displays as it should, centered on the screen at the bo