Dynamically reordering columns in ADF Faces Table

The Rich UI components (see ADF Faces Rich Client Components - Marrying JSF and AJAX together) that the ADF Faces library will contain with the JDeveloper 11g release - and hopefully before that moment - will allow end-users to do all sorts of manipulations with Tables. They will be able to resize columns an drag & drop columns to change the order - much like you can do in Spreadsheet applications like Excel. However, those components are not yet available to us. Yesterday my customer asked me if he could have offer the option to re-order columns in a table to his end users. That means that in any table component, the user can decide which column should be displayed first, which one second and which one last. It happened to be the same customer who was after the feature to show/hide columns at run-time, a challenge easily resolved in a previous article: Having the end-user hide and display columns in a JSF Table Component (http://technology.amis.nl/blog/?p=1331).
I have written an article that shows how we can implement this feature: have the end-user specify the order of the columns in the table. I have used ADF Faces for this demonstration, but any JSF implementation will do. See: http://technology.amis.nl/blog/?p=1334 for the article.
best regards,
Lucas

Well issue is that
I have a list of values that can be chnaged any time during application execution sya its list of Fav Fruits..
and in an other page i need a data table having these fruits as coulmns and their details as rows...
how to achieve this..
we can not guess the number of columns before time.. so can make the estimate and hide them.

Similar Messages

  • An extra column of a query in an ADF Faces Table?

    Hi to all OTN Community...
    I use ADF Faces, Toplink and EJB 3.0 in JDevelooper 10.1.3.1.0, and i have a question...
    I need to show in an adf faces table, the result of a query like this
    SELECT COLUMN1, COLUMN2, COUNT(*)
    FROM TABLEX
    GROUP BY COLUMN1, COLUMN2
    I do this query in the TableX named queryes...and then i have acces to this named query in the dataControl, but, when i drag and drop the dataControl to a jsf page, this only shows the columns of the tableX. Then, i want to know, ¿How can i show the count(*) column in the page in a dataControl?
    PD: i want to show in the adf faces table the same result if i execute that query in an sql client.
    Thanx in advance...
    Darklorddany

    Darklorddany,
    The solution to this is to add an additional method on your EJB 3.0 session-bean that exposes an dynamic TopLink report (projection) query.
    The TopLink code within the method would leverage your existing TopLink mappings to do the query like:
            ReportQuery rq = new ReportQuery(Employee.class, new ExpressionBuilder());
            rq.addAttribute("firstName");
            rq.addAttribute("lastName");
            rq.addCount();
            rq.addGrouping("firstName");
            rq.addGrouping("lastName");
            List<ReportQueryResult> results = (List<ReportQueryResult>)session.executeQuery(rq);The ReportQueryResult objects are very generic map/row type containers that will not work well in your ADF binding layer. With JPA you can specify and ad-hoc Java class to contain such projection results that make them a little easier to use in clients. This functionality will be available in the next release of TopLink. Until then you will need to write some code to convert to your own result class for this query.
    In my case I'll create a simple POJO like:
        public class EmployeeNameCount {
            private String firstName;
            private String lastName;
            private int count;
            public EmployeeNameCount(String firstName, String lastName, int count) {
                this.firstName = firstName;
                this.lastName = lastName;
                this.count = count;
            public String getFirstName() {
                return this.firstName;
            public String getLastName() {
                return this.lastName;
            public int getCount() {
                return this.count;
        }Now I combine the previous report query code into an EJB 3.0 session bean method:
        @TransactionAttribute(TransactionAttributeType.SUPPORTS)
        public List<EmployeeNameCount> findEmployeeNamesWithCount() {
            Session session = getSessionFactory().acquireSession();
            ReportQuery rq = new ReportQuery(Employee.class, new ExpressionBuilder());
            rq.addAttribute("firstName");
            rq.addAttribute("lastName");
            rq.addCount();
            rq.addGrouping("firstName");
            rq.addGrouping("lastName");
            List<ReportQueryResult> results = (List<ReportQueryResult>)session.executeQuery(rq);
            session.release();
            List<EmployeeNameCount> empNameCounts = new ArrayList<EmployeeNameCount>(results.size());
            for (ReportQueryResult rqr: results) {
                String fname = (String)rqr.getByIndex(0);
                String lname = (String)rqr.getByIndex(1);
                int count = ((Number) rqr.getByIndex(2)).intValue();
                empNameCounts.add(new EmployeeNameCount(fname, lname, count));   
            return empNameCounts;
        }You will also need to make sure the method exists on your EJB 3.0 session bean's interface as well. Then regenerate the data control for your session bean and you should have access to drag and drop this query with its results into your JSF pages.
    As mentioned this use case will be much simpler and declarative in the next release.
    Doug

  • URGENT: ADF Faces table updating issue.

    I have a project that uses JSF, ADF Faces, EJB 3.0, and the ADF binding framework.
    In this project, I have a page with a databound ADF Faces Table. The table has a number of read-only columns and two read-write columns. I also have an Edit button that allows the user to pop up a dialog box to edit the selected row of the table. When the user clicks OK in the dialog box, the data is passed back to the main page and the table is updated.
    Everything works correctly for the read-only columns. For the read-write columns, however, the table data does not get updated following an edit. This is what I have found:
    1. The table row data gets passed in to the Edit dialog correctly.
    2. The data gets passed back correctly.
    3. The model gets updated correctly (up to and including the database).
    4. Looking at the iterator in the debugger shows the correct, updated data.
    5. When the table row is getting redrawn, the getter calls for the read-write columns return the updated data.
    6. As mentioned above, the read-only columns get updated correctly.
    7. Updating the read-write columns directly from the table works correctly.
    So, the problem appears to be in the GUI layer. I suspect that, somehow, the submitted values of the read-write columns are not getting set properly, but I cannot figure out how to do this.
    Note that clicking on the Edit button results in a partial submit. In the return listener, I add a call to AdfFacesContext.getCurrentInstance().addPartialTarget(getRecipientTable()) in order to redraw the table (getRecipientTable() is the bound value of the ADF table).
    Please help! We are so close to production and we need to fix this.
    Thanks,
    Ara

    Hi,
    I don't have a testcase for this, so I just come up with ideas to try
    1. refresh the parent container of the table. It seems that the input text components are not triggered to refresh if the refresh is on the table.
    2. If using ADF, make sure the update is performed directly on theiterator (which automatically is the case if you use a ADF bound form for this)
    3. Check if executing the table iterator and then setting back the current row makes a difference
    Frank

  • ADF Faces table with checkboxes

    Hi,
    My dev env: jdev 11.1.1.2.0
    I like to implement something like yahoo mail, with a checkbox at the column header. If selected,
    all rows will be selected. I assume Yahoo's email is using javascript. How do I achieve the same
    thing here with adf faces table? Is there any tutorial I could reference.
    Thanks in advance!
    Edited by: user1145549 on Jul 13, 2010 8:18 AM

    Hi,
    U can also check this too.... it very simple approach to Implement Check box
    http://theo.vanarem.nl/2010/07/07/adf-checkbox-representing-a-yes-or-no-value/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+orana+(OraNA)&utm_content=Netvibes
    Regards,
    Suganth.G

  • ADF Faces Table with a Total row calculated?

    Hi there OTN Community:
    I have another doubt.
    I have an EJB dataControl, and i use one of his collections to display the data in an ADF Faces Table. One of the columns of the Adf Faces Table is numeric, And i have to display the Total of that Column.
    I only shows 10 rows per screen, but i need to show the total of all the rows.
    How i can calculate it?

    Mmmmm..... You're right!...I will try that.
    Thanx :)
    Hey, and....You know? i was thinking, maybe i can get the iterator and then capture each object of the iterator to compute the total. That is a crazy idea?, its possible?, its not recommended? or its ok too? :P
    Thanx in advance.
    Dany

  • Adf faces table and applet in jsf page navSubmit not working in IE

    Hi
    I have a jsf page with adf faces table and applet , previous / next navigation is not working for my table when i add the applet to the same page , it is working in firefox but not in IE .
    I have no clue what to change , can any one help. below is the sample code for my jsf page
    Best regards
    Srinivas
    Code follows, not sure how to format the code here
    <h:form>
    <af:panelPage title="Test Adf faces table and applet">
    <af:panelHeader text="Orders">
    <af:table value="#{bindings.Orders.collectionModel}" var="row"
    rows="#{bindings.Orders.rangeSize}"
    first="#{bindings.Orders.rangeStart}"
    emptyText="#{bindings.Orders.viewable ? 'No rows yet.' : 'Access Denied.'}"
    id="orders" >
    <af:column sortProperty="order"
    headerText="#{bindings.Orders.labels.order}">
    <af:commandLink text="#{row.order}"
    id="orderNumber"
    onclick="showOrder(#{row.order})"
    disabled="false"/>
    </af:column>
                   </af:table>
    </af:panelHeader>
    <af:objectSpacer width="10" height="10"/>
    <af:panelBox>
    <f:verbatim>
    <div id="appletDiv">
                        <applet here />
                        </div>
    </f:verbatim>
    </af:panelBox>
    </af:panelHorizontal>
    </af:panelPage>
    </h:form>

    Sorry about the format, it looked okay when i previewed it , now it looks like terrible

  • How to select rows in adf faces table

    Hi guys
    im new to adf faces .I created a adf faces table with some data.My task is to select one row and if i click tht row, the data of tht row will be displayed in an input text fileds.How can i select a row in a adf faces table and give actions to rows...i read so many tutorials...none of them didnt give a correct idea....plz help me...
    thanks in advance..
    rajiv

    You're here in the Sun JSF forum, not in the Oracle JSF forum.
    Try here: JDeveloper and ADF
    If the ADF datatable is technically comparable with the RI datatable, check http://balusc.xs4all.nl/srv/dev-jep-dat.html to get some insights how to retrieve the selected row object.

  • ADF faces tables - range navigation table footer

    Hi,
    I have a strage situation using ADF Faces' table, sometimes it displays range navigation on top and bottom of the table and sometimes only on top of the table. Is it possible to show always the range navigation on top and bottom of the table? How? If not, can someone give me an example of using an selectRangeChoiceBar to implement navigation on bottom of the table?
    Thanks in advance.
    Best Regards,
    Giuseppe

    bump

  • ADF Faces table selection from commandLink?

    I'm using the ADF faces table component and would like to allow my users to make a selection out of the table from a click onto a commandLink rather than using the tableSelection facets. How can I determine the row they have clicked on?
    Thanks for any help,
    Jeff Cooper

    Hello
    Sorry to restart this thread again, but if i do table.getRowData() i don't get any rows, the rowcount remains 0, but my table contains many data rows.
    Is there anybody who knows what the reason can be?
    thx

  • ADF-Faces table and mass data

    Hello Oracle,
    we consider to use ADF-Faces with Spring and TopLink or Hibernate that supports all important commercial databases.
    We need a solution for selecting mass data and show them using a ADF-Faces component.
    ADF-Faces table looks great and is fine for for some hundred datasets. But we have customers who could do a select over 80.000 or more datasets and it cannot be the solution to load them completly in collection-model in memory.
    Do you have a solution or do you plan somthing? A JSF data table component for mass data (e.g. load from database on every "next or "previous" click)?
    Regards
    Florian

    I'm pretty new to ADF Faces etc. but I know the ADF Table component supports paging. If you're using ADF Business Components as the persistence framework it supports paging out of the box giving you exactly what you're looking for.
    If you're using EJBs or Toplink I think you have to write your own paging interface but I don't know this for sure.
    Corey
    Message was edited by:
    cpuffalt
    Message was edited by:
    cpuffalt

  • Hide/remove column  in adf pivot table

    Is it somehow possible to hide or to remove column (I need to hide agregate column, but is it possible for regular data cell) dynamically when some conditions are met? I've tried getDataFormat and getheaderFormat methods to set width of the columns to 0, but it doesn't work. Also I've tried to set rawvalue of data cell to null/"" and width to 0 but without success to hide column. Problem applies to adf pivot table 11g.
    Thank You!

    HI,
    You have the option for the column as to be suppress or repeat
    Go to column properties and go to column format second tab select the option Suppress.
    Regards,
    VG

  • Problem in accessing ADF Faces Table portlet in Oracle 10.1.4 portal server

    I created one ADF Faces Portlet ,showing a simple table in 10.1.3.1
    When i do run from Jdevloper it works fine.
    But after registering it as WSRP in oracle portal server 10.1.4 ,when i am adding this portlet in a page ,it is giving javasript error.
    I am not able to figure out problem.
    Any help will be appreciated.
    Thanks in Advance....

    It is giving error in this line.
    addJSL("http://ipaddess/portal/page/portal/TEST/COMPANY/test82?mode=16&_rtarget=36_14157_36_14154_14154&_piref36_14157_36_14154_14154.__ora_type=proxy&_piref36_14157_36_14154_14154.__ora_resource=http%3A%2F%2Fisaha%3A8888%2FListAll3%2Fportletresource%2FC%253A192.168.11.162%253A-ce9ef7a%253A12214125dd4%253A-7ffe%2FS%253A192.168.11.162%253A-ce9ef7a%253A12214125dd4%253A-7ffc%253AE%253A0%253A192.168.11.162%253A-ce9ef7a%253A12214125dd4%253A-7ffd%2Fadf%2FjsLibs%2FCommon10_1_3_2_0.js"
    But instead of http:// if it is http://// It is ok.But is is generated by Portal server.
    Do I need to install any patch.
    Any help will be appreciated.
    Thanks in advance ......

  • JDEV 10.1.3: Using "Create" binding on BC view object with ADF Faces Table

    Hello,
    I am trying to get this to work, but to no avail:
    I've got a very simple page (ADF Faces - JSPX) created by dragging an iterator from the data control pallete on to my page and picking "ADF Table..." as my chose to create. This creates a table on my page that allows me to edit each row in place. Very nice.
    Now, I dragged the create operation for that iterator on to the page. What I had hoped to see is that when I click "Create," a new blank row appears in my table (well, at least a row that is blank except for any default values specified in the EO/VO and my overriden create() method).
    However, this doesn't happen. The page submits and refreshes, but no blank row shows up. I initially tried setting the Create button to do partial submit and setting the partialtriggers for the table to include the Create button, to no avail. I also tried it without the partial submit with the same results.
    So:
    1). Should this work, or is this behavior a bug.?
    2). If not, is there a different/better way of doing it?
    Regards,
    John

    G'day John
    I think I can give you a hint of what is occuring... I'm still trying to work out what is happening exactly.
    In JDev 10.1.2 UIX, when the user invoked the create action, they would see the blank record added to the underlying table. Under 10.1.3 Faces the functionality is somewhat different.
    When you the user clicks on the create action a blank record is created but not shown in the table control. To prove the blank record is there try this:
    1) Build an ADF Input Form based on the same VO iterator
    2) In your JSF navigation, create a navigation case between the existing page and the new page, and another back again,
    3) In the existing page, map the Create button's action attribute to navigate to the ADF Input Form
    4) In the ADF Input Form, map the Submit button's action attribute to navigate to the ADF Table page.
    Now when you run your app, notice when you create a new record in the ADF Table which automatically takes you to the ADF Input Form, note the blank record, and the details you enter into the record here and submit, are then visible in the ADF Table on the return.
    This is a long way of proving that the new record is in the table. It's just you can't see it.
    I have a theory which I'm trawling through the newly updated documentation to verify. This issues goes back to the VO createRow vs insertRow method calls that have been documented by Steve Muench a couple of times. I'm guessing the table control is now smarter and doesn't show createRow records, only insertRow records.
    Read one of Steve's posts here regards the createRow vs insertRow method calls:
    http://www.oracle.com/technology/products/jdev/tips/muench/blankrow/index.html
    If I find anymore info I'll endeavour to post it.
    Meanwhile this of course doesn't help you if you actually want to show the blank row in the ADF Table editable control, but I'd thought I'd give you an idea of what's happening behind the scenes.
    Hope this helps.
    CM.

  • ADF Faces: Table detailstamp facet question

    HI!
    Is it possible to make detailstamp disclosured by default? How?
    Thanks in advance.
    Regards,
    Gustavo

    Hi there!
    Maybe it is not the right place to ask ADF Faces related questions...
    Can someone give me a pointer to where ask questions about ADF Faces?
    Thanks
    Thomas

  • HOW to add Dynamic Columns in ADF Faces CORE Table

    In ADF im going to display the dynamic column in Coretable,
    Header are displaying very fine. but im unable to display rows sucessfuly,how to resolve.
    Second thing is that JSF page isn't getting the value from dataList, whats wrong in JSF code.
    // JSF PAGE CODE
         <af:table binding="#{backing_test1.table1}" id="table1"
    value="{backing_test1.dataList}" var="myRec"/>
         public void setTable1(CoreTable table1) {
         this.table1 = table1;
         public CoreTable getTable1() {
    //create this table
    table1 = new CoreTable();
    CoreColumn dynamicCol;
    CoreOutputText outText;
    Application app=FacesContext.getCurrentInstance().getApplication();
    DCIteratorBinding iter = (DCIteratorBinding)bindings.get("listAllMonthsIter");
    RowSetIterator rsIter = iter.getRowSetIterator();
    rsIter.reset();
    Row row;
    while (rsIter.hasNext()) {
    row = rsIter.next();
    String header = (String)row.getAttribute("element");
    // element contain the value JAN, FEB...
    dynamicCol = new CoreColumn();
    dynamicCol.setHeaderText(header);
    String currRec = table1.getVar();
    outText = new CoreOutputText();
    ValueBinding vb = app.createValueBinding("#{myRec.value}");
    outText.setValueBinding("value",vb);
    outText.setRendererType("Text");
    dynamicCol.getChildren().add(outText);
    table1.getChildren().add(dynamicCol);
    public void setDataList(List dataList) {
    this.dataList = dataList;
    public List getDataList() {
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding =
    bindings.getOperationBinding("listAllMonths");
    if (operationBinding == null)
    return null;
    List dataList = (Vector)operationBinding.execute();
    return dataList;
    }

    Well issue is that
    I have a list of values that can be chnaged any time during application execution sya its list of Fav Fruits..
    and in an other page i need a data table having these fruits as coulmns and their details as rows...
    how to achieve this..
    we can not guess the number of columns before time.. so can make the estimate and hide them.

Maybe you are looking for

  • OBIEE 11g . Transparency of the color fill in Mapviewer

    Hi, How to set transparency level of the color fill in Mapviewer integrated with OBIEE 11g? Thank you for your time! Pavel

  • Imessage's taking ages to be received

    On My wife's iPhone - when sending iMessage's they go out straight away but can take 20-25 minutes to be received it can also take a similar time for her to receive messages.  . This does not happen to me and we are on the same network. This has only

  • How do you directly post a value to Local Currency 2?

    We have a situation where we need to manually revalue a posting. The Company Code currency is $ The Group currency is £ We have a balance that we need to wipe out in £ for our company code. If we use t code F-05 - when we select the document currency

  • DHCP service not working

    Hello, I have airport express base station and I have set it up to give DHCP IP addresses to wireless clients as I don't have any DHCP server in the ethernet LAN. But the Airport doesn't give out IP addresses at all. In the Internet tab, I have selec

  • Clustering & class/jar visibility

    we have a 'dev' instance on box 1...we can deploy a web app using the 'exploded directory structure', and put our sybase jdbc driver zip file in lib under j2ee/home...works great. we have a 'test' instance on box 2...with 2 instances of oc4j running