Capture enter key press in h:inputtext

hi,
i have a h:inputText component in my jsf page. i need to capture the enter key pressed for this component. how can this be done.
thanks in advance.

You can use Javascript for this. In the onkeypress event, check if the keycode is 13 (the enter key) and handle accordingly.
onkeypress="if (event.keyCode == 13) alert('Enter pressed!');"

Similar Messages

  • Capturing Enter Key Press

    Hi
      Is there a way where we can capture the Enter Key press of the Keyboard and call an event on the Enter Key Press??
    For fields such as input field there is onEnter field where an event can be called, but we have a requirement where in we need to call an event on click of enter key, irrespective of where the focus on the page is on.
    Any inpus on this will be helpful.
    Thanks & Regards,
    Gayathri Shanbhag

    Hi Gayathri,
    See if the following link helps:
    https://cw.sdn.sap.com/cw/docs/DOC-107045
    Regards,
    Himanshu

  • Capture ENTER key on numeric keypad

    I have several chemistry tutorials where users type something and then have it evaluated by pressing the ENTER key. This works fine for the ENTER key on the main part of the keyboard, but does not work for the ENTER key for the numeric keypad on keyboards with the two ENTER keys. How do I capture the ENTER key on the numeric keypad? In other words, how do I do the equivalent of the following for that key?  
    if the key = RETURN then
    Thanks

    Try checking:
    if _key.keyCode = 36 then ...

  • Capturing Enter key event from text box

    In my application, there are a number of text boxes. I want to create a feature where an enter key even is seen and specific function executed depending on which text box was in focus when the enter key was pressed. Currently I am able to capture an enter key event on the whole page. How do I do that specifically for a text box?
    This application is done in HTML, javascript and Adobe AIR.
    Thanks
    Binu
    www.verseview.info

    Hi
    That's true that Flex4.5 SDK under Flash builder Burito doesn't listen Enter key in Text Area for KeyUp or KeyDown event.
    Here I found a work around you can use.
    Add an eventlistener to the component in actionscript and set the useCapture=true next to eventlistener function. Now you can listen enter key for KeyUp or KeyDown Event
    Hope this helps
    Rush-me

  • Capture 'Enter' key event

    Hi,
    Is there any way we can capture the event when a user presses the enter key inside a text field?

    Hi andrewquay
    you can capture the enter key by adding the following code in the textfield's change event.
    if(xfa.event.change == "\u000a")
    xfa.host.messageBox("enter key is pressed");
    mail: [email protected]

  • Capturing ENTER key in WD4A

    Hi all,
    I m getting an input from the user in an Inputfield. I also have a table with two columns.
    The textfield is used to perform wildcard search (filter) for the table. That is, if i give a character like 'A', then the records which start with the character 'A' must be shown in the table when i press teh ENTER key..
    I have got this outptu when i click a button. But i want to get the same output, when i give 'A' and press ENTER key..
    How to acheive the same in WD4A?
    Regards,
    Shanthi

    hi Shanthi,
    for the corresponding Enter key , make a action say act in the EventPropery of the element.
    in the Onactionact,method in the Methods tab , write the same piece of code , which u r writting in the Button
    u wud be able to do it nw
    regards,
    amit

  • Capturing Enter key in ALV

    Hi Experts,
    Am using an editable alv. I want to perform some actions when Enter key is pressed.
    I did this in DOMODIFY. But this makes the scroll bar in initial position. Kindly help me on this.
    Regards,
    Vijayakumar.

    Hi vijayakumar,
    You can refer this link for info about ENTER key event trigger. Could you please post what you want to perform when Enter key is pressed.
    Link: [http://wiki.sdn.sap.com/wiki/display/ABAP/InteractiveEditableOOALVgridwithdynamicitab,FCATandENTERkeyeventtrigger]
    Regards,
    Anand G

  • Configuring what element gets enter key press in JDialog?

    Hi all,
    In windows applications, some dialogs or windows, have a specific button that gets activated when enter is pressed. E.g. in a JDialog, the OK button would normally be activated when no button had focus. How do you set this to be? Is there some API call to do this? And is there some way to do the same with the escape key, so that cancel will always get triggered when its pressed?
    I just don't want to have to manually add a key listener to each component in the dialog that listens for the escape and enter buttons to be pressed.
    thanks,
    J

    As for the Esc key, there is nothing "out of the box" to do this. I created a JDialog sub-class to handle it, which I use in place of JDialog throughout my app. In the JDialog sub-class, over-ride the createRootPane() method as follows:
        * Overriding this method to register an action so the 'Esc' key will dismiss
        * the dialog.
        * @return a <code>JRootPane</code> with the appropiate action registered
       protected JRootPane createRootPane()
          JRootPane pane = super.createRootPane();
          pane.getInputMap( JComponent.WHEN_IN_FOCUSED_WINDOW ).
             put( KeyStroke.getKeyStroke( KeyEvent.VK_ESCAPE, 0 ), "escPressed" );
          pane.getActionMap().put( "escPressed",
             new AbstractAction( "escPressed" )
                public void actionPerformed( ActionEvent actionEvent )
                   onDialogClose();
          return pane;
       }then, create an abstract onDialogClose() method like the following:
        * This method gets called when the user attemps to close the JDialog via the
        * 'Esc' key.  It is up to the sub-class to implement this method and handle
        * the situation appropriately.
       protected abstract void onDialogClose();Alternatively, you could create a default implemenation of onDialogClose() instead of making it abstract; sub-classes could still over-ride it if they needed custom behavior.
    HTH,
    Jamie

  • Problem capturing "Enter Key" within 2 paragraph in JSP

    I create a textarea for customer to enter their data. Something the data contain 2 paragraph with Enter Key involve. Then, i store the data into my database. Once i re-display the data back to customer, the data never show in 2 paragraph ?
    who know.... pls pls help..... in JSP how am i going to do, so that the data disply in 2 paragraph.

    Are you displaying the data again in TextArea? If not then you need to take care of '\r\n'. Split the data for '\r\n' and display the data in two paragraphs.
    String wholeData="Your_Paragraph1\r\nYour_Paragraph2";
    StringTokenizer st = new StringTokenizer(wholeData,"\r\n");
    while(st.hasMoreTokens()) our.print(st.nextToken()+"<br>");Hope this helps.
    Sudha

  • JSF 2.0 ajax : Submit form  on Enter key press in h:inputTextarea

    Dear All,
    I am new to JSF 2.0 . Just wanted to submit the form in ajax when a user hits the "Enter": key while typing
    in the h:inputTextarea . I would be very thankful to you guys if you help me out.
    Thanking in advance!

    I found the problem and a solution :-) The missing piece of the puzzle was the id attribute for the form tag. After some debugging of the JSF JavaScript I found the solution.
    The JavaScript function response(request, context) is invoked to handle the server response. Inside this function the doUpdate(element, context) is invoked.
    The doUpdate() function is doing the modification of the DOM. The function doUpdate() is two times invoked for a response. The first time the html elements are updated.
    The second time the view state hidden field is updated or created but only under the following condition:
    Comment in the JavaScript source code of the jsf.js
    //Now set the view state from the server into the DOM
    //but only for the form that submitted the request.If the forms of the both side haven't the same id the form can't be found on the second page.
    In the following way it is working:
    page1.xhtml
    <h:form id="myform">
            <h:commandLink value="Go to page 2" action="page2">
                <f:ajax render="@all" execute="@all"/>
            </h:commandLink>
    </h:form>
    .....page2.xhtml
    <h:form id="myform">
                <h:commandLink value="Go to page 1" action="page1">
                    <f:ajax render="@all" execute="@all"/>
                </h:commandLink>
    </h:form>So always set an explicit id for each JSF tag.

  • Enter key press instead of tab key

    I want to use enter key Instead of tab key in my page to move to next item
    Please answer in detail steps because i am new to apex and especially to Javascript

    I strongly advice against using an app like this.
    I always play by the rule not to re-invent the wheel.
    Try to convince the user from the new possibilities and the fact that tabbing is a default procedure.
    You'll see that this will be easier than actually programming the enter-key to act like the TAB key.
    I you really need to do this, then you'll need to do something like this
    http://thinksimply.com/blog/jquery-enter-tab
    good luck!
    Regards,
    Richard
    blog: http://blog.warp11.nl
    twitter: @rhjmartens
    If this question is answered, please mark the thread as closed and assign points where earned..

  • Setting component to recieve enter key presses?

    Hi all,
    if I have a dialog with a number of buttons on it, is there anyway I can set one component (an OK button) to be activated when the enter button is pressed, and another one (cancel) to be activated when the escape button is pressed?
    I know I could add actions to the action map, but isn't there usually a way to set one button to be actived on enter. It usually appears in bold, or slightly highlighted.
    thanks,
    J

    Hi all,
    if I have a dialog with a number of buttons on it, is
    there anyway I can set one component (an OK button)
    to be activated when the enter button is pressed, and
    another one (cancel) to be activated when the escape
    button is pressed?
    I know I could add actions to the action map, but
    isn't there usually a way to set one button to be
    actived on enter. It usually appears in bold, or
    slightly highlighted.
    someDialog.getRootPane().setDefaultButton(someButton);Jim S.

  • How do I capture two key press?

    How do I captyure Ctrl+Shift+A or Ctrl+A in KeyListener?

    Use the getModifiersEx() method of your KeyEvent. That contains a bitfield of the different modifiers (including CTRL and SHIFT) that were in effect when the event was generated. So you can do things like:
    KeyEvent evt = ...
    int keyCode = evt.getKeyCode();  // Let's say this is KeyEvent.VK_A
    int modifiers = evt.getModifiersEx();
    if( (modifiers & CTRL_DOWN_MASK) != 0 ) {
        // CTRL was down --> We have a CTRL-A event
    }Read the KeyEvent (or rather InputEvent, KeyEvent's baseclass) API for more info.

  • Blue "Change" button does not respond to enter key (OS X)

    After entering a new Time in the "Edit Capture Time" screen you select change and the new time is applied. This could be done by selecting the "change" button with the mouse or by hitting the return key or the enter key (since "change" is the blue highlighted button). But in Lightroom 3 and now in Lightroom 4B the enter key doesn't work. Can you please fix this bug. Thanks!

    Just to be sure, I updated the program as follows. Click on the mouse to request focus and then hit enter key.
    Click on the mouse prints the String "enter key pressed". Then press the Enter key..no action activated.
    var button : SwingButton;
    Stage {
    title: "MyApp"
    visible: true
    scene: Scene {
    width: 100
    height: 100
    content: [
    button = SwingButton {
    text: "Button"
    action: function() {
    println("enter key pressed");
    button.requestFocus();
    onKeyPressed : function(event : KeyEvent):Void
    println("enter key pressed");
    }

  • How can we trape the Keys Pressed on the Keyboard and do action depending on the keys

    I want to know how we can capture the keys pressed on the keyboard by the user and do necessary action depending on the key pressed by the user....
    For example.... If user press Alt+q the form should go in the Enter Query Mode.
    Can anyone tell me how i can do this in Form 6i....
    Please Help me out from this problem...
    Thanks in Advance
    Shan

    Can somebody point me to what I need to use to
    intercept all the 'keys' for an application.
    At the moment I have set Focus to parts of the
    application when the Mouse is over it, and then get
    the Keys with a KeyListener.
    Is there a way to get the keys, as long as the Java
    app is active.
    - Its an image display program, and I want to use keys
    for - next image , zooom etc etc.
    If soemone could just point me to the right part of
    the API to look in?java.awt.Toolkit.addAWTEventListener()
    then use the mask defined in AWTEvent.KEY_EVENT_MASK to listen to all the events.
    Steve

Maybe you are looking for

  • Project management software for MAC

    I'm looking for a Project Management software for MAC ?

  • How can i set up lightroom for tethered shooting with an eithernet cable

    So I have my Nikon d4 set up with Nikon Picture control so that it will download to my laptop with an Ethernet cable but it downloads to a file on the hard drive - I can choose what file, etc but what I want to do is take advantage of Lightrooms teth

  • Flash Format Forms No Workie

    I'm able to test a simple CFForm with Flash format on my personal web account and it works great. However, in the same MX 7 environment the form won't generate. It will generate a Flash plugin component, but no form elements. I suspect that there is

  • Saving after edit in iPhoto....

    When I import a new photo with red eyes (as an example), I double click to put it into iPhoto edit mode. I select the red eyes tool (or whatever tool is needed), click on the eyes, and the photo edit is done. When I either close the window, or click

  • Fullscreen Movies with Embedded QT Player

    Ok guys, someone please help me, I'm going crazy over here and can't find anything on the topic. I have QT movies embedded into an HTML page, how do you enable a fullscreen function? Or can this even be done? I've never seen a tool bar that allows fu