3 Replies Latest reply on Jan 14, 2010 3:32 PM by idyoshin

    How can i use keyboard keys in seam application.

    abucs01

      Hi,


      Lets take example :
      i have form with 4 fields , submit and cancel button, now i entered valid value in all four fields and on-behalf of clicking submit button i pressed Enterkey in keyboard, i need to submit the  form as like submit button , is it possible in seam, if it is then pls guide me.

        • 1. Re: How can i use keyboard keys in seam application.
          idyoshin

          simply add type="submit" to your <h:commandButton/> or <a4j:commandButton/>


          Regards,


          Ilya Dyoshin

          • 2. Re: How can i use keyboard keys in seam application.
            abucs01

            Hi ilya,


            thnx for reply, but it is not working,


                 <a:commandButton action="#{newBooking.next()}" type="submit" value="#{messages['button.continue']}" title="#{messages['button.continue']}" reRender="contentPanel,requirementsform,noOfBookablesPanel,requirementPanel,guestRequirements"/>

            • 3. Re: How can i use keyboard keys in seam application.
              idyoshin

              don't know why.... maybe you should verify that the button belongs to the same form (not the nested). for h:commandButton it works perfectly. Maybe some minor bug in the ajax4jsf


              The documentation says:


              type     This attribute specifies a type of control to create. The possible values are "submit", "reset", "image" and "button". The default value for this attribute is "submit"



              maybe for your current usage you can rewrite like:


              <a4j:form ajaxSubmit="true">
              .... some form content ... 
              <h:commandButton action="#{newBooking.next()}" type="submit" value="#{messages['button.continue']}" title="#{messages['button.continue']}" >
                  <a4j:support reRender="contentPanel,requirementsform,noOfBookablesPanel,requirementPanel,guestRequirements event="oncomplete" />
              </h:commandButton>
              
              </a4j:form>




              regards,


              Ilya Dyoshin