Sort by attribute in WAD

Hello,
I would like to create a button in my WebTemplate that should sort the Data Provider by an attribute. For example I would like to sort by post code, which is an attribute of 0customer.
How can I do that?
The command SET_SORTING using SORT_BY_ATTRIBUTE_MEMBER does not seem to work...

Hi Stefan,
I did as you described, but it doesn´t work. Here is my code. What did you enter for INFO_OBJECT_ATTRIBUTE?
<bi:BUTTON type="COMPOSITE" index="1" >
                                                        <bi:CAPTION value="PLZ" />
                                                        <bi:TOOLTIP value="Sortieren nach Postleitzahl" />
                                                        <bi:ACTION type="CHOICE" value="INSTRUCTION" >
                                                            <bi:INSTRUCTION >
                                                                <bi:SET_SORTING >
                                                                    <bi:TARGET_DATA_PROVIDER_REF_LIST type="ORDEREDLIST" >
                                                                        <bi:TARGET_DATA_PROVIDER_REF index="1" value="DP_1" />
                                                                    </bi:TARGET_DATA_PROVIDER_REF_LIST>
                                                                    <bi:CHARACTERISTIC value="0CUSTOMER" text="Kunde" />
                                                                    <bi:SORTING_TYPE type="CHOICE" value="SORT_BY_ATTRIBUTE_MEMBER" >
                                                                        <bi:SORT_BY_ATTRIBUTE_MEMBER type="COMPOSITE" >
                                                                            <bi:INFO_OBJECT_ATTRIBUTE value="0POSTAL_CD" />
                                                                            <bi:MEMBER_PRESENTATION value="KEY_COMP" />
                                                                            <bi:PRESENTATION_AREA value="ALL" />
                                                                        </bi:SORT_BY_ATTRIBUTE_MEMBER>
                                                                    </bi:SORTING_TYPE>
                                                                </bi:SET_SORTING>
                                                            </bi:INSTRUCTION>
                                                        </bi:ACTION>
                                                    </bi:BUTTON>

