How to Sort single column in webdynpro table

Hi all
I have requirement as follows.
i have webdynpro table with the following columns like Date,firstname,lastname,address etc.
now when i run the the application the table is populating the data at runtime that is fine.
i need as soon as table is loaded , Date field in the table should be displayed the values in the decending order...i have the requirement as follows...
how to sort the single column in table ...by default the values of the column displayed with decending order as soon as table displays at runtime....i dont want to click any button specific button to do the sort for that column
Regards
bindu

Hi, I solved the same problem by modifying the sort() method in the default TableSorter class so that it takes a column id and direction rather than an event.
I assume you have read the TableSorter tutorial.
Like this. (This was done on nw ce 7.1 btw but may work on older versions as well.
Oh and then you just call the sort method right after you have made the request
//Code that goes into controller/view to execute sorting
wdContext.currentContextElement().getPensionplanTableSorter().sort("MyColumnId", "Up", wdContext.nodePensionPlan());
//Part of TableSorter.java
//The original method that needs an event. Now it just calls the new method
public void sort(IWDCustomEvent wdEvent, IWDNode dataSource) {
     // find the things we need
     String columnId = wdEvent.getString("selectedColumn");
     String direction = wdEvent.getString("sortDirection");
     sort(columnId, direction, dataSource);
//This is the new method.
public void sort(String columnId, String direction, IWDNode dataSource) {
     if (columnId == null || direction == null ) {
          return;
     IWDTableColumn column = (IWDTableColumn) table.getView().getElement(columnId);
     NodeElementByAttributeComparator elementComparator =
(NodeElementByAttributeComparator) comparatorForColumn.get(column);
     if (elementComparator == null){
     //not a sortable column
          column.setSortState(WDTableColumnSortDirection.NOT_SORTABLE);
          return;
     // sorting
     elementComparator.setSortDirection(WDTableColumnSortDirection.valueOf(direction));
     dataSource.sortElements(elementComparator);

Similar Messages

  • How to grey out one single column in a table control of TPMOE

    Hi Experts,
    Any body please tell me how to greyout a single column in a table control of TPMOE.
    Help needed ASAP.
    Thanks,
    sreenivas.

    lr_result      TYPE REF TO if_bol_bo_property_access
    lr_iterator TYPE REF TO if_bol_bo_col_iterator
          CALL METHOD lr_iterator->get_by_index
            EXPORTING
              iv_index  = index
            RECEIVING
              rv_result = lr_result.
          CALL METHOD lr_result->get_property_as_value
            EXPORTING
              iv_attr_name = 'TRANSFER_STATUS'
            IMPORTING
              ev_result    = lv_status.
    if  lv_status = x and component = cost_category.
    rv_disabled = true.
    else.
    call super.
    endif.
    INDEX will have the row number.
    Frame ur logic based on this.

  • I am unable to sort multiple columns in a table created in Pages.

    I had been using Appleworks up until I installed Lion and have now switched to iWork. I created a table within a Pages document and am able to sort a single column (using the Table Inspector and choosing Sort from  Edit Rows and Columns) but the Sort option is grayed out when I attempt to sort multiple columns.
    In another post, someone talked about this being a problem if you have merged fields. I do not believe I have done this (to be honest I don't know the function of merging fields).
    This is very frustrating as I was easily able to sort these tables in Appleworks.

    Sharon Anderson wrote:
    Thanks for your quick response! I have been trying that but then found that Numbers would only let me print in landscape view so I had to paste the table back into Pages. Is there a way to print in portrat view (from Numbers?)
    Not so. In the lower left corner of the window, there's an icon that looks like a piece of paper. If you see this:
    you are in Sheet View, or normal, mode. If you see this:
    You are in Print View mode. Now you see the icons for portrait and landscape modes. Click your choice. Then arrange your content to fit the pages as you wish.
    Jerry

  • How to sum the column in a table seperated by sign.

    How to sum the column in a table separate by sign.
    For Example:
    A B
    10 MOHAN
    -15 KUMAR
    -25 MARCH
    50 MAY

    SELECT  SUM(CASE SIGN(A) WHEN 1 THEN A ELSE NULL END) SUM_POSTIIVE,
            SUM(CASE SIGN(A) WHEN -1 THEN A ELSE NULL END) SUM_NEGATIIVE
      FROM  tbl
    /SY.

  • How to delete a column from the table control in module pool?

    Hi,
      can any one please tell How to delete a column from the table control in module pool?
    thanks in advance
    warm regards
    HareeshKumar N

    hi hareesh,
    I think it is better to hide it.
    How to hide: You can check this link
    Dynamic Hide column in table control

  • How to Delete a Column in Internal Table

    Hi All,
    Does any one know ,How to Delete a Column in Internal Table?

    Hi,
       For deleting the column in the internal table, you have to eliminate the field which you want to delete.
    loop at itab into wa.
      move corresponding wa to wa1.
    append wa1 to itab1.
    clear wa1.
    clear wa.
    endloop.
    wa1 is the workarea without the field which you want to delete.
    itab1 is the internal table which consists of the deleted column.

  • Adding a single column to mulitple tables

    I have to add a single column to 664 tables.
    I can copy the column from the table it is originally created in.
    Is there a way to paste the column in all the remaining tables?
    It doesn't work by selecting all the tables in the design ('Ctrl + a', right click 'paste').
    It does work if I click each individual table ('Ctrl', left click) but i do not want to have to click each of the 664 tables.
    Thanks,
    Nic

    You can create script for this purpose for all 664 tables.
    And if you use MS Excel to create that script, you will feel a bit relieved. Its not too much difficult, just simple steps to create the script.
    In MS Excel
    1- In first column Write >>Alter table [Drag this cell for 664 times]
    2- In second table Paste >>Table_Name [Select all tables Ctrl+a, and copy table names in this column 664 Tables will come there]
    3- In third column Write >>Add (COLUMN_NAME  VARCHAR2(50)); [Drag this cell for 664 times]
    Now Script is Ready, You can select all three columns now and paste them in notepad file.
    And execute this script in Database;
    Hope this will resolve your problem.

  • How to find the column name and table name with a value

    Hi All
    How to find the column name and table name with "Value".
    For Example i have value named "Srikkanth" This value will be stored in one table and in one column i we dont know the table how to find the table name and column name
    Any help is highly appricatable
    Thanks & Regards
    Srikkanth.M

    2 solutions by Michaels (the latter is 11g upwards only)...
    michaels>  var val varchar2(5)
    michaels>  exec :val := 'as'
    PL/SQL procedure successfully completed.
    michaels>  select distinct substr (:val, 1, 11) "Searchword",
                    substr (table_name, 1, 14) "Table",
                    substr (t.column_value.getstringval (), 1, 50) "Column/Value"
               from cols,
                    table
                       (xmlsequence
                           (dbms_xmlgen.getxmltype ('select ' || column_name
                                                    || ' from ' || table_name
                                                    || ' where upper('
                                                    || column_name
                                                    || ') like upper(''%' || :val
                                                    || '%'')'
                                                   ).extract ('ROWSET/ROW/*')
                       ) t
    --        where table_name in ('EMPLOYEES', 'JOB_HISTORY', 'DEPARTMENTS')
           order by "Table"or
    SQL> select table_name,
           column_name,
           :search_string search_string,
           result
      from cols,
           xmltable(('ora:view("'||table_name||'")/ROW/'||column_name||'[ora:contains(text(),"%'|| :search_string || '%") > 0]')
           columns result varchar2(10) path '.'
    where table_name in ('EMP', 'DEPT')
    TABLE_NAME           COLUMN_NAME          SEARCH_STRING        RESULT   
    DEPT                 DNAME                ES                   RESEARCH 
    DEPT                 DNAME                ES                   SALES    
    EMP                  ENAME                ES                   JONES    
    EMP                  ENAME                ES                   JAMES    
    EMP                  JOB                  ES                   SALESMAN 
    EMP                  JOB                  ES                   SALESMAN 
    EMP                  JOB                  ES                   SALESMAN 
    EMP                  JOB                  ES                   PRESIDENT
    EMP                  JOB                  ES                   SALESMAN 
    9 rows selected.

  • How can I select columns from a table EMP, using Select statement?.

    Hi Friends,
    How can I select columns from a table EMP?.
    I want to select columns of EMP table, using select statement.
    Please reply me urgently.
    Shahzad

    Something like this:
    scott@DBA> select empno,ename,job from emp;
         EMPNO ENAME      JOB
          7369 SMITH      CLERK
          7499 ALLEN      SALESMAN
          7521 WARD       SALESMAN
          7566 JONES      MANAGER
          7654 MARTIN     SALESMAN
          7698 BLAKE      MANAGER
          7782 CLARK      MANAGER
          7788 SCOTT      ANALYST
          7839 KING       PRESIDENT
          7844 TURNER     SALESMAN
          7876 ADAMS      CLERK
          7900 JAMES      CLERK
          7902 FORD       ANALYST
          7934 MILLER     CLERK
    14 rows selected.Check the documentation:
    http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_10002.htm#sthref9697
    Message was edited by:
    Delfino Nunez

  • How do I Freeze Columns in HTML Tables

    How do I Freeze Columns in HTML Tables when scroll vertically as well as horizontally? (header and some columns on LHS). I generate a JSP report which got more than 1000 rows. Please advise. Thanks.

    Gooooooooooooooooogle searched "Freeze Columns in HTML Tables"
    So many solutions available !!!!!
    see the 1st link
    http://web.tampabay.rr.com/bmerkey/examples/locked-column-csv.html

  • How to access single column in table?

    Hi,everybody!
    How to access a single column in table.
    I sorted my table with standard TableSorter.
    Now I need to get one column from this table to
    do something with it's data.How do I get it?
    Regards,
    Michael

    Hi Michael,
    If you just want to retrieve the data, you could use the following code.
    //Get the node which the table is bound to
    IWDNode node = wdContext.nodeTable();
    //iterate thru the elements
    for(int i = 0 ; i<node.size();i++)
      IWDNodeElement ne = node.getElementAt(i);
      Object value = ne.getAttributeValue("<column name>");
      //Here you have the data in the value variable
      //and you can manipulate this now
    Regards,
    Sudeep

  • How to disaply multiple column of a table in a single flex datagrid column

    Hi,
    I have a table in my database which has say 3 column (Firstname,LastName,Location). I wanted to display these 3 different values in a single column in flex datagrid.
    Could you please help me out in this
    Thanks,
    Pratik

    Generally, in such scenarios each column is made corresponding to the column in database only and not single column.
    However, we can setStyle of a datagrid to make it appear as if all three  columns have been populated in single.
    set verticalGridLines="false" for dataGrid. Further cosmetic changes can be made to realise the required look.
    In some cases, labelFunction of a datagridColumn also suffices the need.
    Tanu

  • How to disable certain columns of a Table?

    hi all,
    I wish to fill a pattern of 8 digital signals (only 1's & 0's) in a Table.
    Is there any way to restrict the user from typing char or num other than a 1 or a 0?
    Since the table is a string, I'm having confusion how to do this.
    Secondly, the table would have by default 12 columns visible on the Front Panel, excluding both the headers.
    But the No. of Columns is based on a parameter called Duration that ranges between 4 & 256.
    What I want the user to do is to key in 1's & 0's for the Duration chosen.
    Since it'll be tedious to key in for large values of Duration, I've given the option of Set Row(s) & Reset Row(s),
    that will fill with either 1 or 0 respectively for the chosen Row Value.
    Is there any way to disable the remaining columns of the Table, ie, those unfilled columns,
    when the user scrolls horizontally? I don't know how to achieve this.
    I went thro' the Properties of the Table, I don't understand some of their functionalities,
    like SelStart, SelSize etc.
    I wonder why a Property like Disable Array Elements for Arrays is not provided for a Table
    to Disable the columns we want to do so, or is it my gross ignorance, I don't know.
    Experts pls clarify me & help me out.
    Regards,
    Partha.
    - Partha
    LabVIEW - Wires that catch bugs!
    Attachments:
    Set Eventframe1.vi ‏409 KB

    Another option is to do this:
    Slightly more elegant, but also more potential for bugs (e.g. the users can tab into the column).
    craigdobis wrote:
    You can lower your overhead by using these "professional" looking indicators and controls. They are limited in functions and properties, thereby causing a smaller VI in file size.
    Nice. I didn't think about that. Looks like a VI with a single system boolean takes ~20% less space than one with a standard boolean.
    P.S. In general, I would say there are considerably better arguments for using system controls than memory issues.
    Try to take over the world!
    Attachments:
    Disabled Column.png ‏5 KB

  • How to read BLOB column from a table in SQL or PL/SQL

    I have table which is having one BLOB data type column . Ihave inserted few rows in that table . Now i want to see wheather BLOB column has been inserted properly or not . How to read that column through SQL or PL/SQL.
    Can anyone help me to do this.

    You can only manipulate LOBs in PL/SQL because you have to use the DBMS_LOB package.
    Check out the Oracle Developer's Guide

  • How to use single column in a group by clause

    hi frs
    i hve used sum function in a sql how to use a single column in a query.
    for ex
    select sum(sal),ename,job,deptno,empno from emp
    group by deptnowhether its possible to use single column in a group by class.
    i want like this because in my custom report i need it. Report query has more than 30 column so its not possible to use 30 columns in a group by.
    pls help.
    Thanks
    Rajesh

    Maybe something like this -
    Select ename, job, deptno, empno, sal, col1, col2, col3, col4 ......, coln
    From
    Select SUM(sal) sal, deptno deptno_i
    From Emp
    Group By deptno
    ,Emp
    Where deptno = deptno_i
    Shailender Mehta

Maybe you are looking for

  • Update a single column of a table

    Hi Champs, I want to update a single column of table PA0000. Following is ABAp code I am using: UPDATE pa0000 SET massn = wa_upd_actn71-massn                    WHERE pernr = wa_upd_actn71-pernr AND                           massn = c_crct_entry. whe

  • E4200 v1- problem creating a shared folder for the FTP server.

    Hi,  I'm trying to share an external USB harddrive (4TB- HFS+) that is attached to my e4200 router.  I'm trying to set up the FTP server, but when I try to create a shared folder, I get kicked out of the browser based interface for the router just as

  • Regarding f-53 transaction

    hi gurus,               i have one senario to be completed, the senario is like               if any posting happends via f-53 transaction, for those postings we need to fill a idoc and send it to bank. for that what i did is i found a bte which will

  • Actual episode is not loading (pass is active)

    I have an active series pass but the actual episode is not downloading, although its available in the store (mentalist, series 5, episode 14)

  • Add logo in standard invoice

    hello, in MM v already make the transaction and prepaid the purchase order ok, in that purchase order, v have to put the logo and address, please explain me how to add the logo and address in the standard purchase order, please explain me in step by