Using "Enter Key" on Button launches new window

I've written a Google Search portlet using the Google API. The user enters a Search Term in a text box and then clicks on a button to begin the search. It works fine as long as the user clicks the button with the mouse. However, I'm finding that many times they just use the enter key thinking its also mapped to the button. The search works, but now displays the results in a new page leaving the portal. How can I get the "Enter Key" to operate the same way as mouse clicking on the button?
Paul

Here's what I have in my Page_Load (if you're using aspx) that traps the Enter key. In my case I just ignore it, but you can obviously replace the function body to do whatever you want.
this.RegisterStartupScript("captureEnterKey", "<script for=document event=onkeydown>if (event.keyCode == 13) {return false;}</script>");

Similar Messages

  • Using Enter key to submit a form, Attn: Didier

    Hi,
    I have an ADF form on my page and want to use Enter key to submit the form. I submit the form using a CommandLink which has a method bound to it as its action in a managed bean. I have set submitCL as the Id of this CommandLink and has set this in my form:
    <af:form defaultCommand="submitCL">
    but the Enter does not work. I'm using IE 7.0 and JDeveloper 10.1.3.2.
    Thanks in advance,
    S/\EE|)

    Hi Saeed,
    not sure if this is related or not, but I would test it with another browser as IE is not supported. See http://www.oracle.com/technology/products/jdev/htdocs/10.1.3.3/install.html#browsers
    Also, when the command button is in the header facet of a table or treeTable, the value of defaultCommand must also contain the table or treeTable ID.
    For example: <af:form defaultCommand="theTreeTableId:submitCL" ...>Regards,
    Didier.

  • When I use the shortcut to open a new window in safari (command N), I get a 404 error message from Google. How do I change where 'Command N' routes to?

    When I use the shortcut to open a new window in safari (command N) on my Macbook Pro, I get a 404 error message from Google. How do I change where 'Command N' routes to? 

    It's not necessary to change the Command N keystroke..
    From your Safari menu bar click Safari > Preferences then select the Privacy tab.
    Click:   Remove All Website Data
    Then delete the cache.
    Open a Finder window. From the Finder menu bar click Go > Go to Folder
    Type or copy paste the following
    ~/Library/Caches/com.apple.Safari/Cache.db
    Click Go then move the Cache.db file to the Trash.
    Quit and relaunch Safari to test.
    If that didn't help, troubleshoot Safari extensions.
    From the Safari menu bar click Safari > Preferences then select the Extensions tab. Turn that OFF, quit and relaunch Safari to test.
    If that helped, turn one extension on then quit and relaunch Safari to test until you find the incompatible extension then click uninstall.

  • Why I cannot tab to enter instead of using enter key?

    For example. When I want to log in a website that I have an account. After typing username and password, I can not tab  by trackpad to enter. I have to use enter key to login. Why? Have how to fix that?

    Does your cursor work? I take it this is only a problem at login. You can move the cursor,but nothing happens when you try clicking on it? Have you tried a pram reset. Command/Option/P/R keys at startup for three chimes.

  • Navigation in multi row field using ENTER key

    Contents of the field are deleted when I use ENTER key in a multi line field.
    Any solution?

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Nadeem Ameer ():
    Contents of the field are deleted when I use ENTER key in a multi line field.
    Any solution?<HR></BLOCKQUOTE>
    the normal that when you press an Enter key
    in a field which is a multi line field the cursor is moving to the next line.
    sol:verify that you don't write any wrong code in the key-enter trigger
    & check that you set the multi_line property of that item to yes.
    null

  • Using Struts, On submit button in child window, its opening new window.

    We are developing a project using Struts and BC4J. I am opening a child window(window.showmodaldialog) from main window using struts action. Actually Child window is a search kind of page. User will enter the search criteria and press the sumbit button. I want to display the search result in the same window using datatable when jboevent="submit". But its opening new window and displaying the result in that. However in <html:form>, Even I tried the target="_self".
    I am not sure wether the associated action in the <html:form> is forcing to open a new window.
    Similar kind of thing I am able to achieve in other similar search page, it its not a child window.
    Please let me know what I am missing.
    Thanks,
    Arvind

    So you want the search window to submit back to itself so you see the search field and a result list..?
    In pure Struts terms either using "_self" or the name of the popup window in the <html:form> tag will do the trick
    You need to make sure that the inital window that you created as the popup search window has a name in the first place - can you specify this with showModalDialog()?
    BTW isn't showModalDialog an IE only feature...

  • Upon updage, I cannot use back button on new windows that pop-up on link clink but back button is available on the browser window and google toolbar stopped working.

    I just updated my firefox and would really like to uninstall the update. My google toolbar is no longer compatible and I am having other issues. When I visit a site that links me to other parts of their site via new windows, the new window i get to has back and foward buttons, but I am unable to use them. Even though I have changed pages, the back button does not go bold and I am unable to get back to any previous pages. I dont have this problem with IE using the same site. I really want to keep using firefox but the new update is making it really hard!

    Extensions that may '''interfere with the Back Button''' that are already listed in [http://kb.mozillazine.org/Problematic_extensions Problematic extensions] as creating other problems
    *McAfee Site Advisor (update perhaps 3rd week July 2011)
    *Yahoo Toolbar (https://support.mozilla.com/questions/845691)
    '''Google Toolbar''' [https://support.mozilla.com/kb/Add-ons%20are%20disabled%20after%20updating%20Firefox Add-ons are disabled after updating Firefox]
    * GBookmarks (Google Bookmarks for Firefox) 25.6KB<br>https://addons.mozilla.org/firefox/addon/gbookmarks-google-bookmarks-fo/
    * http://kb.mozillazine.org/Problematic_extensions
    * '''https://support.mozilla.com/en-US/questions/837473''' <===LOOK
    * https://support.mozilla.com/en-US/questions/850863

  • How to select an item from a dropdown menu using Enter key

    A website I frequently use opens with a dropdown menu. Using my former browser, I was able to select the an item from the dropdown list by hitting the first letter with my keyboard and then hitting Enter. (Think of entering an address and selecting TX from a dropdown menu of states. Often you can hit T twice to get to TX and then the Enter key will advance the cursor to the zip code field.) Since converting to Firefox, the Enter key no longer works to advance to the next screen...I now have to move the mouse to a "Go" button and click it after selecting the desired item from the downdown menu. It's a small thing, but constantly switching back and forth between mouse and keyboard is becoming annoying. Is there an option in Firefox to select items simply by highlighting them in the dropdown menu and hitting the Enter key, instead of having to use the mouse to click a "Go" button? Thanks

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    * https://support.mozilla.com/kb/Safe+Mode
    If it does work in Safe-mode then disable all extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    * Use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    * Close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")
    In Firefox 4 you can use one of these to start in <u>[[Safe mode]]</u>:
    * Help > Restart with Add-ons Disabled
    * Hold down the Shift key while double clicking the Firefox desktop shortcut (Windows)
    * https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • How can i use enter key

    hello
    how can i make that when i press enter key that will be like the press of the button
    thanks

    hello
    how can i make that when i press enter key that will be like the press of the button
    thanks
    You can use a keyboard hook, although I don't have much experience in this area. 
    Check a
    google search to see if you can find something helpful.
    “If you want something you've never had, you need to do something you've never done.”
    Don't forget to mark
    helpful posts and answers
    ! Answer an interesting question? Write a
    new article
    about it! My Articles
    *This post does not reflect the opinion of Microsoft, or its employees.

  • Finder issue - won't launch new window, new plist resets immediately

    Hey folks, just a series of strange little problems.
    a.) When I launch Finder, it's a blank window. I have to press one of the buttons for a view to get it to show anything at all.
    b.) I can't launch another Finder window. This is a problem if I need to, say, drag and drop files from one folder to another. Neither the keyboard shortcut or the New Window option under the File dropdown does anything at all.
    c.) When I trash the .plist in Prefs, the problem gets fixed - but only for one new window launch. Then Finder immediately goes back to the no new windows default.
    d.) I've had problems with Time Machine launch that were fixed by trashing the Finder plist.
    This is happening on my MBP, running 10.6.2. Any ideas appreciated.

    Hey, I.m confused... 10.4 or 10.6?
    Could be many things, but it's best to start with these two steps, which may fix it also...
    "Try Disk Utility
    1. Insert the Mac OS X Install disc , then restart the computer while holding the C key.
    2. When your computer finishes starting up from the disc, choose Disk Utility from the Installer menu. (In Mac OS X 10.4 or later, *you must select your language first.)*
    *Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Disk Utility.*
    3. Click the First Aid tab.
    4. Click the disclosure triangle to the left of the hard drive icon to display the names of your hard disk volumes and partitions.
    5. Select your Mac OS X volume.
    6. Click Repair. Disk Utility checks and repairs the disk."
    Then Safe Boot , (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, reboot when it finishes.
    Safe Boot... holding Shift key down at bootup. Safe Boot is a special way to start Mac OS X 10.2 or later when troubleshooting.
    http://docs.info.apple.com/article.html?artnum=107392
    If you can't find your Install Disc, at least try from Safe Boot onward.
    Have you booted off your Original Install Disk by holding the *d key* down at boot-up, (not the c key), and run the extended Apple HW Test? Some Install disks require holding the Option key at bootup to select the AHT. Some Macs came with separate AHT CDs.

  • Af:inputListOfValues sets value of first item in result set when using enter key or tab and component set to autosubmit=true

    I'm using JDev 11.1.1.6 and when I type a value into an af:inputListOfValues component and hit either the enter key or the tab key it will replace the value I entered with the first item in the LOV result set. If enter a value and just click out of the af:inputListOfValues component it works correctly. If I use the popup and search for a value it works correctly as well. I have a programmatic view object which contains a single transient attribute (this is the view object which is used to create the list of value component from) and then I have another entity based view object which defines one of its attributes as a list of value attribute. I tried using an entity based view object to create the LOV from and everything works as expected so I'm not sure if this is a bug when using programmatic view objects or if I need more code in the VOImpl. Also, it seems that after the first time of the value being replaced by the first value in the result set that it will work correctly as well. Below are some of the important code snippets.
    Also, it looks like it only doesn't work if the text entered in the af:inputListOfValues component would only have a single match returned in the result set. For instance given the result set in the code: Brad, Adam, Aaron, Fred, Charles, Charlie, Jimmy
    If we enter Cha, the component works as expected
    If we enter A, the component works as expected
    If we enter Jimmy, the component does not work as expected and returns the first value of the result set ie. Brad
    If we enter Fred, the component does not work as expected and returns the first value of the result set ie. Brad
    I also verified that I get the same behavior in JDev 11.1.1.7
    UsersVOImpl (Programmatic View Object with 1 transient attribute)
    import java.sql.ResultSet;
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    import oracle.adf.share.logging.ADFLogger;
    import oracle.jbo.JboException;
    import oracle.jbo.server.ViewObjectImpl;
    import oracle.jbo.server.ViewRowImpl;
    import oracle.jbo.server.ViewRowSetImpl;
    // ---    File generated by Oracle ADF Business Components Design Time.
    // ---    Wed Sep 18 15:59:44 CDT 2013
    // ---    Custom code may be added to this class.
    // ---    Warning: Do not modify method signatures of generated methods.
    public class UsersVOImpl extends ViewObjectImpl {
        private static ADFLogger LOGGER = ADFLogger.createADFLogger(UsersVOImpl.class);
        private long hitCount = 0;
         * This is the default constructor (do not remove).
        public UsersVOImpl () {
         * executeQueryForCollection - overridden for custom java data source support.
        protected void executeQueryForCollection (Object qc, Object[] params, int noUserParams) {
             List<String> usersList = new ArrayList<String>();
             usersList.add("Brad");
             usersList.add("Adam");
             usersList.add("Aaron");
             usersList.add("Fred");
             usersList.add("Charles");
             usersList.add("Charlie");
             usersList.add("Jimmy");
             Iterator usersIterator = usersList.iterator();
             setUserDataForCollection(qc, usersIterator);
             hitCount = usersList.size();
             super.executeQueryForCollection(qc, params, noUserParams);
        } // end executeQueryForCollection
         * hasNextForCollection - overridden for custom java data source support.
        protected boolean hasNextForCollection (Object qc) {
             Iterator usersListIterator = (Iterator)getUserDataForCollection(qc);
             if (usersListIterator.hasNext()) {
                 return true;
             } else {
                 setFetchCompleteForCollection(qc, true);
                 return false;
             } // end if
        } // end hasNextForCollection
         * createRowFromResultSet - overridden for custom java data source support.
        protected ViewRowImpl createRowFromResultSet (Object qc, ResultSet resultSet) {
             Iterator usersListIterator = (Iterator)getUserDataForCollection(qc);
             String user = (String)usersListIterator.next();
             ViewRowImpl viewRowImpl = createNewRowForCollection(qc);
             try {
                 populateAttributeForRow(viewRowImpl, 0, user.toString());
             } catch (Exception e) {
                 LOGGER.severe("Error Initializing Data", e);
                 throw new JboException(e);
             } // end try/catch
             return viewRowImpl;
        } // end createRowFromResultSet
         * getQueryHitCount - overridden for custom java data source support.
        public long getQueryHitCount (ViewRowSetImpl viewRowSet) {
             return hitCount;
        } // end getQueryHitCount
        @Override
        protected void create () {
             getViewDef().setQuery(null);
             getViewDef().setSelectClause(null);
             setQuery(null);
        } // end create
        @Override
        protected void releaseUserDataForCollection (Object qc, Object rs) {
             Iterator usersListIterator = (Iterator)getUserDataForCollection(qc);
             usersListIterator = null;
             super.releaseUserDataForCollection(qc, rs);
        } // end releaseUserDataForCollection
    } // end class
    <af:inputListOfValues id="userName" popupTitle="Search and Select: #{bindings.UserName.hints.label}" value="#{bindings.UserName.inputValue}"
                                                  label="#{bindings.UserName.hints.label}" model="#{bindings.UserName.listOfValuesModel}" required="#{bindings.UserName.hints.mandatory}"
                                                  columns="#{bindings.UserName.hints.displayWidth}" shortDesc="#{bindings.UserName.hints.tooltip}" autoSubmit="true"
                                                  searchDesc="#{bindings.UserName.hints.tooltip}"                                          
                                                  simple="true">
                              <f:validator binding="#{bindings.UserName.validator}"/>                      
    </af:inputListOfValues>

    I have found a solution to this issue. It seems that when using a programmatic view object which has a transient attribute as its primary key you need to override more methods in the ViewObjectImpl so that it knows how to locate the row related to the primary key when the view object records aren't in the cache. This is why it would work correctly sometimes but not all the time. Below are the additional methods you need to override. The logic you use in retrieveByKey would be on a view object by view object basis and would be different if you had a primary key which consisted of more than one attribute.
    @Override
    protected Row[] retrieveByKey (ViewRowSetImpl viewRowSetImpl, Key key, int i) {
        return retrieveByKey(viewRowSetImpl, null, key, i, false);
    @Override
    protected Row[] retrieveByKey (ViewRowSetImpl viewRowSetImpl, String string, Key key, int i, boolean b) {
        RowSetIterator usersRowSetIterator = this.createRowSet(null);
        Row[] userRows = usersRowSetIterator.getFilteredRows("UserId", key.getAttribute(this.getAttributeIndexOf("UserId")));
        usersRowSetIterator.closeRowSetIterator();
        return userRows;
    @Override
    protected Row[] retrieveByKey (ViewRowSetImpl viewRowSetImpl, Key key, int i, boolean b) {
        return retrieveByKey(viewRowSetImpl, null, key, i, b);

  • Firefox homepage button opens new window instead of new tab

    When I hit the homepage button on the Firefox toolbar, it now opens a whole new window instead of a new tab. It used to work until I upgraded to Firefox 9. Any suggestions as to how to fix this?

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Use Enter key to execute report.

    I have a report that needs to be executed in background.It has a selection screen.The program should get executed when user presses 'ENTER' while he is inside the selection screen.At present,when 'ENTER' key is pressed,only validation is done.To execute we are  either pressing 'F8'  key or click execute button in screen.
    Now how to trap the 'ENTER' key press in  a report?

    Hi Jayaprakash,
    All PAI processing will depend on the Function Code that has been triggered at the selection screen.
    The ENTER key has no function code, whereas the "Execute" button has the function code 'ONLI'. SO what can be done is, when the user hits the ENTER key, we can programmatically set the function code to 'ONLI'. I shall give you a very small peice of code to illustrate my point.
    ===================================
    tables sscrfields.
    parameters p_vblen like vbak-vbeln obligatory.
    at selection-screen.
    if sscrfields-ucomm eq space.
    sscrfields-ucomm = 'ONLI'.
    endif.
    start-of-selection.
    write p_vblen.
    ===================================
    The above code will trigger the report output on hitting the ENTER key at the selection screen.
    What you only have to note here is that unlike with screen processing, in selection-screen processing, the function code will be made available in the field UCOMM of the structure SSCRFIELDS. However, you will have to declare this structure in your program ( using the TABLES statement as shown above ).
    Hope the explanation has been clear enough to drive the point home for you. Please get back to me otherwise.
    Regards,
    Anand Mandalika.

  • By pressing enter key on button?

    By pressing ENTER key on key board on button(SUBMIT) how i get action perform.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class loginform {
         public static void main(String a[]) {
              loginform1 s = new loginform1();
              s.setSize(800, 600);
              s.setVisible(true);
    class loginform1 extends JFrame implements ActionListener {
         JTextField user;
         JPasswordField pass;
         JButton submit;
         public loginform1() {
              setLayout(null);
              Container c = getContentPane();
              JLabel JLabel1 = new JLabel("User Name:");
              c.add(JLabel1);
              JLabel1.setBounds(220, 205, 90, 20);
              JLabel JLabel2 = new JLabel("Password:");
              c.add(JLabel2);
              JLabel2.setBounds(220, 245, 90, 20);
              user = new JTextField();
              c.add(user);
              user.setBounds(300, 205, 130, 20);
              setVisible(true);
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        user.requestFocus();
              pass = new JPasswordField();
              c.add(pass);
              pass.setBounds(300, 245, 130, 20);
              submit = new JButton("Submit");
              c.add(submit);
              submit.setBounds(320, 290, 80, 20);
              submit.addActionListener(this);
              WindowListener l = new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {
                        System.exit(0);
              addWindowListener(l);
         public void actionPerformed(ActionEvent ae1) {
              if (ae1.getSource() == submit) {
                   String s1 = user.getText();
                   String s2 = pass.getText();
              System.out.println(s1);
              System.out.println(s2);
    }how to get that one.
    thanks in advance
    raja

    add this to loginform1's constructor
    this.getRootPane().setDefaultButton(submit);

  • Http Submit Form Button to New Window

    Hello,
    Does anyone know how to make a HTTP Submit Button open in a new window rather than the same window?
    I have a form that I need the user to print off as well as click a link so they can pay with Paypal. The problem is that if the user clicks the pay with paypal button before the print button, they will lose all of their data in the form.
    Here is the form if needed: http://staging.ebizresults.info/wsra-pdf/membership_flat.pdf
    Any help would be great. I am using Acrobat 8.
    Thanks,
    Pat

    Somethings I forgot to mention. First, I'm fairly new to Acrobat, so I'm not really sure what you're talking about.
    Second, I imported HTML code into Acrobat to get the form. Then I opened the form in LiveCycle because I didn't know how to get the email buttons and submit buttons on the page. So, I am working with a flattened PDF.
    I'm not sure if this make a difference or not, but it's a button not a link.
    I still have the unflattened pdf available to me. Is it in my best interest to avoid flattening the file? If this is the case, any advise on making submit buttons and whatnot myself?
    Thanks,
    Pat

Maybe you are looking for