7 Replies Latest reply on Oct 1, 2009 7:20 AM by Mohsin Khan

    rich:hotkey

    Mohsin Khan Newbie

      Hi
      I have given rich hot key for a4j:commandButton as below

      <h:panelGroup columns="1" id="mainGrid" style="float: left;width: 795px;display:block">
      <h:inputText id="userid"/>
      <h:inputText id="password"/>
      <a4j:commandButton id="submitbutton" value="Submit" onclick="javascript:alert('submitting');"/>
      <rich:hotKey selector="#mainGrid" key="return" handler="#{rich:element('submitbutton')}.click()"/>
      </h:panelGroup>

      I have specified the click method in handler property of the hotkey. The prob is i should not specified the click event how to invoke the default action asscocuate with that button from the hot key.

      Thanks
      Mohsin

        • 1. Re: rich:hotkey
          Mohsin Khan Newbie

          The prob is we are using a4j:command button in login page user always has to click the button with the mouse. The form should submit when user click the enter button. Is there any property we should enable to achive this. i am able to solve this by using hotkey. but it is not good solution in our frame work.

          Thanks
          Mohsin

          • 2. Re: rich:hotkey
            Ilya Shaikovsky Master

            The hotKey usage - is our main proposal when the developers asking on this case implementation.

            • 3. Re: rich:hotkey
              Mohsin Khan Newbie

              do you know how to call default action from rich:hotkey, Our frame work is dynamicaly generate the code. there may be single click double click.

              <a4j:commandButton id="submitbutton" value="Submit" action="#{pollBean.status}"/>
              <rich:hotKey selector="#mainGrid" key="return" handler="#{rich:element('submitbutton')}.click()"/>

              Is there any way to call teh action of the command button in the handle of the hotkey without calling click method as above. a4j:commandButton already action is attached to it. from hot key i need to invoke that action.

              Thanks
              Mohsin

              • 4. Re: rich:hotkey
                Ilya Shaikovsky Master

                Seems not understand the main problem :(.. clicked button will call the action specified?..

                Alternativelly you could use jsFunction and call registered function from hotKey

                • 5. Re: rich:hotkey
                  Mohsin Khan Newbie

                  why a4j:commandButton is not submitting when i specify the type is submit when i click the enter button is it necessary to use rich:hotkey to achive this.

                  <a4j:commandButton type="submit" value="standard form with a4j:commandButton"
                  actionListener="#{tabButtonBean.callActionListener}"
                  action="#{tabButtonBean.callAction}"></a4j:commandButton>

                  • 6. Re: rich:hotkey
                    Ilya Shaikovsky Master

                     

                    <h:panelGrid columns="3" styleClass="gridhello" columnClasses="gridhellocolumn">
                     <h:outputText value="Name:" />
                     <h:inputText value="#{userBean.name}" />
                     <a4j:commandButton value="Say Hello" reRender="out" type="submit"/>
                     </h:panelGrid>


                    yes, with type = submit it works for me. checked at current 3.3.2.

                    • 7. Re: rich:hotkey
                      Mohsin Khan Newbie

                      Thanks

                      it is working