9 Replies Latest reply on Jan 29, 2008 8:25 AM by Piotr Walczyszyn

    different behaviour when clicking on a button or using enter

    Carsten Hoehne Master

      we experience this problem:
      Clicking on a button behaves different than pressing the button via return/enter key.

      Displaying a form (long-running-conversation active)
      Inside this form the user can activate a new page which starts a nested conversation.

      <ui:composition xmlns=[...]
       <ui:define name="body">
       <h:commandButton action="#{tgw.save}" value="save"></h:commandButton>

      The save action is annotated with @End and it performs a endAndRedirect:
       public void save(){
      [...] Events.instance().raiseEvent("CALCYIELD",plot);

      When clicking on the button, the user is redirected to the enclosing form and the nested conversation has ended.
      But when the user presses the return/enter key inside the form a redirection to the enclosing form happend but the nested conversation has not ended.
      What is going on here?
      This is happening inside a seam-gen generated project (with Seam2.0.0Beta1)
      I've just reassured that the save action is really called when pressing enter/return

      Another related question (which has little relation to seam but to JSF in general. Perhaps someone has a hint)
      I have to deal with a couple of peoples who are used to press enter when they enter a numeric value in a field.
      I do not want to submit the form in this case. The only way to catch this scenario for me, is to place a default button at the top of the form which does nothing.
      Are there better ways?