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)

Similar Messages

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

  • Creating XML file from Java Bean

    Hi
    Are there any standard methods in Java 1.5 to create XML file from java bean,
    i can use JAXB or castor to do so,
    But i would like to know if there is any thing in java core classes,
    I have seen XMLEncoder, but this is not what i want.
    Any ideas
    Ashish

    Marshall JavaBean to an XML document with JAXB or XMLBeans.

  • Creating DAO layer from java beans(setter and getter methods)

    Can anybody explain me how to create an adapter layer (DAO layer) from java beans with no connection and transaction code inside DAO layer?

    Sure, have another layer do the transaction work.
    Your DAO would make us of this layer.

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

  • How to create a table from an existing table with new column

    Hi !
    Please help me.
    I want to create a table from an existing table with data and add two new column to the new table.
    What will be the syntax?

    craete table new_table as select a.*, 'somevalue' new_col1, 'somevalue'
    new_col2 from old_table a;Also there is a pitfall - newly created table will accept column type and precision from the select statement, so further you can be needed to modify columns
    if you want to have VARCHAR2 instead of CHAR for example:
    SQL> create table new_dept as select dept.*, 'New data' new_col from dept;
    Table created.
    SQL> desc new_dept
    Name                                      Null?    Type
    DEPTNO                                             NUMBER(2)
    DNAME                                              VARCHAR2(14)
    LOC                                                VARCHAR2(13)
    NEW_COL                                            CHAR(8)
    SQL> alter table new_dept modify (new_col varchar2(8));
    Table altered.
    SQL> desc new_dept
    Name                                      Null?    Type
    DEPTNO                                             NUMBER(2)
    DNAME                                              VARCHAR2(14)
    LOC                                                VARCHAR2(13)
    NEW_COL                                            VARCHAR2(8)Rgds.
    Didn't see michael's post - it reflects the fix for this problem using CAST.
    Message was edited by:
    dnikiforov

  • How to trigger tree table from java code

    Trying to trigger tree table from java code, using :
    AdfFacesContext.getCurrentInstance().addPartialTarget(treeTableComponent);
    But its not working. Am i using the correct approach?

    Sorry for the incomplete information,
    I have a tree table in a region and that region i am including inside a jspx file. In the region i have one popup and based on the input taken from the popup i want to trigger the table to show the data.
    For that i am trying :
    FacesContext context = FacesContext.getCurrentInstance();
    UIComponent component = findComponent( context.getViewRoot(),"treeTableID");
    if(component != null){
    AdfFacesContext.getCurrentInstance().addPartialTarget(component);
    public static UIComponent findComponent(UIComponent base, String id)
    if (id.equals(base.getId()))
    return base;
    UIComponent children = null;
    UIComponent result = null;
    Iterator childrens = base.getFacetsAndChildren();
    while (childrens.hasNext() && (result == null))
    children = (UIComponent) childrens.next();
    if (id.equals(children.getId()))
    result = children;
    break;
    result = findComponent(children, id);
    if (result != null)
    break;
    return result;
    Model is getting data before i use : AdfFacesContext.getCurrentInstance().addPartialTarget(component);
    But table is not calling getData() in model to show the populated data on UI.

  • How to Create this Table in Java?

    How do i create a table with the heading set out as below. \\i tried to create it using the netbeans ide, with there drag and drop but you cant seem to be able to alter the size of the different tables.
    | Home Win | Draw | Away Win |
    Match | Yours Odds| Actual Odds | Your Odds | Actual Odds | Your Odds | Actual Odds |
    | | | | | |
    | | | | | |
    | | | | | |
    | | | | | |
    | | | | | |

    jamezao wrote:
    How do i create a table with the heading set out as below. \\i tried to create it using the netbeans ide, with there drag and drop but you cant seem to be able to alter the size of the different tables.Did you search in the Swing forum for merging table cells or Multiline table haeders?

  • How to refresh Adf  table from Adf popup

    Hi all,
    i have and adf query panel with table. On this table for each record, there is a button to perform some operations. When i click this button i am launching an adf popup. Inside this popup i have used a adf dialog of type yes/no. i am using this as a confirmation. (ex- Are you sure you want to change (ex- deactivate) this record?) If yes is clicked i change only one field. Suppose the record belongs to a client. On click of yes, i change the status to some value. ex- deactivate. so with the dialog's button click, i change the table data. but it is not reflected unless i made a query. i want to automatically refresh this table on click of dialog button's yes. I hope i made my self clear. Can this be done with Jdev. Im using Jdev 11.1.1.0.1. Pls help me with this.
    Thanks in advance,
    Nad

    Hi Maxi, Timo, i tried the solutions by both of you. Thanks alot for replying. But i get an error. This is what i did. for Deactivate btn in the table, i have added the below return listerner code.
    public void onReturnFromDialog(ReturnEvent returnEvent) {
    if (returnEvent.getReturnValue() != null) {
    refreshCurrentPage();
    protected void refreshCurrentPage() {
    FacesContext context = FacesContext.getCurrentInstance();
    String currentView = context.getViewRoot().getViewId();
    ViewHandler vh = context.getApplication().getViewHandler();
    UIViewRoot x = vh.createView(context, currentView);
    x.setViewId(currentView);
    context.setViewRoot(x);
    but i noticed that both these methods are not invoked. So i added the below dialoglistener code to the af:dialog that is inside my popup. This popup is shown when the deactivate btn is clicked.
    public void DialogListenAction(DialogEvent dialogEvent) {
    if(dialogEvent.getOutcome().toString().equals("yes"))
    DCIteratorBinding iter = ADFUtils.getIterator("MembersVO3");
    String des = (String) iter.getCurrentRow().getAttribute("MemberCode");
    service.deactivateMember(des); //This is where i update the record and set the attribute value to des
    System.out.println("suspect1");
    RequestContext.getCurrentInstance().returnFromDialog(des,null);
    //AdfFacesContext afContext = AdfFacesContext.getCurrentInstance();
    //afContext.getCurrentInstance().returnFromDialog(des, null);
    System.out.println("suspect2");
    //ifCancel Do nothing
    when i add 'RequestContext.getCurrentInstance().returnFromDialog(des,null);'
    OR
    'AdfFacesContext afContext = AdfFacesContext.getCurrentInstance();
    afContext.getCurrentInstance().returnFromDialog(des, null);'
    i get the error - java.lang.IllegalStateException: popView(): No view has been pushed.
    i cant figure out what is the wrong here. Can some one pls suggest how to resolve this?
    Thanks alot.

  • How to create view/table from other user's view/table

    Hi all
    I'm using Oracle database 10g.
    I create table/view on user XXX, how to I create table/view on user YYY from user XXX.
    Thankyou,
    Thiensu2810

    user8248216 wrote:
    Hi all
    I'm using Oracle database 10g.
    I create table/view on user XXX, how to I create table/view on user YYY from user XXX.
    Thankyou,
    Thiensu2810grant select on xxx.table_name to yyy;
    create table/view table/view_name as select * from xxx.table_name;

  • How to create .exe files from Java class files?

    I'm new to Java and I just wonder if it is possible to make executable files out of Java class files. I've checked the Java online help and several search engines, but I still couldn't find anything about that. Is it possible to do so? If not, why not?
    Thanx a lot for any help.

    I don't remember if there is a program that converts the class file,
    but I do know that there are a few that either convert the class file,
    or the .java file. You might try searching for ".java to .exe" in the
    search engine and seeing what that pulls up.

  • How to create a table in the file using java code.?

    HI,
    I should export the data from the view objects to a word document. I have done that but I should
    display the data in the form of a table.
    Kindly come up with the necessary information on how to create a table in the file using java.
    Thanks,
    Phani

    Hi, Thank you for responding to my query.
    The below are the details of my code.
    DCBindingContainer dcBindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding StudentDetailsContent =
    (DCIteratorBinding)dcBindings.get("StudentView1Iterator");
    OutputStreamWriter w = new OutputStreamWriter(outputStream, "UTF-8");
    Row currentRow =
    StudentDetailsContent.getRowSetIterator().first();
    Object a[]= currentRow.getAttributeValues();
    int i;
    for(i=0 ;i<=a.length;i++){
    w.write(a.toString());
    w.write(" ");
    w.flush();
    I am usning this coding to achieve the task of exporting data to file.
    I need to display this information in the table that is where I need help from you people.
    Thanks,

  • How create temporary table from list of values

    Can you anybody advise me how can I create temporary table from list of values? I have list of values and need create temporary table for next use with command JOIN etc.
    Thank you for help

    NO, you can not create temporary table in oracle on the fly ( Like #Tabels in SQl Server or Sybase ) , you will have to use the GTT i.e Global Temporary Tables
    check the following link GTT :
    to flush the tables after commit
    CREATE GLOBAL TEMPORARY TABLE my_temp_table (
      column1  NUMBER,
      column2  NUMBER
    ) ON COMMIT DELETE ROWS;In contrast, the ON COMMIT PRESERVE ROWS clause indicates that rows should be preserved until the end of the session.
    so to keep rows in Table after commit
    CREATE GLOBAL TEMPORARY TABLE my_temp_table (
      column1  NUMBER,
      column2  NUMBER
    ) ON COMMIT PRESERVE ROWS;

  • Need to Add and Remove Columns of ADF Read Only table from Backing bean

    I have a scenario where I am trying to Populate TransientVO which is shown has a ADF Read Only Table in page.
    I have couple of Check Boxes Based on their selection I am trying to render and hide certain Columns.
    But the Issue which I am facing is only the Column Header seems to change where as the Rows and Values doesnt..
    even If I apply the expression language rendering condition on the outputText inside those columns.. ..
    So I am thinking to add and remove VO Attribute columns to the table from backing bean.
    Need some sample code snippet or a better design to achieve this. Its kind of urgent too...having an aggressive deadline :(
    Please chip in People..
    Thanks in Advance .
    TK

    Table Code..
    <af:table value="#{bindings.InventoryGridTrans.collectionModel}"
                                    var="row"
                                    rows="#{bindings.InventoryGridTrans.rangeSize}"
                                    emptyText="#{bindings.InventoryGridTrans.viewable ? 'No data to display.' : 'Access Denied.'}"
                                    fetchSize="#{bindings.InventoryGridTrans.rangeSize}"
                                    rowBandingInterval="0" id="t4"
                                    partialTriggers="::sbcSales ::sbcUsage ::cb1">
                            <af:column sortProperty="Period" sortable="false"
                                       headerText="#{bindings.InventoryGridTrans.hints.Period.label}"
                                       id="c38">
                              <af:outputText value="#{row.Period}" id="ot33"/>
                            </af:column>
                            <af:column sortProperty="Past12SalesCount"
                                       sortable="false"
                                       headerText="#{bindings.InventoryGridTrans.hints.Past12SalesCount.label}"
                                       id="c29"
                                       rendered="#{backingBeanScope.IndexPageBackingBean.onUsage != true and backingBeanScope.IndexPageBackingBean.onSales == true}">
                              <af:outputText value="#{row.Past12SalesCount}"
                                             id="ot40"
                                             rendered="#{backingBeanScope.IndexPageBackingBean.onUsage != true and backingBeanScope.IndexPageBackingBean.onSales == true}"
                                             visible="#{backingBeanScope.IndexPageBackingBean.onUsage != true and backingBeanScope.IndexPageBackingBean.onSales == true}">
                                <af:convertNumber groupingUsed="false"
                                                  pattern="#{bindings.InventoryGridTrans.hints.Past12SalesCount.format}"/>
                              </af:outputText>
                            </af:column>
                            <af:column sortProperty="Past12UsageCount"
                                       sortable="false"
                                       headerText="#{bindings.InventoryGridTrans.hints.Past12UsageCount.label}"
                                       id="c40"
                                       rendered="#{backingBeanScope.IndexPageBackingBean.onUsage == true and backingBeanScope.IndexPageBackingBean.onSales != true}"
                                       visible="#{backingBeanScope.IndexPageBackingBean.onUsage == true and backingBeanScope.IndexPageBackingBean.onSales != true}">
                              <af:outputText value="#{row.Past12UsageCount}"
                                             id="ot47"
                                             rendered="#{backingBeanScope.IndexPageBackingBean.onUsage == true and backingBeanScope.IndexPageBackingBean.onSales != true}"
                                             visible="#{backingBeanScope.IndexPageBackingBean.onUsage == true and backingBeanScope.IndexPageBackingBean.onSales != true}">
                                <af:convertNumber groupingUsed="false"
                                                  pattern="#{bindings.InventoryGridTrans.hints.Past12UsageCount.format}"/>
                              </af:outputText>
                            </af:column>
                            </af:column>
                    </af:table>

  • How to View Tables from java side from NWDS/NWDI?

    HI All,
    I want to view the following tables from java side
    CRM_ISA_ADDRESS
    CRM_ISA_BASKETS
    CRM_ISA_BUSPARTNER
    CRM_ISA_EXTCONFIG
    CRM_ISA_EXTDATHEAD
    CRM_ISA_EXTDATITEM
    CRM_ISA_ITEMS
    CRM_ISA_OBJECTID
    CRM_ISA_SHIPTOS
    CRM_ISA_TEXTS
    How can I view them using NWDS/NWDI?
    Which DC has this tables?
    Could you please help me with the procedure to view them?
    Thanks and Regards,
    Gauri

    Hi All,
    crm/isa/isacoreddic and crm/isa/shopddic in SAP-CRMDIC are having these tables.
    Thanks and Regards,
    Gauri

Maybe you are looking for