JFormattedTextField as CellEditor in JTable & Enter key question

Hi all,
I have a cell editor (quite complicated) containing JFormattedTextField; for the description of the problem we can simplify it as:
class Editor extends AbstractCellEditor implements TableCellEditor {
        JFormattedTextField ftf = new JFormattedTextField();
        public Object getCellEditorValue() {
            return ftf.getText();
        public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
            return ftf;
    }The problem is when I use this cell editor in JTable, and change the value in formatted text field and try to confirm change by Enter key, nothing happens (cursor stays in formatted text field).
Note when I use JTextField instead of JFormattedTextField in cell editor, Enter key "confirms" new value and jumps to following cell in table (according JTable binding). So I guess JFormattedTextField "consumes" the Enter stroke in some way.
I want to achieve the same behavior on Enter key in case of JFormattedTextField as in case of JTextField in cell editor.
I have searched the forum, tried a lot, but was unable to find solution for such a simple problem ... probably I missed something ...
Thanks a lot, Pepek

The cell editor is not applied in your code (the question is what my.setCellEditor() does but it is another topic - you can find it on this forum). Use e.g.:
public class Untitled1 extends JFrame {
    public Untitled1() {
        JPanel panel = new JPanel();
        JTable my = new JTable(5,5);
        my.setDefaultEditor(Object.class, new Editor()); //or my.getColumnModel().getColumn(0).setCellEditor(new Editor()); //just for first column
        panel.add(my);
        this.add(panel);
        pack();
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setVisible(true);
    class Editor extends AbstractCellEditor implements TableCellEditor {
        JFormattedTextField ftf = new JFormattedTextField();
        public Object getCellEditorValue() {
            return ftf.getText();
        public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
            ftf.setBackground(Color.YELLOW); // just to visually confirm which editor is used
            return ftf;
    public static void main(String[] args) {
        Untitled1 untitled1 = new Untitled1();
}Therefore you couldn't find any difference - you used the same cell editor in both cases.

Similar Messages

  • Enter Key in JTable

    Hi All,
    I have used the JTable in my application . Here my problem is when I press the Tab in the
    table cell (TextCellEditor/Render) the message is popping up . But the same message need to be
    populated when I press the Enter key .Can any one suggest me what might be the problem ?
    My Table is generically written for entire application.
    Thanks in Advance

    [http://catb.org/~esr/faqs/smart-questions.html]
    To get better help sooner, post a SSCCE that clearly demonstrates your problem.
    Use code tags to post codes -- [code]CODE[/code] will display asCODEOr click the CODE button and paste your code between the {code} tags that appear.
    db

  • JFormattedTextField consumes Enter Key Stroke

    I'm using Jdk 1.4.2_01, and want to able to process the Enter key stroke on a panel that contains a JFormattedTextField. Unfortunately, according to this Swing bug - http://developer.java.sun.com/developer/bugParade/bugs/4741926.html , JFormattedTextField consumes the Enter Key Stroke.
    This bug has been fixed recently(but in an internal release)
    I really need to be able to process the Enter Key Stroke.
    I couldn't figure out how to implement the workaround that has been posted for the bug.
    Does anyone have any ideas?
    Here is my sample code, that tries to do something on an Enter Key -
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class TestGui
         public static void main(String args[]) {
              final JFrame f = new JFrame();
              JTextField tf = new JFormattedTextField();
              f.getContentPane().setLayout(new BorderLayout());
              JPanel pnl = new JPanel(new GridLayout(1, 3));
              f.getContentPane().add(pnl, BorderLayout.CENTER);
              pnl.add(tf);
               AbstractAction delegateAction = new AbstractAction() {   
           public void actionPerformed(ActionEvent ae) {       
                JOptionPane.showMessageDialog(f, "ENTER");
              KeyStroke enterKey = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0);
        pnl.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(enterKey, "ENTER");
    //  this.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(enterKey, "ENTER");
        pnl.getActionMap().put("ENTER", delegateAction);
        f.setSize(100, 100);
        f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        f.setVisible(true);
    }

    So what is wrong with overriding the processKeyBinding
    method.... Nothing - I couldn't figure out what code I should write in that method - the bug workaround in the bug database says "We could override method processKeyBinding() at JFormattedTextField
    to return false for Escape and Enter if the text and value wasn't changed and it is not edited." - My question was how do we know if the text & value weren't changed & that it is not edited.
    I personally stay away from using
    JFormattedTextField (and input verifier)Yes, I dislike these too, but I'm forced to use the JFormattedTextField. Although, I found the input verifier of not much use - I ended up writing my own stuff for input verification
    because I find it easier to do my own formatting and inputverification and overriding processKeyBinding comes in
    handy in these situations.How did you manage to avoid using a JFormattedTextField? I am using a MaskFormatter for phones, and the caret nicely jumps over the "(" and the "-". Were you able to do this without using JFormattedTextField? Can you please post the code for your formatting text field?

  • Enter key as Tab Key in a JTable

    How can I have the Enter Key act as a Tab Key in a JTable?

    thnx...but I already solved my problem. In case someone has the same problem:
    final InputMap im = table.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
    final KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0, false);
    im.put(key, "selectNextColumnCell");

  • Returns wrong row number with ENTER key in JTable...

    I am having a problem to get exact row number ofJTable when ENTER key is pressed.
    table.getSelectedRow() always retuns one more value when ENTER key is pressed(fired). like
    if i have 5 rows in a table and when my focus is on 1st row and then i press enter key focus moves to next row and it returns 1 instead of 0 for the 1st row.
    I have written a code bellow, please check it out and tell me why it happens. Please click on Add Row button for creating rows in table.
    import javax.swing.*;
       import javax.swing.table.*;
       import java.awt.*;
       import java.awt.event.*;
       import java.util.Vector;
       class TableTest extends JFrame {
         MyTableModel myModel;
         JTable table;
         JButton button;
         JButton buttonQuery;
         int count = 0;
         public TableTest() {
           myModel = new MyTableModel();
           table = new JTable(myModel);
           table.setPreferredScrollableViewportSize(new Dimension(500, 200));
           JScrollPane scrollPane = new JScrollPane(table);
          table.addKeyListener(new KeyAdapter(){
              public void keyTyped(KeyEvent ke)
                if(ke.getKeyChar() == ke.VK_ENTER){
                  System.out.println(table.getSelectedRow());
           getContentPane().add(scrollPane, BorderLayout.CENTER);
           getContentPane().add(button = new JButton("Add Row"),
           BorderLayout.SOUTH);
           getContentPane().add(buttonQuery = new JButton("Query"), BorderLayout.NORTH);
           button.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          Object [] aRow = new Object [8];
         String aRow1;
         for (int i=0; i<5; i++) {}
         myModel.addRow(aRow);
       buttonQuery.addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent e) {
           System.out.println(myModel.getRowCount());
           System.out.println(myModel.getValueAt(1, 3));
       addWindowListener(new WindowAdapter() {
         public void windowClosing(WindowEvent e) {
           System.exit(0);
       class MyTableModel extends AbstractTableModel {
       protected final String[] headers =
       { "No", "Vehicle No", "Date of Loss", "Image Type", "Image Description", "Claim Type", "Scan Date", "User Id" };
       Vector data;
       MyTableModel() {
        data = new Vector();
       public int getColumnCount() {
         return headers.length;
       public int getRowCount() {
        return data.size();
       public Object getValueAt(int row, int col) {
       if (row < data.size() && col < 8) {
         Object [] aRow = (Object []) data.elementAt(row);
       return aRow[col];
       } else {
         return null;
       public void addRow(Object [] aRow) {
         data.addElement(aRow);
        fireTableRowsInserted(data.size()-1, data.size()-1);
       public static void main(String[] args) {
       TableTest frame = new TableTest();
       frame.pack();
       frame.setVisible(true);
       }Regards..
    jaya

    Dear Jaya,
    I have a look at your code. And modified a bit as well to really check the getSelectedRow(). Here's the modified code: I think when key event fired, the table row is changed and then is displays the get selected row. You can check this, if you are on the last row, and you press enter, it displays 0, it means first it changes the row and then displays the selected row which is obviously rowNumber+1.
    Hope it helps.
    import javax.swing.*;
    import javax.swing.table.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.Vector;
    class TableTest
        extends JFrame {
      MyTableModel myModel;
      JTable table;
      JButton button;
      JButton buttonQuery;
      JButton buttonSelectedRow;
      int count = 0;
      public TableTest() {
        myModel = new MyTableModel();
        table = new JTable(myModel);
        table.setPreferredScrollableViewportSize
            (new Dimension(500, 200));
        JScrollPane scrollPane = new JScrollPane(table);
        table.addKeyListener(new KeyAdapter() {
          public void keyTyped(KeyEvent ke) {
            if (ke.getKeyChar() == ke.VK_ENTER) {
              System.out.println(table.getSelectedRow());
        getContentPane().add(scrollPane, BorderLayout.CENTER);
        getContentPane().add(button = new JButton("Add Row"), BorderLayout.SOUTH);
        getContentPane().add(buttonQuery = new JButton("Query"), BorderLayout.NORTH);
        getContentPane().add(buttonSelectedRow = new JButton("Get Selected Row Number"), BorderLayout.NORTH);
        button.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            Object[] aRow = new Object[8];
            String
                aRow1;
            for (int i = 0; i < 5; i++) {}
            myModel.addRow(aRow);
        buttonSelectedRow.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            System.out.println("Selected Row is: " + table.getSelectedRow());
        buttonQuery.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            System.out.println(myModel.getRowCount());
            System.out.println(myModel.getValueAt(1, 3));
        addWindowListener(new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            System.exit(0);
      class MyTableModel
          extends AbstractTableModel {
        protected final String[] headers = {
            "No", "Vehicle No", "Date of Loss", "Image Type", "Image Description",
            "Claim Type", "Scan Date", "User Id"};
        Vector data;
        MyTableModel() {
          data = new Vector();
        public int getColumnCount() {
          return headers.length;
        public int getRowCount() {
          return data.size();
        public Object getValueAt(int row, int col) {
          if (row < data.size() && col < 8) {
            Object[] aRow = (Object[]) data.elementAt(row);
            return aRow[col];
          else {
            return null;
        public void addRow(Object[] aRow) {
          data.addElement(aRow);
          fireTableRowsInserted(data.size() - 1, data.size() - 1);
      public static void main(String[] args) {
        TableTest frame = new TableTest();
        frame.pack();
        frame.setVisible(true);

  • Stop Enter key for acting in a JTable

    I am having some problems with scrolling because of the Enter key. I there a way to override or stop the enter key from acting in a JTable?

    The following code simulates a mouse click on a cell when enter is pressed. You should be able to change it to do nothing, or add other functionality.
    table = new JTable(model)
         protected void processKeyEvent(KeyEvent e)
               if ( e.getKeyCode() == KeyEvent.VK_ENTER
               &&   e.getID() == KeyEvent.KEY_PRESSED )
                   int column = table.getSelectedColumn();
                   int row = table.getSelectedRow();
                   Rectangle r = getCellRect(row, column, false);
                   Point p = new Point( r.x, r.y );
                   SwingUtilities.convertPointToScreen(p, table);
                    try
                         Robot robot = new Robot();
                         robot.mouseMove(p.x, p.y );
                         robot.mousePress(InputEvent.BUTTON1_MASK);
                         robot.mouseRelease(InputEvent.BUTTON1_MASK);
                         robot.mousePress(InputEvent.BUTTON1_MASK);
                         robot.mouseRelease(InputEvent.BUTTON1_MASK);
                         robot.mouseMove(0, 0 );
                    catch (Exception e2) {}
               else
                   super.processKeyEvent(e);
    };

  • Enter key to act like tab key in JTable

    I have programmed a JTable application. I want that if I press 'Enter' key in the JTable cell, the cell at right side may be selected after validating input. Similarly, when I press 'Enter' in the right most cell, the first cell of the next row may be selected after validating input.
    In other words, I like 'Enter' key to behave as forward navigational key in JTable cells like 'Tab' key, however, after validating input.
    The following is the piece of code which is not working for me. Though, it changes selection border to the next cell on pressing enter, but the focus is not shifted and editing remains in the current cell.
    //voucherTable is a JTable object with three columns.
    Action moveForward = new AbstractAction() {
    public void actionPerformed(ActionEvent e) {
    int r=voucherTable.getSelectedRow();
    int c=voucherTable.getSelectedColumn();
    if(c==2){
    c=-1;
    r+=1;
    voucherTable.changeSelection(r,c+1,false,false);
    voucherTable.getInputMap().put(KeyStroke.getKeyStroke
    (KeyEvent.VK_ENTER,0),"moveForward");
    voucherTable.getActionMap().put("moveForward",
    moveForward);
    Kindly advise me to solve the problem.
    Thanks.
    Mujjahid

    KeyStroke tab = KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0);
    KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0);
    InputMap im = table.getInputMap(JTable.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
    im.put(enter, im.get(tab));

  • Handling Enter key event in JTable

    Hi...
    This is particularly for the user "VIRAVAN"...
    I have followed your method ,and got results too.. but the
    processKeyBinding(.. method is called 4 times,same problem addressed by you before, but I didn't understood it...
    Please help me...
    Here is my code...
    protected boolean processKeyBinding(KeyStroke ks, KeyEvent e,int condition, boolean pressed)
    System.out.println("Wait");
    if (ks == KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0))
    int selRow = getSelectedRow();
    int rowCount = getRowCount();
    int selCol = getSelectedColumn();
    String val =(String)getValueAt(selRow,selCol);
    boolean b= getCellEditor(selRow,selCol).stopCellEditing();
    System.out.println(b);
    System.out.println(rowCount-1 + " "+ selRow + " " + getSelectedColumn());
    if((!val.equals("")) && selRow==rowCount-1)
    System.out.println(rowCount-1 + " "+ getSelectedRow()+ " " + getSelectedColumn());
    blank1 = new String[columns];
    for(int p=0;p<columns;p++)
    blank1[p]="";
    Diary.this.datarows.addElement(blank1);
    // dataModel.fireTableStructureChanged();
    //dataModel.fireTableDataChanged();
    Diary.this.dataModel.fireTableChanged(null);
    else if(ks ==KeyStroke.getKeyStroke(KeyEvent.VK_1,0))
    System.out.println("One One One One ");
    return super.processKeyBinding(ks,e,condition,pressed);

    It's been a while since I looked at the code, but essentially there are three key event types:
    1) key pressed,
    2) key typed,
    3) key released.
    So I would expect the processKeyBind to see all three of them. However, ks==KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0) is true only when a key typed event is detected (the other types can be ignored by passing it up the food chain where they will eventually be consumed). Now...., if I understand you correctly, you want to terminate edit on the present of Enter key, right? Here is how I'd suggest you do:
       protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) {
          if (isEditing()) {
             Component editorComponent=getEditorComponent();
             editorComponent.stopCellEditing();
             return true;
          return super.processKeyBinding(ks,e,condition,pressed);
       }Ok.... now, it appears that you want to do something else also... i.e., add a new row to the table if the editing row is the last row and the editing column is the last column of the last row. You can't do that in the same thread (i.e., you must wait until the update in the current thread is completed). So, what you must do is use the SwingUtilities.InvokeLater, like this:
       protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) {
          if (isEditing()) {
             Component editorComponent=getEditorComponent();
             editorComponent.stopCellEditing();
             if (getEditingRow()+1==getRowCount() && getEditingColumn()+1==getColumnCount()) {
                SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
    // put the code for adding new row here
             return true;
          return super.processKeyBinding(ks,e,condition,pressed);
       }OK?
    ;o)
    V.V.
    PS: posted code is untest but should work!

  • Why does firefox change fonts when I am trying to download or get help, click and enter keys are disabled why?

    I recently did a clean install of windows7 after returning from Europe and installed Mozilla firefox being fed up with microsoft and google .
    Fire fox seemed to be working ok but 7 out of 10 downloads were failing, and it seemed that every ebsite entered in the address bar turned into a question.
    There was no save shortcut, or paste buttons just a set of to me useless buttons first html, last html, then when I tried to contact help all of a sudden I got a "install fonts" notice and the enter key stopped working,
    and any action key was also disabled without advising me.
    It appears that either Mozilla or someone doesn't want me using firefox.
    I also noticed that the clean disk and other utilities didn't work and that the temp and temp internet folders were empty when I tried to open them but they actually had some 25 megabytes in them when queried as administrator. I also noticed a quick flash reference to Jscript=void,
    and my 32 bit computer suddenly started up as a 64 bit Turion.
    scan and system clean said machine was clean.
    Whats going on here?
    I am not on my machine, I can't contact you on it because the enter button has been disabled by font change.
    Maybe this robot needs some help too!

    Can you undo the system restore?
    Note that using System Restore can cause your Firefox installation to get corrupted because not all files are restored (only files in a white-list), so be cautious with using System Restore.
    *You may lose data in the Firefox profile folder like .js and .ini files pr profiles.ini can be affected.
    *You may need to (re)install software that was affected.
    In case you need to reinstall Firefox then you need to delete the Firefox program folder before reinstalling to make sure that all files get replaced.
    A possible cause is security software (firewall,anti-virus) that blocks or restricts Firefox or the plugin-container process without informing you, possibly after detecting changes (update) to the Firefox program.
    Remove all rules for Firefox and the plugin-container from the permissions list in the firewall and let your firewall ask again for permission to get full unrestricted access to internet for Firefox and the plugin-container process and the updater process.
    See:
    *https://support.mozilla.org/kb/Server+not+found
    *https://support.mozilla.org/kb/Firewalls

  • How to call a method in backing bean on hitting 'Enter' key on a page.

    Hi all,
    I would be obliged if any one can provide me solution for the below given problem.
    My requirement is to call a method in backing bean when i hit 'Enter' key on a JSP page.
    I am trying this by using a script given below.
    *function fnChangeFocus(){*
    *if(window.event.keyCode==13){*
    * document.getElementById("mainform:submitForm:commandbutton").focus();*
    The JSP has the textbox as given below.
    *<h:inputText id="inputtxtboxid" disabled="false" value="#{Bean.inputvalue}"*
    onkeypress="fnChangeFocus()" size="24" />
    Using this I could not acheive the required functionality. Please suggest some alternative.
    Thanks,
    Jagadeesh Pala

    Only a form element supports the submit() function. Make sure that the getElementById returns the appropriate form. Or rather pass the element as the 'this' reference to the function and get the parent form from it.
    After all this is just basic DHTML / Javascript+DOM knowledge and in fact this has nothing to do with JSF. For future basic DHTML / JS+DOM questions you may take a look at the appropriate forums, e.g. dhtmlcentral.com, dynamicdrive.com, etcetera.

  • After 2/5/2012 update to 10.0, the enter key no longer functions on the URL bar. (Running Windows 7 Home Premium on 64 bit Intel Core i3)

    The URL line accepts text, but using the "Enter" key generates no response. The right arrow at the end of the URL line will take me to the URL.

    https://support.mozilla.org/en-US/questions/917446
    thank you

  • Need help on tips of Enter Key form Default Action!

    Hi
    In Iplanet-Jato-Tips
    Enter Key Form Action Default Command i had a problem.
    Is there any way to avoid the Enter action.
    I need the same functionality which they specified in the tips,but not while
    enter on a text field.
    I need that functionality(default command child) ,but that action should
    happen only at onclick,onFocus etc.So how to do for that.
    My Ultimate question is
    I need a default handler method which should handle my request if i submit a
    page thru javascript having document.form.submit().
    Please help needed,i was exhausted in asking this question in so many ways.
    Thanks
    Awaiting for reply.
    Jaya

    Hi,
      <a href="/people/sap.user72/blog/2005/05/09/have-you-played-blindfold-chess's</a> how to create a dynamic table, though I think you have already done this.
      Do look at the comment that Armin Reichert has put in. Now in the source code that he has provided, the last line should be
    table.setOnLeadSelect(wdThis.wdGetLeadSelectAction());
    Have you done something similar to this?
    Have you set the initializeLeadSelect property of the datasource node to true?
    Regards,
    Satyajit.
    Message was edited by: Satyajit Chakraborty

  • How to make 'Key-Enter' trigger (when clicked on enter key)work like 'F8' key?

    Hi . I have another question to be asked.
    Oracle Forms 6i.
    I have a form in which DEFAULT&SMARTBAR is the menu and there are no push buttons.
    In the form, there is a 'field' named as 'ID No'. After entering 'ID No' in the field and click on 'Execute Query' button from the 'DEFAULT&SMARTBAR' menu, all the details of that respective 'ID No' gets displayed in all the other fields. Even if i press 'F8' all the fields gets displayed with the values.
    But i have a requirement, i.e. after entering 'ID No' and click 'Enter' key , i want all the values to be displayed.
    So i created a 'Key-Enter' trigger with the following code:
    BEGIN
      EXECUTE_QUERY;
    END;
    But after entering 'ID No' and click 'Enter' key, the values are not getting displayed.
    What can i do to make this happen?
    Thank You.

    It depends how your form is created. If your ID item is part of the base table block, you can do this.
    On your ID item, create a KEY-NEXT-ITEM trigger:
    if :system.mode = 'ENTER-QUERY' then
        execute_query;
    else
        next_item;
    end if;
    Now
    - User clicks on enter query (via smart bar icon or F7).
    - User enters ID and clicks <enter> key to execute the query.

  • Prevent Enter key from proceeding movie

    I am using this code to get the user to enter the answer 16
    in an input text field. It works but if the user hits the enterkey
    after they've gotten the question right, the playhead starts and
    moves to incorrect. This is not happening only in the testing
    environment, the published file continues when Enter is pressed.
    Can anyone help?
    keyListener = new Object();
    keyListener.onKeyUp = function() {
    if (input_txt2.text == "16" and Key.getCode() == 13) {
    //13 is key code for 'Enter'//
    gotoAndPlay("1_3_13a");
    _root.answer1 = "Correct!";
    } else if (input_txt2.text != "16" and Key.getCode() == 13)
    //13 is key code for 'Enter'//
    _root.answer1 = "Incorrect.";
    gotoAndPlay("1_3_13b");
    Key.addListener(keyListener);

    I'm not following what "…activated when the enter key
    is pressed even after the event has occurred." means. You mean that
    even after this first entry you press enter and the value of
    input_txt2.text != "16" so it is jumping to 1_3_13B?
    I think I know what you mean, maybe. Notice how you are
    setting up a listener? Well it keeps listening, it isn't a one time
    deal. It listens for a keyUp until you tell it to stop. So just
    because it works once why would you expect it to stop working? :)
    What you need to do is either inside your conditionals or
    perhaps just inside the onKeyUp function put a
    Key.removeListener(keyListener); to tell it to stop listening. If
    you are doing some kind of remediation at 1_3_13b and then want
    them to have another try, perhaps you will want to leave the
    listener or you might want to remove it and then add it back. I
    don't know the exact structure of what you are doing, but I hope
    this points you in the correct direction.

  • Enter key instead of TAB key

    Hi folks,
    I'd like to make the ENTER key behave the same way as the TAB key in
    the system I'm developing. I thought I would be able to do it by setting
    the ENTER as a function key (using Window.SetAsFunctionKey), and
    then after detecting an ENTER key press, request focus on the current
    fieldwidget's 'NextTabField'. However, this attribute defaults to NIL unless
    you override the default TAB sequence. And I don't really fancy setting
    the Next and Prev TabField for every onscreen field.
    Anyone done this before using a simpler method?
    By the way, I don't really want to get into a long thread about whether it is
    good practice to bypass Windows (TM) standards or not. We require
    fast data entry, and keyboard entry is essential for that.
    Cheers,
    Duncan Kinnear,
    McCarthy and Associates, Email: [email protected]
    PO Box 764, McLean Towers, Phone: +64 6 834 3360
    Shakespeare Road, Napier, New Zealand. Fax: +64 6 834 3369
    Providing Integrated Software to the Meat Processing Industry for over 10 years
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Duncan,
    The application we are building will replace legacy application and had similar
    requirements to accommodate the current users. We solved this problem by creating a
    special frame, appropriately named as the "Terminal Frame". It is distributed as
    part of the Scaffolds framework.
    The Terminal frame implements ENTER instead of TAB key. As you know the tabbing
    order in a terminal frame (top to bottom, left to right) is different than windows
    tabbing order (left to right, top to bottom). The Terminal frame solves the tabbing
    problem by constructing a "field traverse list" which includes all the fields in a
    window including nested views ordered according to their X,Y co-ordinates. It is a
    recursive method works on the same lines as described by Sakharov, Nickolay in
    earlier mail. The method also sets the NextTabField, PrevTabField references for
    each field in the traverse list.
    This framework is working very well for us. In a terminal frame world, you still
    have some user training issues as some of the fields (OutlineField, DropList,
    ArrayField, CheckBoxe etc.) behave differently for ENTER and TAB keys. But these
    are minimal compared to a complete change in style.
    Hope this is helpful.
    Good Luck,
    Shirish
    Duncan Kinnear wrote:
    On 22 Jun 99, at 23:47, Jeanne Hesler wrote:
    Do the math on this one. Be sure your users understand the cost and the
    lack of payback. I have no problem going against common practice when
    there is a good reason, but this reason just doesn't add up. Even if it
    did slow them down, which it won't, they would never lose enough time to be
    worth the work that it would take to implement.Jeanne,
    Thanks for your reply (even though it doesn't help me!).
    Don't get me wrong, I'm not advocating we abandon the TAB key
    functionality in favour of the ENTER key. I just want to ADD the ENTER
    key as a navigational aid for our 'legacy' users (and we have many). If it
    is done right, there should be no need to tell the user about it. Their
    transition to the new product would be virtually painless.
    Since I posted my original question I've realised that the cost of
    implementation is actually fairly low. And this is why. I have just
    discovered that the default tab order defined by Forte (left to right, top to
    bottom) is essentially useless for most of the windows we will be creating.
    Therefore, we will need to override it by explicitly setting the
    "NextTabField" and "PrevTabField" attributes of our input fields in virtually
    every window. As I am writing the framework for our new product, I will
    have to implement the facility to do this in the framework itself. And if we
    have our tab order defined, then adding the ENTER key functionality is
    minimal extra effort (see my original post). In fact, if I implement it in my
    "CoreWindow" (the root of my windows framework inheritence tree), then
    no-one will ever have to deal with it again.
    The TAB key is not even much of a windows data-entry standard. Many
    of our customers have defined secondary systems using Microsoft
    Access, and it uses the ENTER key (along with the TAB key) to move
    from field to field. Will these customers not complain that they cannot
    use the ENTER key to move between fields if we don't implement it?
    As we do not have the resources to completely rewrite our existing
    COBOL system (over 2 million lines of code) in one go. We will be rolling
    out the new system module by module. This means that a lot of our users
    will be switching between the new windows interface and the text-based
    unix telnet sessions. When I switch back and forth between windows
    editors and 'vi' on the unix host, I experience first-hand how mixed
    navigational facilities can hamper productivity!
    Anyway, I was just hoping there might be a little setting somewhere in
    Forte to switch this on, but as no-one has pointed it out, it seems unlikely.
    Thanks again for your input, lively discussion is always welcome.
    Cheers,
    Duncan Kinnear,
    McCarthy and Associates, Email: [email protected]
    PO Box 764, McLean Towers, Phone: +64 6 834 3360
    Shakespeare Road, Napier, New Zealand. Fax: +64 6 834 3369
    Providing Integrated Software to the Meat Processing Industry for over 10 years
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>--
    Shirish Kulkarni <mailto:[email protected]>
    Sage IT Partners <http://www.sageitpartners.com>
    44 Montgomery St. Suite 3200 San Francisco, CA 94104
    (925)210-6965 Office (415) 399-7001 Fax
    The Leaders in Internet Enabled Enterprise Computing
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

Maybe you are looking for

  • Php_oci8.dll won't load

    hi all i have problem for loading the oci8.dll extension for php 5.2.2 in my computer: i use wamp5 version 1.6.6 (apache 2.2, php 5.2, mysql 5) on win xp sp2 i want to connect my oracle server on different computer to my webserver using instant clien

  • Acrobat Pro 9.4.5 digital signing, menu gray but properties says allowed

    I have a document that had the signing menu gray/disabled. I tried going to Advanced->Security->Remove Security. The dialogue said "You Cannot change security on this document because the document enables extended features in Adobe Reader. You can sa

  • Labview VIs for HP 35670A

    The link to the labview VIs for the HP 35670A is no longer valid and the search for the same returns nothing.  Does anyone have the Labview VIs for that instrument? The last post was back in 2004(see below) The instrument driver for the HP 35670A is

  • Cost tracking and Reporting tools

    Hi, is it possible to track Project cost directly or only on ressource bases. What I mean excatlly is, can I assign to different Project Member a per day salary or per Hour ? Or can I only see how many man-days ar assigned to the Project ? Also I'm i

  • Joins my video clips?

    I am working with video clips outside of my timeline (audio is on the timeline). Ever so often, when I add a transition, it will create a full clip and box it like this. A)How do I disable this OR B) How do I break apart these boxes once formed. Than