Enter/Return in Textfield or other widgets

I have the problem that my Plugin crashes if i enter something in a textfield (TextEditBoxWidget) or Dropdownlist (DropDownListWidget) and press Enter to submit the form instead of using the Button. How can i avoid this? The Update Method of DialogObserver is not entered.

Sorry i posted this in wrong category. Could you put it into
Adobe Community > InDesign > InDesign SDK ?

Similar Messages

  • How to capture the data entered in a textfield in a JTable

    How to capture the data entered in a textfield present in a cell of a textfield or how to add listener to this textfield

    A sample of my code is:
              model = new GridDisplayTableModel(gridDisp,columnName,getRows(),getCols());
              final ComboRenderer cRenderer = new ComboRenderer();
              final TextFieldRenderer tRenderer = new TextFieldRenderer();
              combo.addItem("one");
              combo.addItem("two");
              combo.addItem("three");
              final JTextField textfield = new JTextField();
              final DefaultCellEditor cmbEditor = new DefaultCellEditor(combo);
         //     final JEnterDataCellEditor textEditor = new JEnterDataCellEditor(12);
              final DefaultCellEditor textEditor = new DefaultCellEditor(textfield);
              rm = new RowEditorModel();
              table = new JTable(model){
         public TableCellRenderer getCellRenderer(int row, int column) {
              int posx = 0;
                   int posy = 0;
                   TableCellRenderer renderer = null;
         for(int l=0;l<getDataVec().size();l++)
                   beanObj =(Helperbean)dataVec.elementAt(l);
                   posx = beanObj.getPosx();
                   posy = beanObj.getPosy();
                   if(row==posx && column==posy)
                             if(beanObj.getModeofDisplay() != null && beanObj.getModeofDisplay().equalsIgnoreCase("textfield"))
                                  rm.addEditorForRow(row,textEditor);
                                  renderer = tRenderer;
                             else if(beanObj.getModeofDisplay() != null && beanObj.getModeofDisplay().equalsIgnoreCase("combo"))
                                  rm.addEditorForRow(row,cmbEditor);
                                  renderer = cRenderer;
                             break;
                        renderer = super.getCellRenderer(row, column);
              //     System.out.println("getEditor"+rm.getEditor(1));
         return renderer;
    public TableCellEditor getCellEditor(int row, int col) {   
         int posx = 0;
         int posy = 0;
         TableCellEditor tmpEditor = null;
    for(int l=0;l<getDataVec().size();l++)
         beanObj =(Helperbean)dataVec.elementAt(l);
         posx = beanObj.getPosx();
         posy = beanObj.getPosy();
         if(row==posx && col==posy)
                   if(beanObj.getModeofDisplay() != null && beanObj.getModeofDisplay().equalsIgnoreCase("textfield"))
                        System.out.println("celleditorval "+textEditor.getCellEditorValue());
                        tmpEditor = textEditor;
                   else if(beanObj.getModeofDisplay() != null && beanObj.getModeofDisplay().equalsIgnoreCase("combo"))
                        tmpEditor = cmbEditor;
                   break;
              tmpEditor = super.getCellEditor(row, col);
    return tmpEditor;
    public boolean isCellEditable(int row,int col){
         boolean isEditable = false;
         int posx = 0;
         int posy = 0;
    for(int l=0;l<getDataVec().size();l++)
         beanObj =(Helperbean)dataVec.elementAt(l);
         posx = beanObj.getPosx();
         posy = beanObj.getPosy();
         if(row==posx && col==posy)
              if(beanObj.getModeofDisplay() != null )     
                        isEditable = true;     
                   else
                        isEditable = false;     
                   break;
         isEditable = false;
         return isEditable;
    public void changeSelection(final int row, final int column, boolean toggle, boolean extend) {
         super.changeSelection(row, column, toggle, extend);
         //my attempt to avoid editCellAt from being called twice in a row
         if (getModel().isCellEditable(row, column) && !(isEditing() && getEditingRow() == row && getEditingColumn() == column))
              if (editCellAt(row, column)) {
                   getEditorComponent().requestFocus();
         // Select the text when the cell starts editing
    public boolean editCellAt(int row, int column) {       
         boolean result = super.editCellAt(row, column);
         final Component editor = getEditorComponent();
         if (editor != null && editor instanceof JTextField) {           
              SwingUtilities.invokeLater(new Runnable() {               
                   public void run() {                   
                        ((JTextField)editor).selectAll();
              return result;
         public boolean hasFocus()
              Component editorComponent = getEditorComponent();
              // Try to install the editor
              int anchorRow = getSelectionModel().getAnchorSelectionIndex();
              int anchorColumn = getColumnModel().getSelectionModel().
              getAnchorSelectionIndex();
              if (anchorRow != -1 && anchorColumn != -1 && !isEditing())
              if ((this.getSelectedRow() == anchorRow) && (this.getSelectedColumn() == anchorColumn))
              if (!editCellAt(anchorRow, anchorColumn)) {}
              return super.hasFocus();
         public void valueChanged(ListSelectionEvent e)
              super.valueChanged(e);
              if ((this.getSelectedRow() == 2) && (this.getSelectedColumn() == 3))
                   DefaultFocusManager focusManager = new DefaultFocusManager();
                   focusManager.focusNextComponent(this);
                   model.fireTableStructureChanged();
         

  • Enter/return key issue.

    We have a new Macbook Pro and the enter/return key does not work with software unless we push the shift key at the same time. It only does this on one user as well. Other users on the computer the enter/return key works fine. As an example - if you are done with a sentence in Pages and you hit the enter/return button to go to the next line nothing happens unless you also hold the shift key down. Any ideas?

    I have found a solution that works in Excel 2011. But you can try to see if this solution would work for Pages also. Remember, where the instructions below refer to Excel substitute it with Pages instead. From what I am understanding you want to click the RETURN key and move down to the next line in the document. Hopefully it works.
    If you want to click the RETURN key and have the cursor go from the current cell to the the next row in Column A (i.e. The cursor is in cell B2, click RETURN, the cursor moves to A3) do the following:
    1) Click on the Apple logo in the upper left corner of your desktop.
    2) Click SYSTEM PREFERENCES.
    3) Click KEYBOARD.
    4) In the KEYBOARD box click KEYBOARD SHORTCUTS.
    5) Click APPLICATION SHORTCUTS from the left menu.
    6) Click the + (plus sign) that appears to the left of the Restore Defaults
    button.
    6) In the box that appears select EXCEL for the APPLICATION you want to apply this shortcut to. (if Excel does not appear on the list, click on OTHER at the bottom of the list, click MICROSOFT OFFICE, then click EXCEL).
    7) In the MENU TITLE field enter the name you would like to give this shortcut (i.e. ACTIVE CELL). Click the RETURN key(enter) to continue.
    The cursors will now appear in the KEYBOARD SHORTCUT field. Click the RETURN (enter) key once. The shortcut will now appear in the KEYBOARD SHORTCUT field.
    9) Click ADD.
    Now go into the spreadsheet and test the shortcut. Enter information into the spreadsheet into a number of cells in the same row (move between the cells either with the TAB key or RIGHT ARROW), When you are done entering your information, then click RETURN. The cursor should now move to the next row in COLUMN A (i.e. The cursor is in cell B2, click RETURN, the cursor moves to A3).
    Hope it works for you as well as it did for me.

  • OneNote 2013: Font changes when pressing Enter / Return key

    I have the same problem as this guy (who didn't get a relevant answer): http://social.technet.microsoft.com/Forums/office/en-US/233833f7-dde8-414d-bdca-604ed8d57667/onenote-2013-font-changes-when-pressing-enter-return-key?forum=officeitpro
    I set my default to Calibri 14, but every time I press enter (I make a lot of bullet lists) the font changes to Calibri 11. 

    Hi,
    Did you change the default font after you typed a few words in a note container?
    Setting the default font in Microsoft Office OneNote affects text that you type in new note containers only. It does not affect existing text or text that you add to existing note containers.
    If you want to change the font in an existing note container, you need to change it manually under
    Home tab > Basic Text.
    Thanks,
    Steve Fan
    TechNet Community Support

  • Need ENTER / return key on LEFT side of keyboard

    I need an enter / return key (or key combo) on left side of my keyboard. Any idea how to do that?
    Thanks, in advance!

    Startly's QuicKeys is probably the least troublesome way because some programs ignore the system settings.

  • I have a macbook pro with OSX Mavericks 10.9.5 and some keys that are not working. Specifically, the enter/return button, the "p", "0", ";", and all the function keys.  What's really weird is that happens randomly.  I've never spilled anything on it

    I have a macbook pro with OSX Mavericks 10.9.5 and some keys randomly are not working. Specifically, the enter/return button, the "p", "0", ";", and all the function keys.  What's really weird is that happens randomly.  I've never spilled anything on it, and I can't for the life of me figure out how to fix this.  Can anyone help?  of course this happened after my warranty expired.

    **update**
    I don't know if this will help someone but I am posting this for that purpose.  In the past when I first had this problem, I'd read a post somewhere (sorry, long ago, don't have the link) where an individual was having the same problem and they stated that when the MBP got heated, that's when the keys would stop working, and they went into the MBP and jiggle some stuff around (a specific wire, I'm not electronically inclined so I know NOT of what they spake!).  Well I didn't want to do that but it always stuck in the back of my mind.  I had given up, really, and was planning to take my MBP to the apple store.  But by chance one night I left my MBP on the floor where it's cool, and when I turned it on, the problem went - poof! It seems there was some validity to the post that spoke about heat, because my problems started when I would stream foreign dramas on my MBP for hours at night, and I would hear the fan going off all the time, and in the mornings, my "p", "enter", "0", ";", and all the function keys would stop working. 
    So, maybe try keeping the MBP in a cool place when it's off.  Since I've started doing this overnight every night (keeping it on the cool floor, out of reach of any big feet), I have not had a single problem with my keyboard.
    Hopefully this might help someone.

  • I can't open my mail unless I use the Enter/Return key or go to the File -Open Message

    Up until yesterday I could open an email just by double clicking the message. Now if I want to open a message I have to use the Enter/Return key or go into FILE and press Open Message.
    The only thing different since yesterday morning is that I decided to turn off File Vault --that process took all day but finally finished and that's when I ran into problems with mail.
    I've checked my mail settings and they are the same as before. Have OSX Yosemite 10.10.1 installed.

    ''SuperSluether [[#answer-671002|said]]''
    <blockquote>
    Is this problem in Firefox? It sounds as if you are referring to an email program such as Apple Mail or Mozilla Thunderbird. As far as I know, you can't open emails in Firefox with File > Open Message because there is no such option.
    </blockquote>
    Thank you for your response. I finally found out why this was happening. It had to do with the Trackpad settings for my Mac. I adjusted the track speed to a slower speed as it was set quite fast. This seems to have fixed the problem :)
    I’m not too computer savy so sometimes things can be a little confusing trying to figure out whats what and where to look for solutions.
    Thank you

  • HT201178 when using apple bluetooth keyboard with iPad, hitting the enter/return key while typing in iMessage only adds another line not 'send' the message? is there a setting to change that somewhere?

    when using apple bluetooth keyboard with iPad, hitting the enter/return key while typing in iMessage only adds another line not 'send' the message? is there a setting to change that somewhere?

    Everywhere that I've checked it is not possible to do this. I would like to even do this using the vkb. I hate having to stretch my thumb all the way up just to send a message. It's messaging, not a report or email. Seems backwards. Hopefully some day Apple can add this option.

  • How to add the action enter  to the textfield in a jdialog?

    I did a login class using a applet it is working very well...but now..i would like to add the action to the textfield when the user press a enter.
    I would like that after that he or she has pressed a enter in the textfield were done the corresponding action, could some body help me please?
    This is my code:
         public void init() {
    AppletContext context;
              URL exitoUrl, fallaUrl;
         try {
         context = getAppletContext();
         exitoUrl = new URL("http://111.23.56.12/page1.html");
         fallaUrl = new URL("http://111.23.56.12/passwordIncorrecto.html");
                   JPasswordField pf = new JPasswordField();
                   Object[] message = new Object[] {"Intr. the password", pf};
                   Object[] options = new String[] {"Intro", "Cancel"};
                   JOptionPane op = new JOptionPane(message, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null, options);
                   JDialog dialog = op.createDialog(null, "Login");
                   dialog.show();
                   String password = new String("success");
                   String tmp = new String(pf.getPassword());
                   if ( password.equals(tmp) ) {
                        System.out.println("correct password");
         context.showDocument(exitoUrl);
         else {
                        System.out.println("incorrecto password ");
         context.showDocument(fallaUrl);
              } catch(Exception e) {
                   System.out.println("Error exception");
    Thanks in advance;
    Mary

    Hi,
    it is easy: create an entity object for every table and one view object where you select your both entity objects and join them in your select statement.
    Your desired 'confirm' functionality could be achieved with helpp of view object transient attributes - for more information see: http://docs.oracle.com/cd/E21764_01/web.1111/b31974/bcquerying.htm#CHDHJHBI
    Regards
    Pavol

  • When pressing Enter/Return to commit  a marquee selection the Feather box turns white for input!?

    When pressing Enter/Return to commit a marquee selection the Feather box turns white for input (and I'm not trying to chage the feather values)!? 
    Pressing Enter/Return should commit the selection but it doesn't why? I have not changed any short-cut preferences in PS CS6.
    When I use the Marquee or Lasso tool and make a selection and I'm happy with the selection, I press the Enter (PC)/Return(Mac) and the the "marching ants" should disappear...
    this has always worked until today!?
    Now, when I press the Enter key, the Feather box (next to the Anti-alias) on the upper left corner goes from grey to white and wants me to change the value?

    I was not able to reproduce the behavior you mentioned, though I don't normally make a practice of using the Enter key for that function (I tend to double-click to close the selection).
    Nor could I reproduce the behavior by holding down a modifier key.
    Have you tried restarting Photoshop?
    Rebooting?
    Resetting Photoshop's preferences to defaults?
    -Noel

  • Hi, imessages won't send from my macbook pro. I am still able to recieve them on mac. I am also able to send and receive on iphone. However on mac every time i press send (enter/return) it disappears, with no red '!' or anything. Any help?

    Hi, imessages won't send from my macbook pro. I am still able to recieve them on mac. I am also able to send and receive on iphone. However on mac every time i press send (enter/return) it disappears, with no red '!' or anything. Any help?

    Triple check the Outgoing Mail server info that you entered in your Mail account. If that area says the info is optional enter the outgoing mail server and your password anyway. Also if you have more than one email account check the server that is selected for the GoDaddy account and make sure it's the correct server for the account.

  • Replacement enter/return button for wireless keyboard

    Hello,
    I have an Apple Wireless Keyboard [MC184LL/B] and the enter/return button has broken off and will not reattach. I can see that the small clips on the back are damaged. Is it somehow possible to get a replacement button?

    Since that is actually an Apple Mac product ,suggest you contact either an Apple Store genius bar or an Apple Authorised service provider

  • Can I Substitute Cap Lock Key for Enter/Return

    Is there a way that I can subsitue the caps lock key for the return function? If not, then is there a way I can configure Enter/Return function using the left side of the keyboard (such as Command + A)?
    Powerbook   Mac OS X (10.4.5)  

    Hello lda,
    When did you purchase the 3 year subscription? From where did you purchase it? If you have activated & registered your Norton product, you can find the product key from the Norton Account:
    https://www.mynortonaccount.com/amsweb/default.do
    Thanks!
    Harry
    Norton Support

  • HT4061 I am unable to load Adobe Flash player on my Apple Ipad are there any clues out there how to by pass this,I can not get certain programs without it ,so I am returning my IPAD,any other programs I can load to get my programs

    I am unable to load Adobe Flash player on my Apple Ipad are there any clues out there how to by pass this,I can not get certain programs without it ,so I am returning my IPAD,any other programs I can load to get my programs

    Apple's iOS platform (iPhone, iPad, and iPod Touch) has never, and will never support flash.
    First on this; Thoughts on Flash. This is from Steve Jobs regarding Apple's views on Flash (2010)
    Second; Adobe stops making Flash for mobile devices. This is from Adobe themselves last year stating that they would stop making Flash for mobile devices.
    If you can find the App equivalent of the programs you are looking for, then congratulations, however, if you require specific 'programs' requiring flash, then the iPad is certainly not for you, and returning it would be the best choice (granted you are still within the return period).
    The lesson in this; Research what a device can and cannot do prior to purchase

  • Using Tabs and Return in TextField

    Hi!
    I am tying to use a series of TextFields to collect information from the user for a GUI application. Currently, I am adding ActionListeners to the TextFields and when the user enters a value and hits return, then the event is triggered and I am able to collect the value entered. How do I set it up so that even if the user hits the tab key, an event is triggered? Any help/pointers will be appreciated.
    I posted this earlier and someone responded saying :
    Use the input map/action map pattern.Can anyone point me to some help in this regard.
    thanks
    ajs

    Hi!
    I am tying to use a series of TextFields to collect information from the user for a GUI application. Currently, I am adding ActionListeners to the TextFields and when the user enters a value and hits return, then the event is triggered and I am able to collect the value entered. How do I set it up so that even if the user hits the tab key, an event is triggered? Any help/pointers will be appreciated.
    I posted this earlier and someone responded saying :
    Use the input map/action map pattern.Can anyone point me to some help in this regard.
    thanks
    ajs

Maybe you are looking for