Similar Messages

  • ColumnDescriptor have not got the sort property attribute ?

    When i am using the abstract class ColumnDescriptor,i find no attribute to set the sort Property like the af:column.
    Anyone have suggestions? I have a LOVTableModel (has a ColumnDescriptor contains some column) and want to add sort Property to these columns. While
    can not get the sort property attribute.

    Anyone any suggestions?

  • DOM, and (not) sorting by Attribute name

    I'm using XML files to store certian options for a program I'm making. The only problem though is that it seems as though the NamedNodeMap you get from calling node.getAttributes has the attributes in sorted order.
    Namely it's sorted alphabetically.
    This is not at all what I would like, it's pretty important that the attributes be in the order I wrote them, not sorted.
    Is there another way I can do this?
    I could always just have a text entry for the Attribute types, like
    <?xml version="1.0" encoding="UTF-8"?>
    <root>
    AttributeType_1, AttributeType_2
    <whatever AttributeType_1="whatever" AttributeType_2>
    #And so on.
    </root>
    Or I could do any number of variations on that theme.

    Here is some source code.
    xmlGenerate.java
    This will convert 2D arrays into XML Strings, or vice versa. There's a couple other things it does too, but that's the important part (
    //import crap
    import java.sql.Savepoint;
    import java.util.*;
    import java.awt.event.*;
    import java.io.*;
    import javax.xml.parsers.*;
    import javax.swing.*;
    import javax.xml.parsers.*;
    import javax.xml.transform.*;
    import javax.xml.transform.dom.*;
    import javax.xml.transform.stream.*;
    import org.apache.xml.serialize.*;
    import org.w3c.dom.*;
    import org.xml.sax.*;
    //generates xml files
    public class xmlGenerate{
    public static final String PATH=SRJava.Constants.PATH+
    "\\Editors\\CharacterGenerator\\";
    * This method takes in stuff, the kind of stuff,the names of the
    * attributes of that stuff, and returns XML
    * The input is the stuff, and the output is
    * a string which is the stuff in XML.
    * Each row of the stuff represents the data of an Object
    * Each column represents a specific value, which is specified by
    * attrNames
    public static String toXML(Object[][] stuff, String[] attrNames,
    String type){
    try{
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document document = builder.newDocument();
    Element root = document.createElement("root");
    document.appendChild(root);
    //going thru each equipment to append to root
    int entries = stuff.length;
    int attributes = attrNames.length;
    String tempStr;
    for (int entry = 0; entry < entries; entry++){
    Element a1 = document.createElement(type);
    //set xml document
    root.appendChild(a1);
    for (int attr =0; attr < attributes; attr++){                   
    //this gets the data from the xml
    if (stuff[entry][attr] instanceof String){
    tempStr=(String)stuff[entry][attr];
    }else{
    tempStr="";
    a1.setAttribute(attrNames[attr],tempStr);
    OutputFormat format = new OutputFormat(document, "UTF-8", true);
    StringWriter stringOut = new StringWriter();
    XMLSerializer serial = new XMLSerializer(stringOut, format);
    serial.asDOMSerializer();
    serial.serialize(document);
    return stringOut.toString();
    *fill in components
    }catch (Exception e){
    e.printStackTrace();
    return null;
    * From XML , returns the equipmennt
    * Input is file and output is the data from the XML document
    public static Object[][] fmXML(Node root){
    //make double array
    try{           
    NodeList childNodes = root.getChildNodes();
    Vector attrNodeVector= new Vector();
    int entries=0;
    boolean determined=false;
    NamedNodeMap attributeList = null;
    for (int index=0; index < childNodes.getLength(); index++){
    Node node=childNodes.item(index);
    if (node.getNodeType()==Node.ELEMENT_NODE){
    entries++;
    attrNodeVector.add(node);
    if (determined==false){
    attributeList=node.getAttributes();
    determined=true;
    String[] attrNames=getAttrNames(root);
    int attributes=attrNames.length;
    Object[][] stuff=new Object[entries+1][attributes];
    //this value is so new entries can be added.
    for (int attr=0; attr < attributes; attr++){
    stuff[0][attr]="";
    for (int entry = 0; entry < entries; entry++){
    Element thenode=(Element)attrNodeVector.get(entry);
    //make sure the node being looked at is the right kind.
    for (int attr=0; attr < attributes; attr++){
    //parseing goes on
    stuff[entry+1][attr] = thenode.getAttribute(attrNames[attr]);
    return stuff;
    }catch (Exception e){
    e.printStackTrace();
    //there was some kind of error, return nothing useful.
    return null;
    //sorts the Nodes
    private static Node[] sort(NodeList subsequent, String[] tags){
    Node[] sorted = new Node[tags.length];
    //looking through all the different nodes
    for(int x=0; x < subsequent.getLength(); x++){
    Node inOrder = subsequent.item(x);
    String tag = inOrder.getNodeName();
    for(int i=0; i<tags.length; i++){
    if(tag.equals(tags)){
    sorted[i] = inOrder;
    break;
    return sorted;
    * output the xml document to a file
    public static void save(String doc, String name){
    try {
    PrintWriter oF = new PrintWriter(new FileWriter(name), true);
    oF.print(doc);
    oF.close();
    catch (IOException x){
    System.err.println("There was a saving error");
    //retreiving some data from an xml file
    public static Node open(String file){
    try{
    //This code came from a guy called Rob Thorndyke.
    Document doc = DocumentBuilderFactory.newInstance()
    .newDocumentBuilder().newDocument();
    File f=new File(file);
    System.out.println(f.getPath());
    // Step 2 is to get a Transformer object.
    Transformer transformer =
    TransformerFactory.newInstance().newTransformer();
    // Step 3 is to set up Source and Result objects and use the
    // Transformer object to do the conversion.
    Source source = new StreamSource(new FileReader(file));
    Result result = new DOMResult(doc);
    transformer.transform(source, result);
    //This code did not.
    Node root = doc.getDocumentElement();
    if (root == null){               
    System.out.println("There is no root!");
    return null;
    return root;
    }catch (Exception e){
    System.out.println("Error in opening.");
    return null;
    public static String[] getAttrNames(Node root){
    try{           
    NodeList childNodes = root.getChildNodes();
    Vector attrNodeVector= new Vector();
    int entries=0;
    boolean determined=false;
    NamedNodeMap attributeList = null;
    for (int index=0; index < childNodes.getLength(); index++){
    Node node=childNodes.item(index);
    if (node.getNodeType()==Node.ELEMENT_NODE){
    entries++;
    attrNodeVector.add(node);
    if (determined==false){
    attributeList=node.getAttributes();
    determined=true;
    int attributes=attributeList.getLength();
    String[] attrNames = new String[attributes];
    //get the names of the attributes
    for (int attr=0; attr < attributes; attr++){
    attrNames[attr]=attributeList.item(attr).getNodeName();
    return attrNames;
    }catch(Exception e){
    System.out.println("Error in getting column names");
    return null;
    public static String getType(Node root){
    if (root == null){               
    System.out.println("There is no root!");
    return null;
    NodeList childNodes = root.getChildNodes();
    Vector attrNodeVector= new Vector();
    for (int index=0; index < childNodes.getLength(); index++){
    Node node=childNodes.item(index);
    if (node.getNodeType()==Node.ELEMENT_NODE){
    return node.getNodeName();
    return null;
    // main method
    public static void main(String[] args){
    System.out.println("Hello out there");
    //file->xml->equpment->object
    Node root=open(PATH+"\\Equipment.xml");
    Object[][] stuff = fmXML(root);
    //frames (GUI)
    JFrame aFrame = new JFrame();
    aFrame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    aFrame.addWindowListener(new WindowAdapter(){
    public void windowClosed(WindowEvent e){
    System.exit(0);
    JPanel aPanel = new JPanel();
    //set headers
    aFrame.getContentPane().add(aPanel);
    //create scrollableTable
    String[] columnNames=new String[] {
    "name",
    "conceal",
    "cost",
    "rating",
    "weight",
    "street index"
    boolean[] columnEditable= new boolean[]{
    true,
    true,
    true,
    true,
    true,
    true
    int[][] sliders = new int[][]{
    {-1,-1,-1},
    {-1,-1,-1},
    {-1,-1,-1},
    {-1,-1,-1},
    {-1,-1,-1},
    {-1,-1,-1}
    if (stuff== null){
    System.out.println("stuff is null");
    aPanel.add(new ScrollableTable(null,stuff,columnNames,columnEditable,
    sliders,true,0));
    aFrame.pack();
    aFrame.setLocationRelativeTo(null);
    aFrame.show();
    This isn't what I'm actually using, but I whipped it up real quick so you could get an idea about how it would be used.
    * Test.java
    * Created on March 23, 2003, 5:14 PM
    package SRJava;
    * @author unknown
    import org.w3c.dom.*;
    import SRJava.Editors.CharacterGenerator.*;
    import javax.swing.*;
    public class Test extends javax.swing.JFrame {
    /** Creates new form Test */
    public Test() {
    //Replace this with some other XML file, in a table like form.
    String fileName = "M:\\Shadowrun\\SRJava\\Editors"
    + "\\CharacterGenerator\\Equipment.xml";
    Node root = xmlGenerate.open(fileName);
    String[] columnNames = xmlGenerate.getAttrNames(root);
    Object[][] data = xmlGenerate.fmXML(root);
    //There should be no sliders, and all columns should be editable.
    int columns=columnNames.length;
    int[][] sliders = new int[columns][3];
    boolean[] columnEditable= new boolean[columns];
    for (int index=0; index < columns; index++){
    sliders[index][0]=-1;
    sliders[index][1]=-1;
    sliders[index][2]=-1;
    columnEditable[index]=true;
    Object[][] avail = new Object[][]{
    JScrollPane scroll = new JScrollPane();
    JTable table=new JTable(data,columnNames);
    scroll.setViewportView(table);
    getContentPane().add(scroll, java.awt.BorderLayout.CENTER);
    addWindowListener(new java.awt.event.WindowAdapter() {
    public void windowClosing(java.awt.event.WindowEvent evt) {
    exitForm(evt);
    pack();
    /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    private void initComponents() {
    addWindowListener(new java.awt.event.WindowAdapter() {
    public void windowClosing(java.awt.event.WindowEvent evt) {
    exitForm(evt);
    pack();
    /** Exit the Application */
    private void exitForm(java.awt.event.WindowEvent evt) {
    System.exit(0);
    * @param args the command line arguments
    public static void main(String args[]) {
    new Test().show();
    // Variables declaration - do not modify
    // End of variables declaration
    And here's an XML File, call it Equipment.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <root>
    <Equipment conceal="" name="" xloge="Blorg"/>
    <Equipment conceal="Bla" name="different sample" xloge="Great southern trendkilling"/>
    <Equipment conceal="adsf" name="sample" xloge="Red Crested"/>
    </root>

  • Sorting Article Attribute

    hi
    How do we control the sorting of article attributes in a web template?
    At the moment we can choose to add any of the article attributes to the report, but they are not sorted in any decent manner, which makes scrolling them to find the required attribute quite tedious.
    There is no sort icon in the attribute selection screen.
    Is there possibly something we can do on the backend to force them to be sorted alphabetically?
    Cheers,
    Andrew

    Hi Lewis,
    Attribute is the further explanation of Charateristic in the report. You can only sort based on the characteristics not based on Attribute. There is no setting in query designer or template to acheive this.
    You can not even filter attribute in the query. It is only for display purpose to explain the characteristics in more detail.
    Regards,
    Kams

  • Enhance Context Menu Attributes in WAD

    Hi All,
    Iam trying to enhance the context menu properties (like including a select filter value using MENU_SELECT_FILTER)of the Web Application in WAD but when enter this in the HTML and give a value to it in the Template Properties Object tag its not getting saved when i try to execute it the command is getting erased. could any one let me know whether iam including the attribut in between the right object tag. i would really appreciate where i need to correct.
    Thanks,
    Padma

    hi Padma,
    if you want to include select filter value in enhanced menu, the tag is like following
    <object>
             <param name="OWNER" value="SAP_BW"/>
             <param name="CMD" value="SET_PROPERTIES"/>
             <param name="TEMPLATE_ID" value=""/>
             <param name="MENU_SELECT_FILTER" value="E"/>
             TEMPLATE PROPERTIES
    </object>
    or you can set from web template properties, tab 'web item', section 'entries in context menu' -> 'select filter value', choose option 'enhanced menu'.
    if you want to add menu, sample tag
    <object> <param name="OWNER" value="SAP_BW"> <param name="CMD" value="SET_PROPERTIES"> <param name="TEMPLATE_ID" value="ZGDCONTEXTMENU"> <param name="CMENU_LABEL_1" value="Search_Google"> <param name="CMENU_FUNCTION_1" value="myMenuProcessor"> <param name="CMENU_PARAMETER_1" value="1"> <param name="CMENU_CELL_TYPE_1" value="CHARACTERISTIC_VALUE"> <param name="CMENU_FILTER_1" value="0D_SOLD_TO"> <param name="CMENU_VISIBILITY_1" value="X"> <param name="CMENU_POSITION_1" value="BOTTOM"> <param name="CMENU_LABEL_2" value="Help@SAP"> <param name="CMENU_FUNCTION_2" value="myMenuProcessor"> <param name="CMENU_PARAMETER_2" value="2"> <param name="CMENU_CELL_TYPE_2" value=""> <param name="CMENU_FILTER_2" value=""> <param name="CMENU_VISIBILITY_2" value="X"> <param name="CMENU_POSITION_2" value="BOTTOM"> TEMPLATE PROPERTIES </object>
    hope this helps.

  • Abap- XML: sorting of attributes

    Hi,
    I would like to create an XML-File from ABAP.
    This still works fine.
    There's only one problem: the sorting of the output-XML-file is not like the sorting at the XSLT.
    Here's the part of the coding of the transformation:
    <xsl:element name="PERSON">
             <xsl:attribute name="Personennr"><xsl:value-of select="PARTNR_--40ADRNR" /></xsl:attribute>
             <xsl:attribute name="PersArtCd"><xsl:value-of select="PARTTYPE" /></xsl:attribute>
             <xsl:attribute name="LandesCd"><xsl:value-of select="COUNTRY" /></xsl:attribute>
             <xsl:attribute name="PLZ"><xsl:value-of select="POSTCODE" /></xsl:attribute>
             <xsl:attribute name="Ort"><xsl:value-of select="CITY" /></xsl:attribute>
             <xsl:attribute name="Strasse"><xsl:value-of select="STREET_NO" /></xsl:attribute>
    The output looks like this:
    <PERSON LandesCd="A" Ort="WIEN" PLZ="1010" PersArtCd="X" Personennr="000123456" Strasse="STREET. 1">
    I want to have the field "Personennr" at first position and the sorting as in the XSLT respectively.
    Any ideas??
    Best regards,
    Wolfgang

    Hi Wolfgang,
    I receive attributes in the listed order, unsorted, only with crazy tricks...
    <i><u>Either using names with leading spaces:</u></i><pre>
        <xsl:attribute name="     Personennr"><xsl:value-of select="PARTNR_--40ADRNR" /></xsl:attribute>
        <xsl:attribute name="    PersArtCd"><xsl:value-of select="PARTTYPE" /></xsl:attribute>
        <xsl:attribute name="   LandesCd"><xsl:value-of select="COUNTRY" /></xsl:attribute>
        <xsl:attribute name="  PLZ"><xsl:value-of select="POSTCODE" /></xsl:attribute>
        <xsl:attribute name=" Ort"><xsl:value-of select="CITY" /></xsl:attribute>
        <xsl:attribute name="Strasse"><xsl:value-of select="STREET_NO" /></xsl:attribute> </pre>
    <u><i>or using different namespaces for each attribute:</i></u><pre>
        <xsl:attribute name="Personennr" namespace="1"><xsl:value-of select="PARTNR_--40ADRNR" /></xsl:attribute>
        <xsl:attribute name="PersArtCd" namespace="2"><xsl:value-of select="PARTTYPE" /></xsl:attribute>
        <xsl:attribute name="LandesCd" namespace="3"><xsl:value-of select="COUNTRY" /></xsl:attribute>
        <xsl:attribute name="PLZ" namespace="4"><xsl:value-of select="POSTCODE" /></xsl:attribute>
        <xsl:attribute name="Ort" namespace="5"><xsl:value-of select="CITY" /></xsl:attribute>
        <xsl:attribute name="Strasse" namespace="6"><xsl:value-of select="STREET_NO" /></xsl:attribute> </pre>
    Of course, it contradicts the W3C standards and common sense and the first trick doesn't work with IE or other XSLT processors, except SAP's XSLT_TOOL and CALL TRANSFORMATION...
    Best regards,
    Vlad

  • Xsl:sort order attribute value template

    I am trying the use the following in XDB 10.1.0.2
    <xsl:sort order="{$myOrder} ...
    It appears that the order attribute does not allow an attribute value template.
    Any suggestions would be appreciated.
    Anthony

    This is known bug 1798018 in the Oracle XSLT processor.
    The only workaround I can think of is to use <xsl:choose> to optionally use different <xsl:for-each> blocks, one with order="ascending" and one with order="descending" as literal values.

  • How to sort AET attribute???????

    Hi Friends,,
    I am having one attribute EXT.ZFLD000008( AET attribute).. This attribute is available in the root context node BUILCONTACTPERSON... But it is not available in the BOL stucture ( in genil_model_editor if we check the attribute stucture means there we cannot able to find this attribute)
    Get_xxx method of the attribute has some validation and  holds value each and every roundtrip...
    Now my question is..
    I have to sort the value of this attribute...Basically get_xxx method will trigger every round trip...
    I need to collect all the values in to buffer to perform sorting
    How can i store the value in buffer ??? Where I can write logic to perform the sorting...????
    Thanks in Advance..
    MOHAMED ANSARI

    Hi Srinivas,
    Get_XXX attribute is round Trip Method..
    This Get Triggerd one by one..
    And Get_XXX is last method which is getting called
    doubt:1
    if I call manually like this in the any method say DO_init_context or Do_prepare_output means
    Call Method me->(lv_getter)
    Again the same GET_XXX will get triggered in last also..
    doubt 2:
    ev_bol_attribute_name
    and ev_path_2_sub_object will imports what?????????
    Important question
    me->collection_wrapper->sort()..
    in the above sort method u r passing attribute..
    Here my bol enity doesnot have that attribute.. Now how I will do sort operation????
    More over I am not using the table View here
    Thanks for ur Reply.. Guide me now..

  • Sorting transient attributes

    Does anyone know how to take advantage of adf/uix built in sorting for view objects that contain only transient fields? For example, when I build a view object that references an entity object, sorting (via a uix table tag) works great. However, when using a view object with only transient attributes, sorting does not work through a uix table. Any ideas would really be appreciated...

    FYI,
    I've figured this out for anyone that sees this post in the future. Here's how to do it.
    1 Open the transient view object in the view object editor (by double-clicking on the view object).
    2 Select Java.
    3 Press the Class extends button.
    4 For Object, browse to the following class: SortableTransientViewObject (see below for implementation)
    5 Press OK.
    6 Select Attributes.
    7 For each attributes:
    1. Select the "Selected in Query" property.
    2. Copy the exact name of the attribute to the query column alias field.
    8 Press OK.
    SortableTransientViewObject implementation:
    =============================================================
    import java.util.Collections;
    import java.util.Iterator;
    import java.util.LinkedList;
    import java.util.List;
    import oracle.jbo.Row;
    import oracle.jbo.RowSetIterator;
    import oracle.jbo.server.ViewObjectImpl;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    import oracle.jbo.NoDefException;
    public class SortableTransientViewObject extends ViewObjectImpl
    //flag for determining an invalid column index
    public static final int INVALID_COLUMN_INDEX_FLAG = -1;
    //default sort to INVALID_COLUMN_INDEX_FLAG
    private int sortColumnIndex = INVALID_COLUMN_INDEX_FLAG;
    private boolean sortAscending = true;
    * Sole constructor. Do not remove.
    public SortableTransientViewObject()
    * Sets the default sort order. If the order has not been pre-defined, then the
    * sort will not be executed when the view object is first created.
    * @param sortField the sort field index. Each view object row implementation
    * defines these attributes indices as constants. Those values are the values
    * that should be used for this method.
    * @param sortAscending sort ascending if true; descending otherwise.
    public void setDefaultSortOrder( int sortField, boolean sortAscending )
    this.setSortColumnIndex( sortField );
    this.setSortAscending( sortAscending );
    * ADF Framework extension.
    * <br>
    * This method is called by ADF when a view object is to be refreshed. In
    * the case of sorting, this signals that the view object should be sorted.
    * The ADF framework will have already called the setOrderByClause() method
    * which tells this view object what to sort by.
    public void executeQuery()
    sort( getSortColumnIndex(), isSortAscending() );
    * Over-riding to implement sort for transient view object.
    * <br>
    * This method will be called by the adf framework whenever a request
    * is made to sort the view object through a ui component; most
    * likely a table. The orderByClause parameter will always contain
    * the sort column and will optionally contain the sort direction.
    * <br>
    * This method parses the orderByClass parameter and sets the
    * corresponding sort index and direction. This method does not perform
    * the actual sort; the sort will not take place until the executeQuery()
    * method has been invoked.
    * @param orderByClause a string representing the sort column and sort
    * direction.
    public void setOrderByClause( String orderByClause )
    if( isNullOrEmpty( orderByClause ) ||
    isNullOrEmpty( orderByClause.trim() ))
    this.setSortColumnIndex( INVALID_COLUMN_INDEX_FLAG );
    this.setSortAscending( true );
    return;
    else
    orderByClause = orderByClause.trim();
    boolean sortAscending = true;
    String sortColumn = null;
    int spaceCharacterIndex = orderByClause.indexOf( ' ' );
    if( spaceCharacterIndex == -1 )
    sortColumn = orderByClause;
    sortAscending = true;
    else
    sortColumn = orderByClause.substring( 0, spaceCharacterIndex );
    String sortDirectionStringValue = orderByClause.substring( spaceCharacterIndex, orderByClause.length() );
    if( isNullOrEmpty( sortDirectionStringValue ) ||
    isNullOrEmpty( sortDirectionStringValue.trim() ) )
    sortAscending = true;
    else
    sortDirectionStringValue = sortDirectionStringValue.trim();
    if( "desc".equals( sortDirectionStringValue.toLowerCase() ) )
    sortAscending = false;
    try
    this.setSortColumnIndex( this.getAttributeIndexOf( sortColumn ) );
    catch( NoDefException e )
    this.setSortColumnIndex( INVALID_COLUMN_INDEX_FLAG );
    this.setSortAscending( sortAscending );
    * Sort helper method.
    * <br>
    * Sorts the view object. Because adf's built in sorting only works for
    * non-transient attributes (ie attributes from an entity object), this
    * method was created as a framework extension to support sorting.
    * <br>
    * This method accomplishes sorting by using Java's built in api for
    * sorting: the Collections framework. First, all view object rows are
    * copied into List object. Second, the list is sorted using Java's built
    * in Collections.sort method. Third, all rows are removed from the view
    * object and lastly, the view object is re-populated by iterating through
    * the list.
    * @param sortField the field to sort by.
    * @param sortAscending sort ascending if true; descending otherwise.
    private void sort( int sortFieldParameter, boolean sortAscendingParameter )
    //don't sort if the column index is invalid
    if( sortFieldParameter < 0 || sortFieldParameter >= this.getAttributeCount() )
    return;
    //step 1 - copy all rows to a List object and remove all rows from view object
    List list = new LinkedList();
    RowSetIterator rowIterator = this.getRowSet().createRowSetIterator( null );
    while( rowIterator.hasNext() )
    Row rowToAdd = (Row) rowIterator.next();
    list.add( rowToAdd );
    rowIterator.closeRowSetIterator();
    //step 2 - sort the List object.
    Collections.sort( list, new ViewObjectRowComparator( sortFieldParameter, sortAscendingParameter ) );
    //step 3 - remove all rows from view object
    rowIterator = this.getRowSet().createRowSetIterator( null );
    while( rowIterator.hasNext() )
    rowIterator.next();
    rowIterator.removeCurrentRowAndRetain();
    rowIterator.closeRowSetIterator();
    //step 4 - re-populate the view object with the sorted list.
    Iterator sortedValuesIterator = list.iterator();
    while( sortedValuesIterator.hasNext() )
    Row row = (Row) sortedValuesIterator.next();
    this.insertRow( row );
    public boolean isSortAscending()
    return sortAscending;
    private void setSortAscending(boolean sortAscending)
    this.sortAscending = sortAscending;
    public int getSortColumnIndex()
    return sortColumnIndex;
    private void setSortColumnIndex(int sortColumnIndex)
    this.sortColumnIndex = sortColumnIndex;
    =============================================================

  • Sort dimension attributes then show folder

    I have an dimension as below where i have created an folder for Spanish fields and rest attributes are non foldered.
     i want to sort the dimension attributes then show the folder attributes.
    ie:
    Customer
                 Customer Key
                 Education
                 Gender 
                 Material Status
                 Spanish Fields
    ShanmugaRaj

    Hi Shanmuga,
    Generally, all the folders will display on the above of dimension attributes, all the folders and attributes are listed in alphabetical order, we can sort one property members' sequence, but there is no build-in feature to sort all properties' sequence,
    if you want to sort the properties at your will, you have to add some prefix to property's name using the letter. However, you want to display attributes first and then folders, right? I am afraid this requirement cannot be achieved.
    However here I still would recommend you to submit a feedback to Microsoft Connect at this link at this link
    https://connect.microsoft.com/SQLServer/Feedback This connect site is a connection point between you and Microsoft. Your feedback enables Microsoft to make software and services the best that they
    can be, Microsoft might consider adding this feature in the following release after official confirmation.
    Regards,
    Charlie Liao
    If you have any feedback on our support,
    please click here.
    Charlie Liao
    TechNet Community Support

  • Filter and Sort Transient Attribute from Query Panel

    Jdev 11.1.1.3
    Hello,
    i am not able to filter a transient attribute from the standard query panel (with result table).
    I did following things:
    -Call an Initial AppMod Service Method from my Bounded Task Flow, and fill the Transient Attribute with some values (with setter method)
    -Next, call the Page with following characteristics:
    I defined a custom View Criteria with particular Bind Variables, take as query execution mode = In Memory and activate the Auto Query Flag
    Drag and Droped this Criteria from Conroll Panel on the Page as Query Panel with Table
    In Page Data Binding Definition, i set the InitialQueryOverridden Flag to true, otherwise no data will be filled in the transient attribute
    The sort and filter works only for the Database Attributes.
    Has anyone an Idea, how to keep same behavior for the trans attr.?
    Thank You!
    (Note: When i set the Query Mode (after init Call) to vo.setQueryMode(ViewObject.QUERY_MODE_SCAN_VIEW_ROWS), then the sorting of Trans Attr is working fine.
    But the filtering is not working well: Lets say a filtering is done by the Trans Attribute and we get 3 Rows. But when all rows wanted to be retrieved again, only those 3 are available then, no chance to get all rows back)

    Hi,
    assuming that sorting and filtering are similar, have a look here
    sorting on transient attribute
    Frank

  • MDX query to retrieve Leaves sorted by attribute bypassing the parent order

    Hi there,
    I have a Dimension with a hierarchy as:
    Country -> Area -> Location
    Location is sorted based on a Attribute called Rank based on a column in the dimension table that has a predefined value per location. In short, Location attribute has the property OrderByAttribute set to Rank.
    When I used Location attribute directly on the reports it is correctly displayed sorted by Rank.
    I am building some dashboards in Performance Point, and the problem I have is that I have to used the Hierarchy above to pull the Locations into the row axis of a Scorecard and the Locations are shorted by Rank but taking into account the Area in which they
    are:
    So using the Hierarchy I am getting:
    Location1
    Location2
    Location3
    Location4
    When I would like to get:
    Location3
    Location1
    Location4
    Location2
    I know that this is correct when thinking on the Hierachy structure, but as I am forced to display the Locations from the Hierarchy but sorted purely by their Rank, I would need a MDX query that returns the Leaves (Location) of the hierarchy order by Rank
    without taking into account the area.
    Could anyone help me with that?
    Thanks and best regards,
    Joss

    You could write a query something like this:
    SELECT {MEASURES.MYMEASURE} ON 0,
    ORDER([MYDIMENSION].[MYHIERARCHY].[LOCATION].MEMBERS, [MYDIMENSION].[MYHIERARCHY].CURRENTMEMBER.PROPERTIES("Rank", TYPED), BDESC) ON 1
    FROM MYCUBE
    Regards,
    Chris
    Check out my MS BI blog I also do
    SSAS, PowerPivot, MDX and DAX consultancy
    and run public SQL Server and BI training courses in the UK

  • Sort of attributes objects in master data

    Hi,
    I have a question regarding the attributes of master data info objects.
    What is the best way to sort the order of the info objects attributes?
    We want the order of the attributes will be set in our local language alphabetically,
    and not as a defualt language as set now in English.
    The order of the attributes as showen in the WEB (as set on local language) is not alphabetically.
    Thanks,
    Yossi

    I'm going to make some assumptions:
    1)     The Attribute key values are written in your language's Latin equivalents, but you want to sort them by your language's alphabetic order.
    2)     The Attributes have not text in your language
    Create a data source from your master data values into master data text, hard coding your language set. Set the Attributes in your query to display text, not key values.
    Good luck,
    John Hawk
    Phone: (408) 550-9484
    Mobile: (209) 324-0436
    http://www.linkedin.com/in/johnbhawk

  • Attribute sorting

    Hi,
    If I read in an xml document and subsequently interrogate one of the Element nodes in the document to discover the attribute list is there anyway of preserving the order that the attributes are specified in the dtd?
    At the moment the attributes seem to be sorted in the order they are specified provided that they have a value.
    Any attributes without a specified value appear to be stored after those with a value.

    Yes, that is what I mean. I want to do that because the data is updatable from a gui and it would be nice to have associated attributes displayed close together.
    An example (probably a poor one ;-) ) would be having an address element with housename, street, city, county attributes. It woud look silly if the gui asked for the attribute data in a (city, street, county,housename) order. I realise that I can code the order into the gui, but it is a dynamic, flexible gui and it would be handy if the there was someway of sorting the attributes in the Document api. From your answer I can see that I have to do it myself. Drat ;-(

  • Attribute sort of characteristic

    Is it possible to create a sort, or custom sort, of a characteristic's attributes within Analysis? We are seeing that the sequence between BEx and Analysis characteristics is very different. We have a requirement that these be the same for a few reports.
    Can characteristic sorting be forced from BEx into Analysis? Note: in BW we are getting the correct sequencing/sorting of attributes.

    I think the description is clear; but I don't think this is possible with Analysis Office
    If you want this functionality, I recommend turning the attribute characteristic into a navigation one on the backend of BW - of course this would require some BW development

Maybe you are looking for