Adding new function & menu to apps

Hi i am newbie to apps
i am working with forms and reports and having access to apps ,I like to know how can register my function with specific menu and to specific responsibility.I searched this forum but didnt found a clear steps.I also like to know create and register menu in apps
thnks
ramya

Ramya
I will give you a brief explanation, but you will find more details in the document Oracle Applcations System Administrators Guide, whcih can be found on MetaLink.
Functions are used to associate a form or procedure with a menu item. The seeded forms and self service functions all have functions pre-defined. If you create new forms or self service procedures, you will want to create a new function to associate your versions to.
Once you have defined a function, you need to associate the function to a menu. If the function can be accessed directly from the menu, you need to have a menu prompt which the user can use.
Then you associate your menu (with its functions) to responsibility. You can control which menu items you want the user to access by adding 'menu or function exclusions' to the responsibility. In this way, you can have one menu, but with different variations used in different responsibilities.
There are manyu variations on this theme, but I hope this basic explanation points you int he right direction.
Regards
Tim

Similar Messages

  • Made a new iTunes address, and added new payment details, old apps won't update because my old signin pops up! Even tho in settings on on first page it's my new name? How can I remove the old signin name even if it takes all apps paid and free with it!!

    Made a new iTunes address, and added new payment details, old apps won't update because my old signin pops up! Even tho in settings on on first page it's my new name? How can I remove the old signin name even if it takes all apps paid and free with it!! Don't care if I have to lose all previous apps just don't want to be hassled with updates!

    You can't all apps are tied to the apple id that was used to purchase/download it.

  • Error adding new function in order template

    Hi,
    When i am trying to add a new function to order Template under /contolData/Functions/ form data dictonary
    I am getting error :
    Element with same name exist.The following nodes can not be added to the order.
    (no namespace):/ControlData/Functions/MyNewFunction
    (no namespace):/ControlData/Functions/MyNewFunction/componentKey
    Thanks
    Harman

    Hi Harman,
    You might need to be more specific before I can help you. What have you done, and which step you run into the error? I supopse you have created a new "function" Order Component, and created the required Control Data nodes in Data Dictionary (what have you added?), right? So, when you go into the Order Template tab of the new Order Component (which would be empty since it was newly created), and you try to "select from Dictionary" the corresponding ControlData for the function (e.g. /ControlData/Functions/MyNewFunction), that such an error occurs?
    Have you assigned a process for this Order Component? Studio does not allow adding control data to it unless a process is assigned.
    Btw, you should define a namespace for your Order Components (and other orchestration entities). The OSM server uses namespace to locate these entities among cartridges.
    Cheers,
    Daniel Ho
    Product Management -- OSM

  • Product costing Template - adding new function in Environments CTU6

    Hi Guru!!
    I need to create a new function in CTU6 (Define Environments and Function Trees) in order to have information stored in MBEW table and use them in CPT2 (Template).
    The goal is to calculate a value for each material/plant and add that value during the cost estimate (CK11N / CK40N).
    Could someone help me? How can I add a field of MBEW in CTU6?
    Thank you very much in advance!!
    Marco

    Hi Marco,
    Please check SAP help for functions maintenance:
    http://help.sap.com/erp2005_ehp_06/helpdata/en/8e/f9bd66ef0e11d1a5c70000e82de878/content.htm
    Regards,
    Szymon

  • Error while adding new function to HRMS fast formula

    Hi,
    when i m trying to add a new external function to BG_ABSENCE_DURATION formula, it is getting verified successfully. But when i m trying to save it, it is giving error as below:
    APP-FF-33980: Internal error.
    A compilation error has been detected while attempting to generate package FFP294_01011900
    Please consult your system administrator.
    I have compliled the package successfully using TOAD and registered the function using Define Function form. Please help me to resolve this problem.

    Usually this error occurs when the called function has not been properly defined. You say you have defined it, but check that the parameters are the same in the FF call to the function and the function itself.
    If that is OK, I would then create a new FF with all the same code and try to save that
    Finally, if all else fails, check MetaLink as thee are a few references to other problems in this area which require patches to solve them.
    Regards
    Tim

  • Oracle Terminal. Adding new Function. Forms6i

    Hi all, in Oracle Terminal I would like to map the key F2 with the trigger KEY-F2. The question is, what should I enter as 'action' in the key binding definition window?
    Thanx.

    Frank, if he is using Client/Server Forms 6i, then Oracle Terminal is the only way to do it.
    I think you can create an action with any text you want. You just have to use exactly the same (case-sensitive) action in both places: Key Bindings and Edit Actions.
    My Key-F2 is defined this way:
    Under 'windows-sqlforms', runform, normal, Edit Key Bindings:
    Action: KEY-F2 Trigger
    Binding: F2
    Under 'windows-sqlforms', runform, normal, Product Actions:
    click the sqlforms, runform, normal circle, then Edit Actions:
    Action: KEY-F2 Trigger
    Code: 84
    Description: F2 Key for special uses
    Oracle Terminal is one tough app to use!

  • How do I edit and create new Spry2 menu items?

    I have manged to use adobe air to style and insert a spry2 menu - looks OK
    However,I do not undestand how to edit the menu items
    i.e. creating new menu items and adding new sub menu items
    On spry1 it was easy - just click the top of the menu and a wizard appeared at the bottom of the page
    The spry2 menu icon seems to be unclickable/greyed out?
    Can anyone help
    [email protected]

    Thanks for the reply - I already thought of that and I can edit the menu using code view (although I am not sure how you would 'see the sub menus in design view?) but I was wondering if spry2 has the same time saving wizard in the properties panel (as Spry1) that simplifies and speeds up the process?
    To restate the question: I can see a spry2 menu icon in the properties panel but it doesn't do anything as it's greyed out.
    Is there an option in dreamweaver (or adobe air which styles the menu) that makes a menu wizard work in the properties panel?
    If not then I guess I have to do it in code view - very tedious!?
    Jonathan
    [email protected]

  • [svn:osmf:] 11184: Adding new temporal metadata support, including sample app and unit tests.

    Revision: 11184
    Author:   [email protected]
    Date:     2009-10-27 11:08:21 -0700 (Tue, 27 Oct 2009)
    Log Message:
    Adding new temporal metadata support, including sample app and unit tests.
    Added Paths:
        osmf/trunk/apps/samples/framework/CuePointSample/
        osmf/trunk/apps/samples/framework/CuePointSample/.actionScriptProperties
        osmf/trunk/apps/samples/framework/CuePointSample/.flexProperties
        osmf/trunk/apps/samples/framework/CuePointSample/.project
        osmf/trunk/apps/samples/framework/CuePointSample/html-template/
        osmf/trunk/apps/samples/framework/CuePointSample/html-template/AC_OETags.js
        osmf/trunk/apps/samples/framework/CuePointSample/html-template/history/
        osmf/trunk/apps/samples/framework/CuePointSample/html-template/history/history.css
        osmf/trunk/apps/samples/framework/CuePointSample/html-template/history/history.js
        osmf/trunk/apps/samples/framework/CuePointSample/html-template/history/historyFrame.html
        osmf/trunk/apps/samples/framework/CuePointSample/html-template/index.template.html
        osmf/trunk/apps/samples/framework/CuePointSample/html-template/playerProductInstall.swf
        osmf/trunk/apps/samples/framework/CuePointSample/libs/
        osmf/trunk/apps/samples/framework/CuePointSample/src/
        osmf/trunk/apps/samples/framework/CuePointSample/src/CuePointSample.css
        osmf/trunk/apps/samples/framework/CuePointSample/src/CuePointSample.mxml
        osmf/trunk/framework/MediaFramework/org/osmf/metadata/TemporalFacet.as
        osmf/trunk/framework/MediaFramework/org/osmf/metadata/TemporalFacetEvent.as
        osmf/trunk/framework/MediaFramework/org/osmf/metadata/TemporalIdentifier.as
        osmf/trunk/framework/MediaFramework/org/osmf/video/CuePoint.as
        osmf/trunk/framework/MediaFramework/org/osmf/video/CuePointType.as
        osmf/trunk/framework/MediaFrameworkFlexTest/org/osmf/metadata/TestTemporalFacet.as
        osmf/trunk/framework/MediaFrameworkFlexTest/org/osmf/video/TestCuePoint.as

    Greg -
        The metadata sample demonstrates how metadata can be placed on an IMediaResource, and used to  give the framework more information about the resource.  The MediaFactory uses this information to determine which type of media a given resource points to.  One of the intial problems we encountered when creating a media factory that created MediaElements from URLResources, was the inability to distinguish between image, video, and audio urls, since the extension isn't a guaranteed way.
    The Metadata framework, that was developed last sprint was provided to enable metadata such as XMP, Namevalue, and Cuepoints.  Not all specific classes that hold this data haven't been created yet however.  The logic to add metadata automatically hasn't been placed in the framework yet.
    It's currenty possible to retrieve onPlaystatus, onMetadata, onXMPData, onImagedata, and onCuepoint callbacks:
    var videoElement:VideoElement
    [After videoElement loads]
    videoElement.client.addHandler(NetStreamCodes.ON_XMP_DATA, onXMPData);
    function onXMPData(info:Object):void
       //Process XMP here.
    Hope this helps.

  • I have recently upgraded to ios 7 on my iphone. I am currently at 7.0.2 which i installed yesterday. Now i notice that the keypad doesnt appear in any function under Phone. Keypad doesnt show up in contact search, or while adding new contacts or editing.

    I have recently upgraded to ios 7 on my iphone. I am currently at 7.0.2 which i installed yesterday. Now i notice that the keypad doesnt appear in any function under Phone. Keypad doesnt show up in contact search, or while adding new contacts or editing the existing. This is irritting.

    Try This...
    Close All Open Apps... Sign Out of your Account... Perform a Reset... Try again...
    Reset  ( No Data will be Lost )
    Press and hold the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears. Release the Buttons.
    http://support.apple.com/kb/ht1430

  • [svn] 2312: CursorManager: New functionality and a fix for SDK-15029

    Revision: 2312
    Author: [email protected]
    Date: 2008-06-30 17:24:01 -0700 (Mon, 30 Jun 2008)
    Log Message:
    CursorManager: New functionality and a fix for SDK-15029
    * NEW: When the mouse leaves a window/stage where a cursor is set, the cursor no longer sits on the edge of the screen until the mouse comes back into the window, it disappears.
    * NEW: In AIR, when the mouse leaves an active window and glides over an inactive window (without giving it focus) where a cursor is set, the system pointer will be hidden and the custom cursor will appear while gliding over that window, and disappear when you leave that window.
    * FIX: When a cursor is set in a child Window, and the mouse moves over another Window or WindowedApplication, the cursor no longer disappears -- the correct system pointer or custom cursor will display.
    * Fixed listener leaks when switching systemManagers (neither Jason nor I can tell when/why it would happen in CursorManager, however).
    Reviewer: Jason
    Bugs: SDK-15029
    Doc: No
    QA: Yes, here's an exhaustive list of ideas:
    * We'll need tests for the new behaviors.
    * For all tests, we need to try behavior in air AND behavior in (sa)player, and test regressions.
    * Please test SDK-15583 again, all other cursor tests.
    * Take the test case for SDK-15029 and open up TWO MyWindows. Test how the cursors change across all three app windows when they are overlapped like a Venn diagram, with different combinations of custom cursors on and off -- we should have test cases for all of this behavior.
    * Test that custom cursors work properly when the mouse leaves a non-rectangular stage with transparency.
    * Test mouse drag situations -- drag off stage, release, move back to stage; drag off and back onto stage, etc.
    * In my tests, I found a lot of bad behavior in AIR, and player seemed to be fine. Do we have drag and drop use cases for AIR with custom cursors?
    A list of some bugs I encountered:
    * BUG (cosmetic): If the mouse is outside the stage when a cursor changes for the first time (say you toggle a checkbox which sets the cursor using the keyboard), the cursor will appear on the stage in the last known mouse position. When the mouse returns to the stage, everything will start working correctly again.
    * BUG (cosmetic): In AIR, if you drag out, and back into the window, then release, a MOUSE_OUT is fired again over the stage, which is wrong. The mouse coords given are (-1,-1), also wrong. This causes the system cursor to show instead of the custom cursor.
    * BUG: In AIR: if you drag off the edge of a Window with a custom cursor, the cursor will vanish. The MOUSE_OUT event correctly event fires while dragging off the window. Even though the handler tells the system mouse cursor to appear, it doesn't -- might be an AIR issue, since the mouse is still dragging when told to show. If you move back over the active window without dragging, the cursor goes back to normal.
    * BUG: In AIR: if you drag over another window with a cursor, MOUSE_MOVE events don't fire on that other window until you let go. Therefore, a custom cursor in that window does not get drawn, nor does a system cursor. If you move back over the active window without dragging, the cursor goes back to normal.
    * BUG: In AIR: When dragging, off a window, Event.MOUSE_LEAVE only fires after the mouse is let go (unlike MOUSE_OUT), EVEN IF the mouse is dragged back over the window and released over the window. So you're told the mouse left when it didn't.
    * BUG: In Player: I could never get Event.MOUSE_LEAVE to fire when added to the stage in saplayer or browser.
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-15029
    http://bugs.adobe.com/jira/browse/SDK-15029
    http://bugs.adobe.com/jira/browse/SDK-15583
    http://bugs.adobe.com/jira/browse/SDK-15029
    Modified Paths:
    flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/managers/CursorManagerImpl.a s

  • In ical I just added new calendars to a pre-existing calendar group, I can make events with these calendars, but not reminders, any suggestions?

    in ical I just added new calendars to a pre-existing calendar group, I can make events with these calendars, but not reminders, any suggestions?

    Hi,
    Lion has changed the way reminders (todos as was) work. They now seem to need to be in a seperate calendar.
    In iCal open the File menu and select New Reminder List... and select where to put it.
    Best wishes
    John M

  • Added new fields in vendor master in xk01 but data is not getting saved

    Hi experts,
    To add new fields in vendor master i have followed the following steps :
    1.) Appended a structure ZRTGS in LFA1 table with required fields and activated
    2.) Added new button in xk01( vendor master ) using spro -> logistics-general -> business partner -> vendors ->
    control ->adoption of customer's owaster data fields -> prepare modification free-enhancement of vendor master record
    Created a screen group ZR and defined label tab pages with function code ZRTGS and saved entries
    3.) Created a implementation for BADIs VENDOR_ADD_DATA and VENDOR_ADD_DATA_CS.
    4.) Created a program with my own subscreen for the required fields
    The button is getting displayed in XK01, XK02 and XK03 respectively. Whenever the button is clicked the subscreen with
    the fields is also displayed. But whenever i try to save the data in either XK01 or XK02 it is not getting saved in to the
    database table LFA1.
    Request your help in this regard.
    Thanks in Advance.

    Hi,
    You may need to check this include .
    EXIT_SAPMM06E_008  -->Import Data from Customer Subscreen for Purchasing Document
    Thanks,
    vamshi

  • Adding new fields to Item Data - PO (ME

    Hi All,
    Is it possible to add new custom fields to PO Item Data in Confirmations tab and these new fields are required only in PO Change (ME22N).
    How can we achieve this!
    Can anybody provide feasible solution for the same!
    can anybody tell me if this is possible!
    Thanks in advance.
    Thanks,
    Deep.

    Hi All,
    Thanks for the reply.
    Can anybody confirm BADI ME_GUI_PO_CUST will acheive desired functionality for above posted issue!
    Functionality: Adding new custom fields to confirmation tab. During Inbound delivery in confirmation tab (Item data) if 'Confirmation category' is selected then the new custom fields should show up below for input & they can be saved.
    if 'Confirmation category' is not selected then new custom fields should be invisible.
    Thanks,
    Deep.
    Edited by: Deep on Jul 24, 2009 4:49 AM
    Edited by: Deep on Jul 24, 2009 5:05 AM

  • How to create new subsite while adding new item to the list by using javascript?

    hi,
    I hav a task ie, when I add item to the list then subsite will create with that list item title and description . So By using javascript, I have to create subsite while adding new item to the list.
    Help me to solve this.
    Thank you, 

    Is your item getting added through Javascript client object model ? If yes, you can write in the success delegate of your list creation method the logic to create the subsite.
    function CreateListItem()
    var clientContext = new SP.ClientContext.get_current();
    var oList = clientContext.get_web().get_lists().getByTitle('List Name');
    var itemCreateInfo = new SP.ListItemCreationInformation();
    this.oListItem = oList.addItem(itemCreateInfo);
    oListItem.set_item('Title', 'My New Item!');
    oListItem.set_item('Body', 'Hello World!');
    oListItem.update();
    clientContext.load(oListItem);
    clientContext.executeQueryAsync(Function.createDelegate(this, this.CreateListItemOnSuccess), Function.createDelegate(this, this.onQueryFailed));
    function CreateListItemOnSuccess() {
    var subsiteTitle = oListItem.get_item('Title');
    //Logic to create a subsite
    function onQueryFailed(sender, args) {
    I have added a sample flow for the above scenario. Have a look at the following lnk for how you can craete a subsite using ecmascript.
    http://ravisoftltd.wordpress.com/2013/03/06/sharepoint-2010-create-site-with-ecma-script-with/
    Geetanjali Arora | My blogs |

  • TableSorter errors when adding new data

    so here is the deal:
    I am using the TableSorter.java helper class with DefaultTableModel
    from: http://java.sun.com/docs/books/tutorial/uiswing/components/table.html
    It works great when the data is static and I get it for the first time. however, occationally, when adding new data I get a NullPointerException error.
    in use:
    DefaultTableModel.addRow()
    DefaultTableModel.removeRow() and
    DefaultTableModel.insertRow() methods.
    Error:
    java.lang.ArrayIndexOutOfBoundsException: 5
         at com.shared.model.TableSorter.modelIndex(TableSorter.java:294)
         at com.shared.model.TableSorter.getValueAt(TableSorter.java:340)
         at javax.swing.JTable.getValueAt(Unknown Source)
         at javax.swing.JTable.prepareRenderer(Unknown Source)...
    code problem I:
        public Object getValueAt(int row, int column)
            return tableModel.getValueAt(modelIndex(row), column);
        }code problem II:
        public int modelIndex(int viewIndex)
                 return getViewToModel()[viewIndex].modelIndex;     
        }TableSroter class:
    package com.shared.model;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.util.List;
    import javax.swing.*;
    import javax.swing.event.TableModelEvent;
    import javax.swing.event.TableModelListener;
    import javax.swing.table.*;
    * TableSorter is a decorator for TableModels; adding sorting
    * functionality to a supplied TableModel. TableSorter does
    * not store or copy the data in its TableModel; instead it maintains
    * a map from the row indexes of the view to the row indexes of the
    * model. As requests are made of the sorter (like getValueAt(row, col))
    * they are passed to the underlying model after the row numbers
    * have been translated via the internal mapping array. This way,
    * the TableSorter appears to hold another copy of the table
    * with the rows in a different order.
    * <p/>
    * TableSorter registers itself as a listener to the underlying model,
    * just as the JTable itself would. Events recieved from the model
    * are examined, sometimes manipulated (typically widened), and then
    * passed on to the TableSorter's listeners (typically the JTable).
    * If a change to the model has invalidated the order of TableSorter's
    * rows, a note of this is made and the sorter will resort the
    * rows the next time a value is requested.
    * <p/>
    * When the tableHeader property is set, either by using the
    * setTableHeader() method or the two argument constructor, the
    * table header may be used as a complete UI for TableSorter.
    * The default renderer of the tableHeader is decorated with a renderer
    * that indicates the sorting status of each column. In addition,
    * a mouse listener is installed with the following behavior:
    * <ul>
    * <li>
    * Mouse-click: Clears the sorting status of all other columns
    * and advances the sorting status of that column through three
    * values: {NOT_SORTED, ASCENDING, DESCENDING} (then back to
    * NOT_SORTED again).
    * <li>
    * SHIFT-mouse-click: Clears the sorting status of all other columns
    * and cycles the sorting status of the column through the same
    * three values, in the opposite order: {NOT_SORTED, DESCENDING, ASCENDING}.
    * <li>
    * CONTROL-mouse-click and CONTROL-SHIFT-mouse-click: as above except
    * that the changes to the column do not cancel the statuses of columns
    * that are already sorting - giving a way to initiate a compound
    * sort.
    * </ul>
    * <p/>
    * This is a long overdue rewrite of a class of the same name that
    * first appeared in the swing table demos in 1997.
    * @author Philip Milne
    * @author Brendon McLean
    * @author Dan van Enckevort
    * @author Parwinder Sekhon
    * @version 2.0 02/27/04
    public class TableSorter extends AbstractTableModel
        protected TableModel tableModel;
        public static final int DESCENDING = -1;
        public static final int NOT_SORTED = 0;
        public static final int ASCENDING = 1;
        private static Directive EMPTY_DIRECTIVE = new Directive(-1, NOT_SORTED);
        public static final Comparator COMPARABLE_COMAPRATOR = new Comparator()
            public int compare(Object o1, Object o2)
                return ((Comparable) o1).compareTo(o2);
        public static final Comparator LEXICAL_COMPARATOR = new Comparator()
            public int compare(Object o1, Object o2)
                return o1.toString().compareTo(o2.toString());
        private Row[] viewToModel;
        private int[] modelToView;
        private JTableHeader tableHeader;
        private MouseListener mouseListener;
        private TableModelListener tableModelListener;
        private Map columnComparators = new HashMap();
        private List sortingColumns = new ArrayList();
        public TableSorter()
            this.mouseListener = new MouseHandler();
            this.tableModelListener = new TableModelHandler();
        public TableSorter(TableModel tableModel)
            this();
            setTableModel(tableModel);
        public TableSorter(TableModel tableModel, JTableHeader tableHeader)
            this();
            setTableHeader(tableHeader);
            setTableModel(tableModel);
        private void clearSortingState()
            viewToModel = null;
            modelToView = null;
        public TableModel getTableModel()
            return tableModel;
        public void setTableModel(TableModel tableModel)
            if (this.tableModel != null)
                this.tableModel.removeTableModelListener(tableModelListener);
            this.tableModel = tableModel;
            if (this.tableModel != null)
                this.tableModel.addTableModelListener(tableModelListener);
            clearSortingState();
            fireTableStructureChanged();
        public JTableHeader getTableHeader()
            return tableHeader;
        public void setTableHeader(JTableHeader tableHeader)
            if (this.tableHeader != null)
                this.tableHeader.removeMouseListener(mouseListener);
                TableCellRenderer defaultRenderer = this.tableHeader.getDefaultRenderer();
                if (defaultRenderer instanceof SortableHeaderRenderer)
                    this.tableHeader.setDefaultRenderer(((SortableHeaderRenderer) defaultRenderer).tableCellRenderer);
            this.tableHeader = tableHeader;
            if (this.tableHeader != null)
                this.tableHeader.addMouseListener(mouseListener);
                this.tableHeader.setDefaultRenderer
                        new SortableHeaderRenderer(this.tableHeader.getDefaultRenderer())
        public boolean isSorting()
            return sortingColumns.size() != 0;
        private Directive getDirective(int column)
            for (int i = 0; i < sortingColumns.size(); i++)
                Directive directive = (Directive)sortingColumns.get(i);
                if (directive.column == column)
                    return directive;
            return EMPTY_DIRECTIVE;
        public int getSortingStatus(int column)
            return getDirective(column).direction;
        private void sortingStatusChanged()
            clearSortingState();
            fireTableDataChanged();
            if (tableHeader != null)
                tableHeader.repaint();
        public void setSortingStatus(int column, int status)
            Directive directive = getDirective(column);
            if (directive != EMPTY_DIRECTIVE)
                sortingColumns.remove(directive);
            if (status != NOT_SORTED)
                sortingColumns.add(new Directive(column, status));
            sortingStatusChanged();
        protected Icon getHeaderRendererIcon(int column, int size)
            Directive directive = getDirective(column);
            if (directive == EMPTY_DIRECTIVE)
                return null;
            return new Arrow(directive.direction == DESCENDING, size, sortingColumns.indexOf(directive));
        private void cancelSorting()
            sortingColumns.clear();
            sortingStatusChanged();
        public void setColumnComparator(Class type, Comparator comparator)
            if (comparator == null)
                columnComparators.remove(type);
            else
                columnComparators.put(type, comparator);
        protected Comparator getComparator(int column)
            Class columnType = tableModel.getColumnClass(column);
            Comparator comparator = (Comparator) columnComparators.get(columnType);
            if (comparator != null)
                return comparator;
            if (Comparable.class.isAssignableFrom(columnType))
                return COMPARABLE_COMAPRATOR;
            return LEXICAL_COMPARATOR;
        private Row[] getViewToModel()
            if (viewToModel == null)
                int tableModelRowCount = tableModel.getRowCount();
                viewToModel = new Row[tableModelRowCount];
                for (int row = 0; row < tableModelRowCount; row++)
                    viewToModel[row] = new Row(row);
                if (isSorting())
                    Arrays.sort(viewToModel);
            return viewToModel;
        public int modelIndex(int viewIndex)
                 return getViewToModel()[viewIndex].modelIndex;     
        private int[] getModelToView()
            if (modelToView == null)
                int n = getViewToModel().length;
                modelToView = new int[n];
                for (int i = 0; i < n; i++)
                    modelToView[modelIndex(i)] = i;
            return modelToView;
        // TableModel interface methods
        public int getRowCount()
            return (tableModel == null) ? 0 : tableModel.getRowCount();
        public int getColumnCount()
            return (tableModel == null) ? 0 : tableModel.getColumnCount();
        public String getColumnName(int column)
            return tableModel.getColumnName(column);
        public Class getColumnClass(int column)
            return tableModel.getColumnClass(column);
        public boolean isCellEditable(int row, int column)
            return tableModel.isCellEditable(modelIndex(row), column);
        public Object getValueAt(int row, int column)
            return tableModel.getValueAt(modelIndex(row), column);
        public void setValueAt(Object aValue, int row, int column)
            tableModel.setValueAt(aValue, modelIndex(row), column);
        // Helper classes
        private class Row implements Comparable
            private int modelIndex;
            public Row(int index)
                this.modelIndex = index;
            public int compareTo(Object o)
                int row1 = modelIndex;
                int row2 = ((Row) o).modelIndex;
                for (Iterator it = sortingColumns.iterator(); it.hasNext();)
                    Directive directive = (Directive) it.next();
                    int column = directive.column;
                    Object o1 = tableModel.getValueAt(row1, column);
                    Object o2 = tableModel.getValueAt(row2, column);
                    int comparison = 0;
                    // Define null less than everything, except null.
                    if (o1 == null && o2 == null)
                        comparison = 0;
                    } else if (o1 == null)
                        comparison = -1;
                    } else if (o2 == null)
                        comparison = 1;
                    } else {
                        comparison = getComparator(column).compare(o1, o2);
                    if (comparison != 0)
                        return directive.direction == DESCENDING ? -comparison : comparison;
                return 0;
        private class TableModelHandler implements TableModelListener
            public void tableChanged(TableModelEvent e)
                // If we're not sorting by anything, just pass the event along.            
                if (!isSorting())
                    clearSortingState();
                    fireTableChanged(e);
                    return;
                // If the table structure has changed, cancel the sorting; the            
                // sorting columns may have been either moved or deleted from            
                // the model.
                if (e.getFirstRow() == TableModelEvent.HEADER_ROW)
                    cancelSorting();
                    fireTableChanged(e);
                    return;
                // We can map a cell event through to the view without widening            
                // when the following conditions apply:
                // a) all the changes are on one row (e.getFirstRow() == e.getLastRow()) and,
                // b) all the changes are in one column (column != TableModelEvent.ALL_COLUMNS) and,
                // c) we are not sorting on that column (getSortingStatus(column) == NOT_SORTED) and,
                // d) a reverse lookup will not trigger a sort (modelToView != null)
                // Note: INSERT and DELETE events fail this test as they have column == ALL_COLUMNS.
                // The last check, for (modelToView != null) is to see if modelToView
                // is already allocated. If we don't do this check; sorting can become
                // a performance bottleneck for applications where cells 
                // change rapidly in different parts of the table. If cells
                // change alternately in the sorting column and then outside of            
                // it this class can end up re-sorting on alternate cell updates -
                // which can be a performance problem for large tables. The last
                // clause avoids this problem.
                int column = e.getColumn();
                if (e.getFirstRow() == e.getLastRow()
                        && column != TableModelEvent.ALL_COLUMNS
                        && getSortingStatus(column) == NOT_SORTED
                        && modelToView != null)
                    int viewIndex = getModelToView()[e.getFirstRow()];
                    fireTableChanged(new TableModelEvent(TableSorter.this,
                                                         viewIndex, viewIndex,
                                                         column, e.getType()));
                    return;
                // Something has happened to the data that may have invalidated the row order.
                clearSortingState();
                fireTableDataChanged();
                return;
        private class MouseHandler extends MouseAdapter
            public void mouseClicked(MouseEvent e)
                JTableHeader h = (JTableHeader) e.getSource();
                TableColumnModel columnModel = h.getColumnModel();
                int viewColumn = columnModel.getColumnIndexAtX(e.getX());
                int column = columnModel.getColumn(viewColumn).getModelIndex();
                if (column != -1)
                    int status = getSortingStatus(column);
                    if (!e.isControlDown())
                        cancelSorting();
                    // Cycle the sorting states through {NOT_SORTED, ASCENDING, DESCENDING} or
                    // {NOT_SORTED, DESCENDING, ASCENDING} depending on whether shift is pressed.
                    status = status + (e.isShiftDown() ? -1 : 1);
                    status = (status + 4) % 3 - 1; // signed mod, returning {-1, 0, 1}
                    setSortingStatus(column, status);
        private static class Arrow implements Icon
            private boolean descending;
            private int size;
            private int priority;
            public Arrow(boolean descending, int size, int priority)
                this.descending = descending;
                this.size = size;
                this.priority = priority;
            public void paintIcon(Component c, Graphics g, int x, int y)
                Color color = c == null ? Color.GRAY : c.getBackground();            
                // In a compound sort, make each succesive triangle 20%
                // smaller than the previous one.
                int dx = (int)(size/2*Math.pow(0.8, priority));
                int dy = descending ? dx : -dx;
                // Align icon (roughly) with font baseline.
                y = y + 5*size/6 + (descending ? -dy : 0);
                int shift = descending ? 1 : -1;
                g.translate(x, y);
                // Right diagonal.
                g.setColor(color.darker());
                g.drawLine(dx / 2, dy, 0, 0);
                g.drawLine(dx / 2, dy + shift, 0, shift);
                // Left diagonal.
                g.setColor(color.brighter());
                g.drawLine(dx / 2, dy, dx, 0);
                g.drawLine(dx / 2, dy + shift, dx, shift);
                // Horizontal line.
                if (descending) {
                    g.setColor(color.darker().darker());
                } else {
                    g.setColor(color.brighter().brighter());
                g.drawLine(dx, 0, 0, 0);
                g.setColor(color);
                g.translate(-x, -y);
            public int getIconWidth()
                return size;
            public int getIconHeight()
                return size;
        private class SortableHeaderRenderer implements TableCellRenderer
            private TableCellRenderer tableCellRenderer;
            public SortableHeaderRenderer(TableCellRenderer tableCellRenderer)
                this.tableCellRenderer = tableCellRenderer;
            public Component getTableCellRendererComponent(JTable table,
                                                           Object value,
                                                           boolean isSelected,
                                                           boolean hasFocus,
                                                           int row,
                                                           int column)
                Component c = tableCellRenderer.getTableCellRendererComponent(table,
                        value, isSelected, hasFocus, row, column);
                if (c instanceof JLabel) {
                    JLabel l = (JLabel) c;
                    l.setHorizontalTextPosition(JLabel.LEFT);
                    int modelColumn = table.convertColumnIndexToModel(column);
                    l.setIcon(getHeaderRendererIcon(modelColumn, l.getFont().getSize()));
                return c;
        private static class Directive
            private int column;
            private int direction;
            public Directive(int column, int direction)
                this.column = column;
                this.direction = direction;
    }any input will be appreciated.
    thanks
    Peter

    The code you posted doesn't help us at all. Its just a duplicate of the code from the tutorial. The custom code is what you have written. For example do you update the TableModel from the Event Thread? Do you update the SortModel or the DefaultTableModel? If you actually provide your test code and somebody has already downloaded the sort classes, then maybe they will test your code against the classes. But I doubt if people will download the sort classes and create a test program just to see if they can duplicate your results (at least I know I'm not about to).

Maybe you are looking for

  • My ipod wont synch with itunes,

    I moved my itunes from my laptop to my pc using the ipod as a hard disk, and now my ipod wont synch, sometimes it starts and then just hangs and says cannot copy blah blah blah due to an unkown errer 50. When i run the diagnostics the ipod cannot be

  • Sony BRAVIA not able to Login to Skype "kicks out ...

    We got this SONY BRAVIA TV, the skype worked well for a while. TV has been completely reset - Latest Software upgraded - Internet Connection working well (able to navigate via FB and Twitter) -Change Skype Password Login to Skype....the login seems t

  • PO IDOC urgent

    hi all, whenever user creates PO the  PO should go to XI. without executing any programs how to send  PO data to XI through iDoc. regards prajith

  • Using checkbox in sharing dialogue

    The latest version of Acrobat.com has a checkbox similar to the previous version giving the option not to send an email when sharing. In the latest version the checkbox appears to be disabled, it can not be checked. I had found this a useful facility

  • Jump menu problem

    I am a new user of Dreamweaver and setting up my first jump menu. I believe I have followed directions properly, but when I view my jump menu in the browser and try to have one of my list values transfer to the designated URL - nothing happens. I wen