Input table sort for uncommited data

Hi OTN,
I have an input table on my ADF page. The table is based on a view object which has ORDER BY VALUE clause.
There is an opportunity to insert new rows and edit Value attribute of any row.
I would like the table always to be sorted by Value attribute before commiting the changes.
Input fields have autosubmit=true and I also have button which performs ADFUtils.findIterator(..).executeQuery() and refreshing the table (with addPartialTarget or table's partial trigger).
Besides I tried declarative column sorting.
By no means I succeeded to sort the table with new values without commiting data.
Is there any possibility to do this?
Thanks.
JDev 11.1.1.4

Hi,
After applying this code in a managed bean           System.out.println("ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES | ViewObject.QUERY_MODE_SCAN_VIEW_ROWS");
          trIter.getViewObject().setQueryMode(ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES | ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);
          trIter.getViewObject().setSortBy("NEnd");
          trIter.executeQuery();in-memory sorting really works.
But now I have a row with null NEnd first in my table. Without modifying query mode it was last just as I need.
It is now:null
10
20
30Can I bring null row back to last position?
Tried trIter.getViewObject().setSortBy("NEnd nulls last"); and trIter.getViewObject().setSortBy("deocde(NEnd, null, 9999, NEnd)"); with no success.
Edited by: ILya Cyclone on Jul 8, 2011 3:28 PM

Similar Messages

  • Table name for plan data

    Hi All,
    could you please give me table name for plan data. this is tcode where we can see for range of cost centers S_ALR_87013612 (range of cost centres) and cost elements as well. but our client wants to extract from the table which has the same values in the report S_ALR_87013612.
    from which table they need to extract.
    your early response will be highly appreciated.
    Regards,

    Dear,
    Try following tables..
    1. COKP - Primary planning
    2. COKS - Secondary planning.
    Regards,
    Chintan Joshi

  • "Old" table sorter for NW04

    Hi all,
    I'm using the "old" table sorter for Web Dynpro on a Netweaver 04 system. Everything is working correctly, but I don't know how to call the sort function without clicking on the Table Header.
    How can I automatically sort my table at runtime, the first time the table is shown?
    Is this possible?

    Hi  Palen
    I do think this facility is introduced with 04s.
    /people/bertram.ganz/blog/2006/03/07/enhanced-web-dynpro-java-tablesorter-for-sap-netweaver-04s
    This weblog says something about it.(Hope you have not read it ye
    Regards
    Pratyush

  • Table name for delivery date

    Hi
    I like to know the table name for the field Delivery date

    Hi Mahesh,
    The table is: LIKP  (SD Document: Delivery Header Data)
    Delivery Date Field : LFDAT
    Hope this helps you.
    Regards,
    Chandra Sekhar

  • How Bex flageffects internally effects the SID table entries for Master Dat

    Hi Every one,
    I do understand how the Bex flag setting works in relation to reporting like y we set the flag or y we dont set the flag when we do reporting or not on ODS.. <b>My question here is, i dont understand, how the SID tables or the master data tables or ODS tables get effected with this flag. Can some one explain me what kind of changes in the tables takes place with this flag setting and how it is used in the reporting..</b> How this thing is different with respect to Cube reporting process.. I do understand that ODS doesnt have Dimensions.. so i am just looking for conceptual clarification and not any forum links related to the Bex falg.. i have already gone through many links in the forum, but they didnt help me to clarify this process at table level which i am looking for... ANy help will be highly appreciated in SDN way..
    regards,
    kishore

    Thanks Durgesh but I have tried every master data test in RSRV.  I think because these document number characteristics don't have master data tables most of the tests return a message that the test does not apply to the characteristic.  These characteristics only have a sid table.

  • Creation of SO based on the input in table format  for bulk data : urgent

    Hi,
    The data from an external system will be sent to SAP in a bulk format and also as a Table. i.e. they are going to send around 30 Purchase orders from external system . I need to fetch all of them at a time and create SO for each one .
    Hence, anyone please provide a work around for the same.
    shyam

    HI Shyam
    Proceed as below:
    1. Identify the file layout like how it is going to be for multiple items.
    2. Upload the data to an internal table:
    3. Loop at internal table
    4. Populate the data required for BAPI structures
    5. AT END of PO number call a BAPI to create a Sales Order.
    Make sure you are clearing/refreshing the structures/internal tables for BAPI.
    Regards
    Eswar

  • Table Sorter for String displaying Numbers

    Hi All.
    I have a table whose one of the columns display numbers with data type string. This is becuase :
    1. RFC gives me as String.
    2. I have to display blank in case no value or zero is present (since int, long etc default to Zero, hence  
        not used).
    I have to sort this column as a number.Since the datatype is string, it sorts the numbers as string
    for example : if we have  values like : 2, 4, 3, 10, 19, 15, 20, 22
    currently as String it sorts as follows : 10, 15, 19, 2, 20, 22, 3, 4.
    but i want as follows : 2, 3, 4, 10, 15, 19, 20, 22.
    Useful answers will appreciated.
    Thanks and regards,
    Aditya Deshpande.

    In order to sort the node with attribute of type string; please use the following code..
    Here use the node where you store the string value..
    wdContext.nodeTest().sortElements(
                new Comparator() {
                   public int compare(Object o1, Object o2) {
                        // TODO Auto-generated method stub
                   IPrivateExperimentView.ITestElement ele1 = (IPrivateExperimentView.ITestElement)o1;
                   IPrivateExperimentView.ITestElement ele2 = (IPrivateExperimentView.ITestElement)o2;
                        return Integer.parseInt( ele1.getNumStr()) > Integer.parseInt( ele2.getNumStr()) ? 1 : -1;
    input :  "2", "4", "3", "10", "19", "15", "20", "22"
    result : "2", "3", "4", "10", "15", "19", "20", "22"
    vinod

  • ADF table sorting for non-english language

    Hi,
    I have an issue with sorting in af:table. When I click on column header data are sorted, but not quite correctly. If word begins with polish character e.g. Ł,Ś,Ć, etc.., this row is located at the end, after 'Z'.
    How can I implement correct sorting?
    Edited by: Kamil Jackiewicz on 2012-03-24 12:37

    --todelete                                                                                                                                                                                                                                                       

  • Restrict user to input 0 - 9 for string data

    Hi
    I would like to input this control at the front panel. This control allow user to choose from 0 - 9. Eg 0 1 2 3 4 5 6 7 8 9 .
    The control do not allow user to put -1 -2 -3 ... or 10 11 ... or decimal place.
    This number will be further converted into string as a name of a folder to be created.
    Thank for viewing this thread and give your assistance
    PX
    Solved!
    Go to Solution.

    First, right click and select 'Representation and change to integer (i.e. U8), and then right click and select Data Entry. Uncheck the 'Use default limits' and enter the range you want.
    If you noticed, everything is accomplished by right clicking. You should be familiar with all of the right click options. Have you done any of the tutorials?

  • Table location for execution date field oobservation search screen

    Hello
    I am trying to find the table and field for he execution start date that is located on the observation search screen. I have been doing searches thru Google and SDN and I cannot seem to located this field. I also am trying to match this data against the tables and the only thing that I can find is the DM_ACTION table and none of those records has the date that matches what is on the screen
    thanks

    does anyone have any info on this?
    thanks

  • Table names for master data

    Hi
    Can any one please expalin me what are the diffrent type of masterdata tables and also tables related to infocube in BI 7
    Rashmi

    Hi Rashmi,
    these are master data tables:
    S - SID table
    T- Text table
    P- Tiem dependent masterdat tbale
    Q -Tiem independent Masterdata tabe
    M - Combination of Pand Q
    X - Time dependent Navigational attributes
    Y - Time independent Navigational atttributes
    H - Hierarchey table
    K - Heirarchy SID table
    I - Heirarchy structure table
    J - Herirarchy tiem interval
    Z- table.
    Please check the following tables for Infocubes:
    Standard InfoCUBE Tables :
    /BI0/F -- Fact Table(Before Compression)
    /BI0/E -- Fact Table(After Compression)
    /BI0/P -- Dimension Table - Data Package
    /BI0/T -- Dimension Table - Time
    /BI0/U -- Dimension Table - Unit
    /BI0/1, 2, 3, .......A,B,C,D : -- Dimension Tables
    RSTSODS
    RSZCOMPIC
    RSZCOMPDIR
    hope it helps,
    Regards,
    Raghu.
    Edited by: Raghu on Oct 27, 2009 10:01 PM

  • Net Price of Info record appearing in table EINE for Invalid dates

    Dear Expert
    Net Price ( Purchasing data view ) for Info record should be zero if Info record  is not having valid price ( not within Validity dates) but still its appearing in Table EINE,please advice why this is happening ?how to resolve this problem

    Hi,
    Please check the OSS note 369511. You need to run program RM06INPO AFTER the validity has become active.
    BR,
    Patil

  • HR tables structure for BW data extraction

    Hi Experts,
                How the HR tables structure are different from  other SAP tables in  BW data extraction perspective.
    Appreciate your help in this regard.
    Thanks,
    Varun.

    The 1st and great difference is the time dependency of HR 'Infotype' and so when you load master data, it is in great part time dependent!
    Message was edited by: Claudio Caforio

  • Extractors/ Setup Tables  for Master Data

    Hi Experts,
    I am not sure if the extractor enhancement methods, setup table initialisation for Master Data different from transaction data.
    I am trying to do a delta init with initialisation of Setup table (OLI7BW) for 0CUSTOMER_ATTR. And I am not able to see any records in RSA7. Althought RSA3 shows 10 data packets and 1000 records.
    What does that mean.
    What I want to achieve is all the records a fresh for a few master data datasources since they were refreshed last month. Since then they were not being used.
    Kindly help me as soon as possible.
    Thanks in advance.

    Hi Priya,
    I am not sure if the extractor enhancement methods, setup table initialisation for Master Data different from transaction data. -
    For your information there is no conecpt of intialisation for master data.
    I am trying to do a delta init with initialisation of Setup table (OLI7BW) for 0CUSTOMER_ATTR. And I am not able to see any records in RSA7. Althought RSA3 shows 10 data packets and 1000 records.
    What does that mean.
    As said there will be no setup tbale concepts for masterdata, the changes for masterdata follows the delta pointer concept(i.e whenever changes to standard masterdata table happens the message class trigger the delta pointer for those changed records and post in RSA7).So always u see in RSA7 the changed records for masterdata tables
    What I want to achieve is all the records a fresh for a few master data datasources since they were refreshed last month. Since then they were not being used.
    i didn't get abt this question can u eloborate
    let me know if i answered ur queries

  • Table sorter

    Hi,
         i have to implement a table sorter in one of my webdypro application. I have done all the steps mentioned in one of the blog and have also imported TableSorter.java class. i am getting sorting icons in column headers. but on clicking icon nothing happens...i think there is some problem with the java class which i have imported. So can anybody provide the code of tablesorter.java class.
    Thanks in advance,
        Reena

    Hi Reena,
    Here is the code.Just change the package name.
    * Created on Sep 6, 2007
    * To change the template for this generated file go to
    * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    package ibm.com.tradefund.utils;
    * @author Administrator
    * To change the template for this generated type comment go to
    * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    import java.text.Collator;
    import java.util.ArrayList;
    import java.util.Collection;
    import java.util.Comparator;
    import java.util.HashMap;
    import java.util.Iterator;
    import java.util.Map;
    import java.util.StringTokenizer;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDAbstractDropDownByIndex;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDAbstractDropDownByKey;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDAbstractInputField;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDAbstractTableColumn;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDCaption;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDCheckBox;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDLink;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDProgressIndicator;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDRadioButton;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDTable;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDTableCellEditor;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDTableColumn;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDTableColumnGroup;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDTextEdit;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDTextView;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.WDTableColumnSortDirection;
    import com.sap.tc.webdynpro.progmodel.api.IWDAction;
    import com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent;
    import com.sap.tc.webdynpro.progmodel.api.IWDNode;
    import com.sap.tc.webdynpro.progmodel.api.IWDNodeElement;
    import com.sap.tc.webdynpro.progmodel.api.IWDViewElement;
    import com.sap.tc.webdynpro.services.sal.localization.api.WDResourceHandler;
    * Helper class that makes a Web Dynpro table UI element sortable (column-wise).
    public final class TableSorter {
          * @param table
          * @param sortAction
          * @param comparators
          * Creates a table sorter for the given table using the given sort action.
          * This constructor must be called from <code>wdDoModifyView()</code>, but
          * usually only when that hook is called for the first time. Store the newly
          * created instance in a context attribute with Java native type
          * <code>com.sap.tc.webdynpro.tests.utils.TableSorter</code>.
          * The given sort action's event handler will be bound to the <code>onSort</code>
          * event of the table and must at least call this table sorter's
          * <code>sort(wdEvent)</code> method.
          * Every column of the table is made sortable if possible according to the
          * following rules.
          * If a comparator is given for a column's ID and it is a
          * <code>NodeElementByAttributeComparator</code>, then that comparator defines
          * both the attribute and the ordering used to sort that column.
          * If any other comparator is given and an attribute can be determined from
          * that column's table cell editor, then that attribute is used to sort that
          * column according to the ordering imposed by the given comparator.
          * If no comparator is given but an attribute can be determined from
          * that column's table cell editor, then that attribute is used to sort that
          * column according to the natural ordering of that attribute's type.
          * Else that column is left untouched.
          * Additionally it is possible to define the sortable columns by their
          * TableColumn UI element ids.
          * @see sort()
          * @see NodeElementByAttributeComparator
          * @see com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDTable
         public TableSorter(IWDTable table, IWDAction sortAction, Map comparators) {
              init(table, sortAction, comparators, null);
         public TableSorter(IWDTable table, IWDAction sortAction, Map comparators, String[] sortableColumns) {
              init(table, sortAction, comparators, sortableColumns);
          * Initialisation stuff
         private void init(IWDTable table, IWDAction sortAction, Map comparators, String[] sortableColumns){
              this.table = table;
              if(sortableColumns == null){
                   sortableCols = null;
              }else{
                   sortableCols = new HashMap();
                   for (int i = 0; i < sortableColumns.length; i++) {
                        sortableCols.put(sortableColumns<i>, sortableColumns<i>);
              // sanity checks
              if (sortAction == null)
                   throw new IllegalArgumentException("Sort action must be given");
              if (table == null)
                   throw new IllegalArgumentException("Table must be given");
              if (table.bindingOfDataSource() == null)
                   throw new IllegalArgumentException(
                        "Data source of table with id '" + table.getId() + "' must be bound");
              // make the columns sortable
              String dataSourcePrefix = table.bindingOfDataSource() + ".";
              //TODO: remove the following line since this method is not longer available in later releases
              setComparatorsForColumns(dataSourcePrefix, table.iterateColumns(), comparators);
              setComparatorsForColumns(dataSourcePrefix, table.iterateGroupedColumns(), comparators);
              //set up the table properties
              table.setOnSort(sortAction);
              table.mappingOfOnSort().addSourceMapping(IWDTable.IWDOnSort.COL, "selectedColumn");
              table.mappingOfOnSort().addSourceMapping(IWDTable.IWDOnSort.DIRECTION, "sortDirection");     
          * Try to make the given columns sortable (recusivly, if necessary)
         private void setComparatorsForColumns(String dataSourcePrefix, Iterator columnIterator, Map comparators){
              int index = 0;
              for (Iterator it = columnIterator; it.hasNext(); ++index) { // for every column: try to make it bindable
                   IWDAbstractTableColumn abstractColumn = (IWDAbstractTableColumn) it.next();
                   if(abstractColumn instanceof IWDTableColumn){
                        IWDTableColumn column = (IWDTableColumn)abstractColumn;
                        if(sortableCols == null || sortableCols.containsKey(column.getId())){
                             //try to make this column sortable
                             Comparator comparator = null;
                             if (comparators != null){
                                  comparator = (Comparator)comparators.get(column.getId());
                             NodeElementByAttributeComparator elementComparator = null;     
                             if (comparator instanceof NodeElementByAttributeComparator) {
                                  // the easy one, attribute and ordering are given
                                  elementComparator = (NodeElementByAttributeComparator)comparator;
                             } else { // attribute must be determined
                                  String bindingOfPrimaryProperty = bindingOfPrimaryProperty(column.getTableCellEditor());
                                  if (bindingOfPrimaryProperty == null || !bindingOfPrimaryProperty.startsWith(dataSourcePrefix)){
                                       //no attribute found or outside of data source
                                       column.setSortState(WDTableColumnSortDirection.NOT_SORTABLE);
                                       continue;
                                  String attributeName = bindingOfPrimaryProperty.substring(dataSourcePrefix.length());
                                  Collection subnodes = new ArrayList();
                                  if (attributeName.indexOf('.') >= 0){
                                       //attribute not immediately below data source
                                       String[] tokens = tokenize (attributeName, ".");
                                       for(int i=0; i<tokens.length-1; i++){
                                            subnodes.add(tokens<i>);
                                       attributeName = tokens[tokens.length-1];
                                  if(subnodes.size() == 0){
                                       elementComparator = new NodeElementByAttributeComparator(attributeName, comparator);
                                  }else{
                                       elementComparator = new NodeElementByAttributeComparator(attributeName, comparator, subnodes);
                             // set up internal data structures
                             comparatorForColumn.put(column, elementComparator);
                             //set sort state
                             column.setSortState(WDTableColumnSortDirection.NONE);
                        }else{
                             //column should not be sortable
                             column.setSortState(WDTableColumnSortDirection.NOT_SORTABLE);
                   }else if (abstractColumn instanceof IWDTableColumnGroup){
                        //it's just a column group -> try to bind the columns of the column group
                        IWDTableColumnGroup columnGroup = (IWDTableColumnGroup)abstractColumn;
                        setComparatorsForColumns(dataSourcePrefix, columnGroup.iterateColumns(), comparators);
          * Tokenizes the input string according to the given delimiters. The delimiters will be left out.
          * Example: tokenize("Hello_World", "_") results ["Hello", "World"]
         private String[] tokenize (String input, String delim){
              StringTokenizer tokenizer = new StringTokenizer(input, delim);
              String[] tokens = new String[tokenizer.countTokens()];
              int index = 0;
              while(tokenizer.hasMoreTokens()){
                   tokens[index] = tokenizer.nextToken();
                   index++;
              return tokens;
          * This method must be called from the event handler of this table sorter's
          * sort action. It performs the actual sort operation.
         public void sort(IWDCustomEvent wdEvent, IWDNode dataSource) {
              // find the things we need
              String columnId = wdEvent.getString("selectedColumn");
              String direction = wdEvent.getString("sortDirection");
              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);
          * Returns the binding of the given table cell editor's property that is
          * considered "primary" or <code>null</code> if no such binding exists or no
          * such property can be determined.
         private static final String bindingOfPrimaryProperty(IWDTableCellEditor editor) {
              return editor instanceof IWDViewElement ? bindingOfPrimaryProperty((IWDViewElement) editor) : null;
          * Returns the binding of the given view element's property that is
          * considered "primary" or <code>null</code> if no such binding exists or no
          * such property can be determined.
         private static final String bindingOfPrimaryProperty(IWDViewElement element) {
              if (element instanceof IWDAbstractDropDownByIndex)
                   return ((IWDAbstractDropDownByIndex) element).bindingOfTexts();
              if (element instanceof IWDAbstractDropDownByKey)
                   return ((IWDAbstractDropDownByKey) element).bindingOfSelectedKey();
              if (element instanceof IWDAbstractInputField)
                   return ((IWDAbstractInputField) element).bindingOfValue();
              if (element instanceof IWDCaption)
                   return ((IWDCaption) element).bindingOfText();
              if (element instanceof IWDCheckBox)
                   return ((IWDCheckBox) element).bindingOfChecked();
              if (element instanceof IWDLink)
                   return ((IWDLink) element).bindingOfText();
              if (element instanceof IWDProgressIndicator)
                   return ((IWDProgressIndicator) element).bindingOfPercentValue();
              if (element instanceof IWDRadioButton)
                   return ((IWDRadioButton) element).bindingOfSelectedKey();
              if (element instanceof IWDTextEdit)
                   return ((IWDTextEdit) element).bindingOfValue();
              if (element instanceof IWDTextView)
                   return ((IWDTextView) element).bindingOfText();
              return null;
          * Instance of a comparator according to the ordering imposed by the
          * implementation of <code>Comparable</code>.
         private static final Comparator DEFAULT = new Comparator() {
               * Compares the given objects according to the ordering imposed by the first
               * ones <code>compareTo(Object)</code> function. Furthermore, <code>null</code>
               * is treated to be less than any object.
               * @see java.lang.Comparable#compareTo(java.lang.Object)
               * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
              public int compare(Object o1, Object o2) {
                   if (o1 == null && o2 == null)
                        return 0;
                   if (o1 == null)
                        return -1;
                   if (o2 == null)
                        return +1;
                   if (o1 instanceof Boolean && o2 instanceof Boolean)
                        return o1.toString().compareTo(o2.toString()); // false < true
                   if (o1 instanceof String && o2 instanceof String){
                        //Use a Collator for sorting according to the given Locale
                        Collator collate = Collator.getInstance(WDResourceHandler.getCurrentSessionLocale());
                        return collate.compare(o1, o2);                    
                   return ((Comparable) o1).compareTo((Comparable) o2);
          * Map of table column to comparator (<code>ReversableComparator</code>)
          * used for sorting that column (sortable columns only).
         private Map comparatorForColumn = new HashMap();
          * The table to be sorted.
         private IWDTable table = null;
          * Column-IDs of the columns, which should be sortable
         private Map sortableCols = null;
          * Generic comparator that compares node elements by a given attribute with
          * the help of a given comparator.
         public final class NodeElementByAttributeComparator implements Comparator {
               * Creates a new comparator for the given attribute name that compares values
               * of that attribute according to the natural ordering of that attribute's
               * type (which must implement <code>java.lang.Comparable</code>).
              public NodeElementByAttributeComparator(String attributeName) {
                   this(attributeName, null, false, new ArrayList());
               * Creates a new comparator for the given attribute name that compares values
               * of that attribute with the help of the given comparator. If no comparator
               * is given, the natural ordering of that attribute's type is used.
              public NodeElementByAttributeComparator(String attributeName, Comparator comparator) {
                   this(attributeName, comparator, false, new ArrayList());
               * Creates a new comparator for the given attribute name that compares values
               * of that attribute either as objects (i.e. "in internal format") or as text
               * (i.e. "in external format") as indicated. The ordering is the natural
               * ordering of that attribute's type (which must implement
               * <code>java.lang.Comparable</code>) in case objects are compared or the
               * natural ordering of <code>java.lang.String</code> in case texts are compared.
              public NodeElementByAttributeComparator(String attributeName, boolean compareAsText) {
                   this(attributeName, null, compareAsText, new ArrayList());
               * Creates a new comparator for the given attribute name that compares values
               * of that attribute according to the natural ordering of that attribute's
               * type (which must implement <code>java.lang.Comparable</code>). In addition it is possible
               * to define the path to a child node with the <code>java.util.Collection</code> subnodes.
               * (List of child node names in the correct order)
              public NodeElementByAttributeComparator(String attributeName, Collection subnodes) {
                   this(attributeName, null, false, subnodes);
               * Creates a new comparator for the given attribute name that compares values
               * of that attribute with the help of the given comparator. If no comparator
               * is given, the natural ordering of that attribute's type is used. In addition it is possible
               * to define the path to a child node with the <code>java.util.Collection</code> subnodes.
               * (List of child node names in the correct order)
              public NodeElementByAttributeComparator(String attributeName, Comparator comparator, Collection subnodes) {
                   this(attributeName, comparator, false, subnodes);
               * Creates a new comparator for the given attribute name that compares values
               * of that attribute either as objects (i.e. "in internal format") or as text
               * (i.e. "in external format") as indicated. The ordering is the natural
               * ordering of that attribute's type (which must implement
               * <code>java.lang.Comparable</code>) in case objects are compared or the
               * natural ordering of <code>java.lang.String</code> in case texts are compared. In addition it is possible
               * to define the path to a child node with the <code>java.util.Collection</code> subnodes.
               * (List of child node names in the correct order)
              public NodeElementByAttributeComparator(String attributeName, boolean compareAsText, Collection subnodes) {
                   this(attributeName, null, compareAsText, subnodes);
               * Internal constructor.
              private NodeElementByAttributeComparator(
                   String attributeName,
                   Comparator comparator,
                   boolean compareAsText,
                   Collection subNodes) {
                   if (attributeName == null)
                        throw new IllegalArgumentException("Attribute name must not be null");
                   if (comparator == null)
                        comparator = DEFAULT;
                   this.attributeName = attributeName;
                   this.comparator = comparator;
                   this.compareAsText = compareAsText;
                   this.sortDirection = true;
                   this.subNodes = subNodes;
               * Sets the sort direction of this comparator to the given direction. The comparator sort in ascending order by default.
               * @see com.sap.tc.webdynpro.clientserver.uielib.standard.api.WDTableColumnSortDirection
              public void setSortDirection(WDTableColumnSortDirection direction){
                   if(direction.equals(WDTableColumnSortDirection.UP)){
                        sortDirection = true;
                   }else if(direction.equals(WDTableColumnSortDirection.DOWN)){
                        sortDirection = false;
               * Compares the given objects which must be instances of <code>IWDNodeElement</code>
               * according to the values of the attribute given at construction time
               * with the help of the comparator given at construction time.
               * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
               * @see com.sap.tc.webdynpro.progmodel.api.IWDNodeElement
              public int compare(Object o1, Object o2) {
                   IWDNodeElement element1 = (IWDNodeElement) o1;
                   IWDNodeElement element2 = (IWDNodeElement) o2;
                   if(subNodes.size() > 0){
                        element1 = getSubNodeElement(element1, 0);
                        element2 = getSubNodeElement(element2, 0);
                   Object attributeValue1 = null;
                   Object attributeValue2 = null;
                   if(element1 != null){
                        attributeValue1 =
                             compareAsText
                                  ? element1.getAttributeAsText(attributeName)
                                  : element1.getAttributeValue(attributeName);
                   if(element2 != null){
                        attributeValue2 =
                             compareAsText
                                  ? element2.getAttributeAsText(attributeName)
                                  : element2.getAttributeValue(attributeName);
                   if(sortDirection){
                        return comparator.compare(attributeValue1, attributeValue2);
                   }else{
                        return comparator.compare(attributeValue2, attributeValue1);
               * Determines recursivly the child node, which have an attribute with the given name.
               * The path to this child node must be specified in the subnodes property of this comparator.
               * Start this method with index = 0.
              private IWDNodeElement getSubNodeElement(IWDNodeElement currentElement, int index){
                   if(currentElement == null || index >= subNodes.size()){
                        //end of recursion
                        return currentElement;
                   }else{
                        return getSubNodeElement(currentElement.node().getChildNode((String)subNodes.toArray()[index], currentElement.index()).getCurrentElement(), index+1);
                        //return getSubNodeElement(currentElement.node().getChildNode((String)subNodes.toArray()[index], currentElement.index()).getElementAt(0), index+1);
               * Name of the attribute used for comparisons.
              private final String attributeName;
               * Comparator used for comparing the attribute's values.
              private final Comparator comparator;
               * Indicates whether attribute values are compared as text (as opposed to
               * "as objects").
              private final boolean compareAsText;
               * Sort direction (true = ascending order, false = descending order)
              private boolean sortDirection;
               * List of child node names
               * (Description of the path from the given context node to the specified attribute)
              private Collection subNodes;
    Re: Webdynpro Table: Column Header sort icon not visible
    Regards,
    Mithu

Maybe you are looking for

  • Currently my daughter and I use 1 apple id. Is there a way to set her up on a new id but with the same itunes library

    Hi. My daughter and I share 1 apple id (username and password). How do I set her up with her own apple id and password on her mac but she keeps all the songs from the itunes library?

  • Input tax credit service tax

    Hi Gurus As everyone knows service tax credit can be taken only when it is paid to vendor. How this problem is solved in SAP. I mean when i make payment to vendor the entry for service tax entry should be passed. Useful answer will be assign with poi

  • How to use my Declarative Component in query component ???

    Hi everybody, I want to change inputDate in query component to my declarative component for Date fields. I did not find any way except implementing the Model of Query component so read "Web User Interface Developer’s Guide for Oracle Application Deve

  • Problem setting up model WRT54G

    I am having difficulty in setting up my Wireless -G Broadband router model #WRT54G.  I Have Comcast High-Speed Cable Internet.  My internet connection times out after a few minutes and my connection is lost after a successful configuration of the rou

  • WLC 5508 and AAA accounting

    Hello, Does anyone know if a WLC 5508 can tie into AAA accounting in order to enable departmental chargeback for WLAN services ?  (keep track of usage by department, and charge accordingly)