ADF Faces: RichTable - How to create a RichTable object

Hi. How to create a RichTable object to put in a JSF page ? I need to make a method that receive a list of name of columns and a list of list of data. This code that I have writing don't work. What's my error?
        public RichTable getADFTable(
        List<String> lstCols, List< List<String> > lstLstData
        RichColumn adfCol = null;
        List<RichColumn> lstRichCols = new ArrayList<RichColumn>();
        int cont = 0;
        for( String col : lstCols ){
            adfCol = new RichColumn();
            adfCol.setDisplayIndex(cont++);
            adfCol.setHeaderText( col );
            adfCol.setMinimumWidth( "60" );
            lstRichCols.add( adfCol );
        int contCols = 0;
        RichOutputText text = null;
        RichTable AdfTab = new RichTable();
        for( List<String> lstData : lstLstData){
            for( String data : lstData ){
                text = new RichOutputText();
                text.setValue(data);
                lstRichCols.get( contCols ).getChildren().add( text );
                contCols++;
            contCols = 0;
        AdfTab.setRows(this.lstEntit.size());
        cont = 0;
        for( RichColumn col : lstRichCols ){
            AdfTab.getChildren().add( col );
        return AdfTab;
    }

I was searching for an example and i found it but whit errors, finally i fixed and it works.
You just have to generate the data from your webservices and "put" into this structure.
The java file (Bean)
package view;
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 DynamicTable {
    private SortableModel model;
    private List<String> columnNames;
    public DynamicTable() {
        columnNames = new ArrayList<String>();
        columnNames.add("Col-1");
        columnNames.add("Col-2");
        generateColumnModel();
    public void generateColumnModel() {
        this.model = new SortableModel(createRows(columnNames));
    private 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;
    // Get table model
    public CollectionModel getCollectionModel() {
        return model;
    public void setColumnNames(List<String> columnNames) {
        this.columnNames = columnNames;
    public List<String> getColumnNames() {
        return columnNames;
}The jspx file (page)
           <af:table varStatus="rowStat" summary="table"
                        value="#{pageFlowScope.DynamicTable.collectionModel}"
                        rows="#{pageFlowScope.DynamicTable.collectionModel.rowCount}"
                        rowSelection="none" contentDelivery="immediate"
                        var="row" rendered="true" id="t1">
                <af:forEach items="#{pageFlowScope.DynamicTable.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>

Similar Messages

  • How to create a view object and attach with extended AM

    Hi,
    I tried to create new vo and attach this vo with the extended AM. But it is throwing error like 'PC.NAME : invalid identifier' (Actually this PC.NAME is exiting one).
    Now i want to know how to create a view object similar like seeded one but with one additional condition in the where clause.
    It is possible though extension, but i want to create two view object similar like seeded one, one with some other condition in the where clause
    and another one with some other condition.
    So for my requirement, i'll extend one VO and i'll add my condition but how to do it for second condition.
    But i want same seeded VO with two different condition.
    Any suggestions please,
    SAN

    SAN,
    There is no need to attach the newly created VO with extended AM. You need to attach the same with the standard AM.
    Regards,
    Gyan

  • How to create a georaster object?

    Hi,
    I type this codes to create a georaster object. but there is error msg.
    SDO_GEOR.createBlank(
    rasterType IN INTEGER,
    ultCoord IN SDO_NUMBER_ARRAY,
    dimSizes IN SDO_NUMBER_ARRAY,
    cellValue IN NUMBER,
    rasterDataTable IN VARCHAR2 DEFAULT NULL,
    rasterID IN NUMBER DEFAULT NULL
    ) RETURN SDO_GEORASTER;
    Error Message:
    Error starting at line 1 in command:
    SDO_GEOR.createBlank(
    Error report:
    Unknown Command
    Error starting at line 3 in command:
    rasterType IN INTEGER,
    Error report:
    Unknown Command
    Error starting at line 5 in command:
    ultCoord IN SDO_NUMBER_ARRAY,
    Error report:
    Unknown Command
    Error starting at line 7 in command:
    dimSizes IN SDO_NUMBER_ARRAY,
    Error report:
    Unknown Command
    Error starting at line 9 in command:
    cellValue IN NUMBER,
    Error report:
    Unknown Command
    Error starting at line 11 in command:
    rasterDataTable IN VARCHAR2 DEFAULT NULL,
    Error report:
    Unknown Command
    Error starting at line 13 in command:
    rasterID IN NUMBER DEFAULT NULL
    Error report:
    Unknown Command
    Error starting at line 15 in command:
    ) RETURN SDO_GEORASTER;
    Error report:
    Unknown Command
    Please advise me on how to create a georaster object as i am very new to the technology.
    Thanks and regards,
    Esther

    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14254/geor_intro.htm

  • How to create authority check object and assign to  ztcode which is of modu

    Dear ,
             how to create authority check object and assign to  ztcode which is of custom module pool program.its urgent kindly help points rewarded.

    Manoj,
    You can check with your Basis team to create authorisation object and assigining tcodes to the user profiles.
    K.Kiran.

  • How to create new authorisation object for Transactions?

    Hi,
    How to create new authorisaton object and how to assign that object on a transaction code?
    Case ->
    The transaction code VL01N have the object called V_LIKP_VST under Class "LE_V" that have two auth. fields. one is 'Activity' and other one is "Shipping Point/Receiving Point".
    Here I want to add "Storage location" also. I have created one object called "Z_LIKP_VST" under same calass "LE_V". and added "Activity", "Shipping Poing/Receiving Poing" and "Storage Location". After that I added that object ("Z_LIKP_VST") for particular transaction through "SU24". I maintained the "Display check indicator" for VL01N.
    I created one new role and assigend the particular transacation for a user. but still SAP taking  V_LIKP_VST insted of Z_LIKP_VST.
    How can I change my Z_LIKP_VST on profile.
    Please help
    Thanks in Advance
    Lal

    Hi Kariyath,
    I suppose its not about interest but a MUST.. sorry but.. unless u include the Logic in the program how can SAP pick these custom Z objects ?
    after u create them and assign to a Tcode in SU24 there is no logic to check these objects. Frankly i see no other chance.... unless SAP comes to us with a great easy way to input these Custom objects
    Keep looking and please Update me if u have any Inputs....on this front..
    All the Best
    Br,
    Sri
    Award points for helpful answers

  • Plz tell me how to create authority check objects and how to usein prg

    dear sir,
    plz tell me how to create authority check objects and how to usein prg

    http://help.sap.com/saphelp_46c/helpdata/en/5c/deaa74d3d411d3970a0000e82de14a/content.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/52/6716a6439b11d1896f0000e8322d00/content.ht
    Create custom authorization – Customer specific object
    If you have requirements that cannot be met using the P_ORGIN and P_ORGXX authorization objects (for example, because you want to build your authorization checks on additional fields of the Organizational Assignment infotype (0001) that are customer-specific), you can include an authorization object in the authorization checks yourself.
    Create the authorization object using transaction SU21. Make sure you keep to the customer name range (Z/Y). To be able to use the new authorization object you have created in the master data authorization check, the object must contain the INFTY, SUBTY, and AUTHC fields. You can use any of the fields of the Organizational Assignment infotype (0001) for the other fields. You can also use customer-specific additional fields provided they are CHAR or NUMC type fields.
    After you have created the object, you must start the RPUACG00 report. This report overwrites the MPPAUTZZ standard include with the code that is needed to evaluate the authorization object you created. Note: Technically speaking, this involves a modification. However, SAP fully supports this procedure. And you should not have more maintenance work as a result of this modification.
              Note: that if you use customer-specific authorization objects, you must maintain these objects in transaction SU24 (Maintain Assignment of Authorization Objects to Transactions) in the same way as you maintain the authorization objects P_ORGIN, P_ORGXX, and P_PERNR
    AUTHORITY CHECK OBJECT Object_name
                ID fieldname1 FIELD fieldvalue1
                ID fieldname2 FIELD fieldvalue2
                ID fieldname3 FIELD fieldvalue3.
                 If sy-subrc eq 0.   "Authorization exists
                 Endif.
    http://articles.techrepublic.com.com/5100-6329_11-5110893.html
    Edited by: JackandJay on Jan 16, 2008 10:21 AM

  • How to create Authority check object

    Hello Gurus,
    How to create Authority-check object 'ZABC'
                                                             ID 'TABLE' FIELD 'ZTABLE'.
    Please tell me detailed procedure.
    Thanks in advance.
    Best Regards,
    zubera

    Dear Zubera,
    Creating Authorization Fields
    In authorization objects, authorization fields represent the values to be tested during authorization checks.
    To create authorization fields, choose Tools --> ABAP Workbench --> Development --> Other tools --> Authorization objects ® Fields.
    To create a authorization field:
    1. Choose Create authorization field.
    2. On the next screen, enter the name of the field. Field names    must be unique and must begin with the letter Y or Z.
    3. Assign a data element from the ABAP Dictionary to the field.
    4. If desired, enter a check table for the possible entries. For    more information about check tables.
    For more information about AUTHORITY-CHECK, see the keyword documentation of the ABAP Editor.
    You can often use the fields defined by SAP in your own authorization objects. If you create a new authorization object, you do not need to define your own fields. For example, you can use the SAP field ACTVT in your own authorization objects to represent a wide variety of actions in the system.
    Assigning an Authorization Object to an Object Class
    Each authorization object must be assigned to an object class when it is created.
    Choose Tools --> ABAP Workbench --> Development --> Other tools --> Authorization objects --> Objects.
    You can also create authorization objects in the Object Navigator (SE80).
    Creating / Choosing Object Classes
    The system displays a list of existing object classes.
    Object classes are organized according to the components of the system.
    Before you can create a new object, you must define the object class for the component in which you are working. The objects are not overwritten when you install new releases.
    You can also define your own object classes. If you do so, select class names that begin with Y or Z to avoid conflicts with SAP names.
    Creating an Object
    Enter a unique object name and the fields that belong to the object. Object names must begin with the letter Y or Z in accordance with the naming convention for customer-specific objects.
    You can enter up to ten authorization fields in an object definition. You must also enter a description of the object and create documentation for it.
    Ensure that the object definition matches the AUTHORITY-CHECK calls that refer to the object.
    Do not change or delete authorization objects defined by SAP. This disables SAP programs that use the objects.
    You can regenerate the profile SAP_ALL after creating an authorization object.
    Best Regards,
    Rajesh
    Please reward points if found helpful.

  • How to create a Business Object

    Hi All,
    How to create a Business Object.
    If any material is avaliable Please mail me to [email protected]
    Thank you,
    Ramu N.

    Hi,
    Check this SAP help link,
    http://help.sap.com/saphelp_nw2004s/helpdata/en/4f/5668735cf211d194a30000e82dec10/frameset.htm
    Thanks and Regards,
    Bharat Kumar Reddy.V

  • ADF Faces RichTable doesn't validate but still display changed data

    Hello,
    I think I miss something in the ADF Faces lifecycle management. Can you help me?
    In a adf faces/jsf page,
    1- I have a RichTable which DataModel is based on a List<Department> stored in a managed bean (session).
    2- I have a button "Cancel" with immediate=true partialSubmit=false (I don't use PPR) and an ActionMethod that does a few changes (not in the model) and return "success".
    When I modify a value in the table (that has some af:inputText) and click on the Cancel button, the underlying List<Department> instance isn't changed (Which I expect because of the immediate=true property!). But the table still display the changes I've typed in the page. How can I reverse the data displayed in the table to before my change in the UI (in a simple manner)? What do I miss?
    Best Regards
    Gregory

    Hi,
    immediate = true makes sure that the component is evaluated before all the other. In addition the value change event fires before the model update to give you the opportunity to prevent the update. I don't know what your managed bean code is doing, but the fact that the table has the update indicates the RC table component to work properly. Your table model isn't updated, which I don't think will be automatic. So I assume you will have to access the current selected row, get the row object and pass it to the list for an update
    Frank

  • How to create a ClobDomain object with a default's different charset.

    Hi,
    I'm developing a 10.1.3. ADF Faces application that need to upload a File to a CLOB column. The user will usually upload a text file CP1252 charset, but in samples like this:
    // read data into a character array
    char[] data = {'0','1','2','3','4','5','6','7','8','9'};
    // write the array of character data to a CLOB
    writer = ((CLOB)my_clob).getCharacterOutputStream();
    writer.write(data);
    writer.flush();
    writer.close();
    The writer object is always a defaults charset writer.
    Does anybody knows how to do this?
    Thanks,
    Edited by: Samuel Fisch on 05/01/2010 02:06

    Samuel,
    My understanding is that unicode should be able to hold all possible characters codes. So you upload something in unicode, store it in the db and later on view it from the db you should see the contents of the clob (in the default encoding of your pc).
    The question for me is if the db can store all character codes. this is not the case if you use an oracle db and have not set the db character code to unicode (i.e. utf-8). In this case all characters of the input stream which are not part of the db character set are mapped to <b>one</b> special character code which you can't read. When you read the clob back you see some strange characters.
    This is not the problem of writing/reading the clob but a problem with the db character set.
    If you load data to the clob from a system using windows-1252 character set and this data contains some special characters like 'öäü', the db character set is set to utf-8, you should be able to read the clob data on a system using iso-8859-1 character set (or any other which have 'äöü') and see the special characters. That's the reason the reader/writer uses the system default character set.
    If you see a different behavior, describe where you see the error or wrong characters.
    Timo

  • How to create a text object at runtime?

    Hi,
    I am using crystal reports for visual studio 2010 and using c# to programming.
    I need to create  a text object in a specific section like section 2. and also I need to control the text object's position and text.
    I tried to move a object like:
    reportDocument1.ReportDefinition.Sections[j].ReportObjects<i>.Left = 0x8760;
    but object's position doesn't change at all.
    How can I do these (create a text object and change a object postion)?
    Thanks

    Hi Don,
    Thank you.
    I have downloaded a RAS ( report application Server ) sample.
    The sample uses the Business Objects Enterprise XI release 2. I am using win 7 and crystal reports for vs2010. Can I use this version of crystal reports to create  a text object at runtime? If not, what is the lowest version I have to purchase to achieve what I want?
    Basicly I need following capabilities at runtime:
    1) craete text objects, line objects, image objects.
    2) change text object, line object and image object positions, sizes, values of text object. If can I like to be able to change font as well.
    3) supress objects, sections. 
    4) change section's height

  • How to create a BufferedImage object using a .png file on harddisk

    For some application of JFreeChart I want to create a BufferedImage object from png file on harddisk.
    Can anybody tell me how to achieve this?
    Thanks in advance.

    See [this thread|http://forum.java.sun.com/thread.jspa?threadID=5144115].

  • How to create a Generic Object Services for a standard tcode.

    Hi,
    We have a requirement where we are depreciating the assets (standard transaction ABAA) using a custom BDC program. We need to maintain a history (called audit trail) for the particular asset that has been depreciated using this program. For this audit train we have been asked to use "Generic Object Services" in transaction code ABAA.
    Unfortunately, Generic object services are not available in this transaction code. Can you please suggest me how to create "Generic Object Services" for a particular standard transaction code. Also, we have show the details of custom workflow that follows the approval process in order to depreciate the asset. how to show this workflow details using Generic Services. This is a very critical issue, any help will be very help ful.
    Please let me know should you require more information on this topic.
    Thanks,
    Ashish

    Instead of copyg the std fm to z, do the following,
    1. Go to se37 open FM VIEW_KURGV in display mode.
    2. Click on the spiral icon on the top.
    3. Then in menu go edit->enhancment options -> show implicit enhancement
    4. """""""""""""""""""""" kind of lines will appear in the cde, just rt click on the line at the place u want to insert the code and select
         enhancement implementation create.
    5. Give apropriate name for thi , it will inset a n place to write your code.
    This is an std sap methodology and is supported in upgradde also.

  • How to create a system object in portal that points to a web dispatcher

    Hi,
    How do we create a system object in the portal for a web dispatcher? The web dispatcher in turn points to an ECC system. The path for communication is EP>Web Dispatcher>ECC
    Regards,
    Sridevi

    Hi,
    Connection test for the following succeeded:
    1. SAP Web AS Connection
      Test Details:
    The test consists of the following steps:
    1. Checks the validity of system ID in the system object.
    2. Checks if the system can be retrieved from the PCD.
    3. Check whether a SAP system is defined in the system object
    4. Validate the following parameters: WAS protocol; WAS host name
    5. Checks if the host name of the server can be resolved.
    6. Pings the WAS ping service; works only if the service is activated on the ABAP WAS.
    7. Checks HTTP/S connectivity to the defined back-end application
      Results
    1. The system ID is valid
    2. The system was retrieved.
    3. The system object represents an SAP system
    4. The following parameters are valid: Web AS Protocol (http) Web AS Host Name (mtw02spwp02:80)
    5. The host name mtw02spwp02 was resolved successfully.
    6. The Web AS ping service http://mtw02spwp02:80/sap/bc/ping was not pinged successfully. If the ping service is not activated on the Web AS, you can try to call the ping service manually.
    7. An HTTP/S connection to http://mtw02spwp02:80/sap/bc/bsp/sap was obtained successfully.
    2. ITS Connection
      Test Details:
    The test consists of the following steps:
    1. Checks the validity of system ID in the system object.
    2. Checks if the system can be retrieved from the PCD.
    3. Check whether the system object has a valid system alias
    4. Check whether a SAP system is defined in the system object
    5. Validate the following parameters: ITS protocol; ITS host name
    6. Checks if the host name of the server can be resolved.
    7. Checks HTTP/S connectivity to the defined back-end application
      Results
    1. The system ID is valid
    2. The system was retrieved.
    3. Retrieval of the default alias was successful
    4. The system object represents an SAP system
    5. The following parameters are valid: ITS Protocol (http) ITS Host Name (mtw02spwp02:80)
    6. The host name mtw02spwp02 was resolved successfully.
    7. An HTTP/S connection to http://mtw02spwp02:80/sap/bc/gui/sap/its/webgui was obtained successfully.
    Next test for SSO failed:
    Test Connection with Connector
      Test Details:
    The test consists of the following steps:
    1. Retrieve the default alias of the system
    2. Check the connection to the backend application using the connector defined in this system object
      Results
    Retrieval of default alias successful
    Connection failed. Make sure that Single Sign-On is configured correctly
    Regards,
    Sridevi

  • How to create a Java Object dynamically

    I want to convert a "DataObject (SDO) " into "Pure java object".
    For this i want to create a java object with the fields in Dataobject, and this should be in generic way.

    I want to convert a "DataObject (SDO) "What is a "DataObject (SDO)"?
    into "Pure
    java object".What is a "Pure java object"?
    For this i want to create a java object with the
    fields in Dataobject, What is stopping you? Do you not know how do define a class? Do you think you can add fields to the Object class? If that's what you mean, you're out of luck.
    and this should be in generic
    way.What do you mean "in generic way"? "Generic" is a very generic term. There are lots of contexts in which it could apply and lots of different possible meanings for "generic way."
    You'll have to explain your queston more clearly.

Maybe you are looking for

  • Problem for deleting photos from hard drive within Iphoto 8

    Hi there, I am a new switcher, I bought a Macbook Pro last month... I tried to manage my photo library with Iphoto but I cannot succeed in deleting pictures within Iphoto interface. I've red some similar posts on this forum but nothing helped me. Whe

  • Font conundrum; Acrobat Pro 9.4.4

    Hey all, Tried "search" for topic, but returned no results (I understand the search function is currently a little awry), so sorry if it's been covered before. I've encountered the following problem random times, but have narrowed it down to "Reduce

  • How much data does facetime use over wifi? on 5gb mifi

    so can any1 tell me how much or how long facetime hours/minutes will i get out of my 5gb wireless mifi (wi-fi)

  • Socket excpetion

    Hi Folks, I am getting this exception repeatedly in the logs. I have no idea why it is happening. Can any one help me out of this please? Input/output error: java.net.SocketException: Broken pipe javax.servlet.jsp.JspException: Input/output error: ja

  • What is use of TRANSPORTING

    Hi  to all , Please can any body tell me purpose of  TRANSPORTING , what does it do and why we use it with any example . Regards Pavneet Rana