Disabling sorting for a table

Hi All,
I want to disable the sorting function for my table. How can I achieve this? Please help...!!!
-sps

If you are using a JTable, by default row sorting is unable. Infact, to provide you the Table sorting, you have to put the line
JTable table = new JTable (...);
table.setAutoCreateSorter (true) //this enableinto your code or writing a RowSorter.
Otherwise there's no sorter for the Table and you can't do any kind of sorting.
Regards,
Maurizio

Similar Messages

  • How to disable sorting for some columns in a ALV GRID?

    Hi i have requirement where I have to disable sorting for some columns in a ALV GRID. i am using REUSE_ALV_GRID_DISPLAY function module.
    Can anybody help me. how to acieve this? Any code snippets will really be appreciated.

    Hi,
    I have tried this but not completely successful. I think this can be done using the OOPS method.
      DATA: it_event_exit TYPE  slis_t_event_exit.
      DATA: w_exit TYPE slis_event_exit.
      w_exit-ucomm = '&ODN'.
      w_exit-before = 'X'.
      CLEAR w_exit-after.
      APPEND w_exit TO it_event_exit.
      w_exit-ucomm = '&OUP'.
      w_exit-before = 'X'.
      CLEAR w_exit-after.
      APPEND w_exit TO it_event_exit.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program          = w_repid
          i_callback_top_of_page      = 'ALV_TOP_OF_PAGE'
          i_callback_html_top_of_page = 'ALV_HTML_TOP_OF_PAGE'
          i_callback_user_command     = 'USER_COMMAND'  <- User command form
          is_layout                   = wm_layout
          it_fieldcat                 = wt_fieldcat
          it_events                   = i_events
          it_event_exit               = it_event_exit    <- Need to fill
          it_sort                     = wt_sort
          i_default                   = 'X'
    Now you can capture this events in the user command
    FORM user_command  USING r_ucomm LIKE sy-ucomm
                             rs_selfield TYPE slis_selfield.
      IF r_ucomm = '&OUP' and rs_selfield-SEL_TAB_FIELD = 'Your field name'.
      ENDIF.
    ENDFORM.                    "user_command
    In this form you will get the function code in 'r_ucomm' and the field selected for sorting in 'rs_selfield-SEL_TAB_FIELD'. But reseting 'r_ucomm' will not work.
    May be somebody else can give some help on this.
    But this will work if you follow the oop method.
    Please see this document for more info.
    http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/an easy reference for alv grid control.pdf
    Thanks
    Vinod

  • Disable Statistics for specific Tables

    Is it possible to disable statistics for specific tables???

    If you want to stop gathering statistics for certain tables, you would simply not call DBMS_STATS.GATHER_TABLE_STATS on those particular tables (I'm assuming that is how you are gathering statistics at the moment). The old statistics will remain around for the CBO, but they won't be updated. Is that really what you want?
    If you are currently using GATHER_SCHEMA_STATS to gather statistics, you would have to convert to calling GATHER_TABLE_STATS on each table. You'll probably want to have a table set up that lists what tables to exclude and use that in the procedure that calls GATHER_TABLE_STATS.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Reduce flashback log - disable flashback for a table

    Hi,
    We have a table which we use only for logging. This information is not essential but there is a lot (given our scale of data :p ) of data (5.000.000 by day)
    So we have put the table in nologging (reduce redo => archived),
    the insert are /*+ append*/ (reduce undo)
    Now, we want to reduce the flashback logs?
    Is there a way to disable flashback for a given table ?
    thanks
    Nicolas

    Hi,
    first i would use:
    alter table tablename nologging;
    So you won't generate a lot of redo.
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_3001.htm#CJAHHIBI
    I'm not sure you can disable flashback at table level.
    You can do that on tbs level.
    Hope this helped..
    Bye
    Acr

  • Custom sorting for a Table column

    I have a Table object with multiple columns. The first is an alphanumeric unique identifier that is usually utilized by clients as String representations of integers. When a client does use integers, the sorting is completely off. Here is a sample list of how Studio Creator sorts this data:
    1
    10
    11
    12
    2
    3
    4
    5
    6
    7
    8
    9I obviously would like 10, 11, and 12 to come after 9. One way I could do this is to sort the values after they have been left-padded with zeros; however, I don't know how to implement this. I created a small class that implements Comparator in a way that will left-pad all Strings up to a max of 25 characters long, and then sorts them.
    How can I have Studio Creator sort like I want it to? Thanks.

    Solved.
    I continued down the path of the object that implements Comparator and left-pads all values with zeros up to a total length of 25; I also sorted alphanumeric characters after numeric characters. I overwrote .compare(), .equals(), and .toString(). The issue was that I had to create a custom Converter for the TextField to be able to write updates to it.

  • Providing sorting filters for a table in webdynpro java application

    ho to provide sorting  , filters , for a table in webdynpro java application .

    Hi Pradeep,
    Please go through the following article on implementation of filtering and sorting:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f024364b-3086-2b10-b2be-c0ed7d33fe65
    The article contains a link to a sample application using the TableSorter and TableFilter Class.
    The same classes can be used by any other web dynpro application. Download the sample application and copy the classes. In case of a specific requirement, modify the TableSorter and TableFilter classes.
    Regards,
    Kartikaye

  • Default column sort order for 11g table

    Could anyone give me some indication on how I would go about setting the default sort order for a table?
    I have a table with a few columns, and dataset returns in a particular order, but my table decides to sort if in any given order until I manually click on the column header and sort it.
    I would like to have it done by default on a particular field.
    Any info is appreciated.
    Thanks
    Jonny

    As Chris says, the easiest way and best re-use way is to use the order-by clause in your underlying model layer SQL query. For instance in ADF BC this would be in a View Object's query.
    However as you haven't dictated your model layer technology, there is another way in JDev 11g. In your web page that contains the ADF Faces RC table, select the binding tab at the bottom of the page, then double click on the iterator in the binding page, and in the Edit Iterator Binding dialog, select the Sort Criteria tab. This allows you to override the sort order on the iterator's columns.
    CM.

  • Disable sorting and resizing columns on table view

    Is there a way to disable sorting and resizing columns on table view?
    Thanks

    Use
    setSortable(false)
    setResizable(false)
    on each TableColumn

  • Remove/Hide sort for one of the table column

    Hi all,
       I have applied the sort functionality for the table control. But for only column i dont need the sort function.
      I have tried with the below code before doing sorting...but i dont see any result.... 
    ONACTIONSORT
    data : gr_col type ref to CL_WD_ABSTR_TABLE_COLUMN.
    CALL METHOD wd_this->table1->REMOVE_GROUPED_COLUMN
    EXPORTING
       id         = 'TABLECOLUMN'
       index      = '8'
    receiving
    THE_GROUPED_COLUMN = gr_col
    wd_this->table_control1->apply_sorting( ).. 
    Could somebody suggest me how can to remove the sort function for a particular column.
    Regards
    Sireesha.

    Hi manas,
      Thank u so much. Its working fine.
      points assigned to you....
    Regards
    sireesha.

  • Sap.m.Table: How to disable includeItemInSelection for one column?

    Dear UI5 Experts,
    I have used includeItemInSelection method for whole table as it is required for me on selectionChange event in sap.m.Table control.
    Now, I have a requirement where I need to disable that method for one column. Is there a way to disable includeItemInSelection method for only one column in sap.m.Table control. Please Advice.
    Thank you!
    Regards,
    Sai Vellanki

    Hi,
    you can use method oTable.bindAggregation
    Refer example sap.m.Table and see the source code.
    Regards,
    Chandra

  • "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

  • How to disable auto-sort for AdvancedDataGrid

    Hello,
    I am using Flex 4, ActionScript 3.
    I want to disable auto-sort. Meaning I want the sort to be executed only when the user clicks the column header, not when new rows are added to the binded collection or when values are changed.
    So far, I've found only this on the Internet:
    http://]http://tomek.me/disable-sort-on-datagrid-edit-update/
    I'd like to avoid doing that if possible.
    Many months ago, I found a solution that involved using event.preventDefault() placed somewhere. I thought I wouldn't have a problem finding it again, but I am.
    Can someone please help? Thanks!
    Bon :-D

    Hi,
    I have created SSCCE. I do not like that jComboBox spread over the whole display. I would like that the jComboBox width is only about 2 inches (5cm). If you run example below you will see that jComboBox width auto resize.
    Regards,
    Primoz
    import java.awt.*;
    import javax.swing.*;
    public class PrimozComboBox extends JPanel {
        JLabel picture;
        public PrimozComboBox() {
            String[] petStrings = { "Bird", "Cat", "Dog", "Rabbit", "Pig" };
            String[] cityStrings = { "New York", "Ljubljana", "Chicago" };
            JComboBox petList = new JComboBox(petStrings);
            petList.addItem("This is very long pet name, which could spread over many lines");
            add(petList);
            JComboBox cityList = new JComboBox(cityStrings);     
            cityList.addItem("This is very long city name, which could spread over many lines");
            add(cityList);
        private static void createAndShowGUI() {
            //Create and set up the window.
            JFrame frame = new JFrame("ComboBoxDemo");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Create and set up the content pane.
            JComponent newContentPane = new PrimozComboBox();
            newContentPane.setOpaque(true); //content panes must be opaque
            frame.setContentPane(newContentPane);
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args) {
            //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
    }

  • 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                                                                                                                                                                                                                                                       

  • OBIEE 11.1.1.5 disable sorting

    Hi,
    I am finding some issue when sorting the columns by ascending most of the time. The records are getting removed from the report. By default, now 11.1.15 introduced sorting on all columns including the measure columns as well and there is no way to disable them by column or remove this feature from the report as well. Did any one find any alternative way to disable this sorting in this version of OBIEE. Let me know the solution.
    Regards
    VM

    Yes, definitely there is a problem the way OBIEE 11.1.1.5 has made this a default behavior including all the dimension columns as well fact measure columns also available for sorting and it acts wierd for pivot table issue but doesnt throw any error for table view.
    Will be taken up by oracle support as a bug and might get fixed in its later version may be.
    Regards
    VM

  • How to Remove Sort State in Table after display it in Table

    Hi
    I use the method below to sort the columns before displaying to the user and it works okay
    FieldKey testKey = new FieldKey("testField");           
                FieldKeySortCriteria testCriteria = new FieldKeySortCriteria(portCodeKey, true);
                this.getRowRecord1().addSort(testCriteria);the problem is in every rows i have edit button where user can edit and update particular row.
    the problem occurs whenever user change the value for particular field that is being sorted the row will jump randomly according to the sort rules.
    My Question is , how can we remove or disabled sorting as soon user see the result so it wont be jumping around if user changed the value of particular field that is being sorted.
    i dont find any removeSort() function in Rowgroup
    is there another way??
    Thanks

    i tried to put
    rowGroup.clearSort() in my Destroy() Method but is not disabling the current state of my rowgroup
    what it does is the moment i click edit button for particular row
    that row will jump to some other page ( because i did pagination on my table ) because the sort has been cleared .
    How do i clear and use the current state of my rowgroup after it has been displayed.

Maybe you are looking for

  • Can not add members to a Group as Group Administrator

    Hi, My collegue has created a Group 'WE_PM_group' and added me to that Group with role 'Group Administrator'. But when I connect to the 'Create Group Or Add New Members' tool, then after SSO and acknowledging the 'read and understood Beehive Online G

  • ABAP Objects - Obsolete Statements

    How to get the list of obsolete statements in ABAP Objects? Moderator message: please search for available information/documentation before asking. locked by: Thomas Zloch on Oct 6, 2010 1:08 PM

  • Delete button hidden in iMessage!

    If you press and hold on a message to bring up the menu and then select "more" you would normally see the delete and arrow icon at the bottom of the screen - but at the moment they are hidden with the message composition box! You have to expand the c

  • Any Suggestions for this Table??

    Iam facing problem while creating a report. I have to generate a report which is having dynamic columns and rows For Eg. In this report I have total 365 columns (M1 to M365)depends up on the user he can generate the report for 2 or 3 or may be 365 co

  • Do i need antivirus for my nokia 5130 ? Where do i...

    Hi I want to know if i need antivirus for my phone because i want to share some file with my friends and there is a chance of getting infected with virus . Thanks