title: PrimeFaces remote command is not invoking
body: <p>I am using a remote Command button to execute a method to a bean level. But my command button is not working . </p>
  
  <p>I am attaching my code below:</p>
  
  <pre><code> &lt;html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"&gt;
  
  &lt;ui:composition template="/layouts/BasicTemplate.xhtml"&gt;
      &lt;ui:define name="content"&gt;
          &lt;div class="container"&gt;
  
          &lt;script&gt;
  
          function doAlert(s)
          {
              if(s=="true")
                  {
                  alert(s);
                  rc();
                  alert('hi i am');
                  }
              else
                  {
                   alert("Wrong Finger Print");
                  }
          }
  
          &lt;/script&gt;
  
  
            &lt;h:form class="form-horizontal" id="myform" &gt;
                  &lt;div class="row"&gt;
  
          &lt;h:messages /&gt;
          &lt;h:panelGrid columns="3" cellpadding="4" border="0" columnClasses="control-label"&gt;
  
              &lt;h:outputText  value="Username :" /&gt;
              &lt;h:inputText id="username" value="#{loginBean.login}" label="username" style="width: 200;" /&gt; 
              &lt;p:watermark for="username" value="Username" &gt;&lt;/p:watermark&gt;
  
              &lt;h:outputLabel for="password" value="Password :" /&gt;
              &lt;h:inputSecret id="password" value="#{loginBean.password}" label="password" style="width: 200;"/&gt; 
              &lt;p:watermark for="password" value="Password"&gt;&lt;/p:watermark&gt;
  
              &lt;p:spacer&gt;&lt;/p:spacer&gt;
              &lt;!-- &lt;p:commandButton value="Login" action="#{loginBean.logMeIn}" widgetVar="mybutton" /&gt; --&gt;
  
              &lt;p:commandButton id="loginButton" value="Login" action="#{loginBean.logMeIn}" widgetVar="mybutton"  disabled="#{!loginBean.enabled}"/&gt;
              &lt;p:remoteCommand name="rc" update="loginButton" actionListener="#{loginBean.enableButton}" /&gt; 
              &lt;p:spacer&gt;&lt;/p:spacer&gt;
              &lt;h:outputText value="#{loginBean.enabled}"&gt;&lt;/h:outputText&gt;
              &lt;applet id="fingureprintapplet" name="fingureprint" codebase="classes"  code="fingerprintntscanner.MyClassApplet.class" archive="#{facesContext.externalContext.requestContextPath}/FIngerprintntScanner.jar,#{facesContext.externalContext.requestContextPath}/lib/NBioBSPJNI.jar" width="300" height="400"&gt;
  
              &lt;/applet&gt;
          &lt;/h:panelGrid&gt;
  
          &lt;/div&gt;
          &lt;/h:form&gt;
  
          &lt;/div&gt;
      &lt;/ui:define&gt;
  &lt;/ui:composition&gt;
  </code></pre>
  
  <p>My bean is:</p>
  
  <pre><code>     @ManagedBean(name = "loginBean")
  @SessionScoped
  public class LoginBean implements Serializable {
      private static final long serialVersionUID = 1L;
  
      private String login;
      private String password;
      private boolean enabled;
  
      @ManagedProperty(value = "#{authenticationService}")
      private AuthenticationService authenticationService; // injected Spring defined service for bikes
  
  
      public String logMeIn() {
  
          boolean success = authenticationService.login(login, password);
  
          if (success){
              return "/faces/pages/home.xhtml?faces-redirect=true"; // return to application but being logged now 
          }
          else{
              FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Login or password incorrect."));           
              return "/faces/login.xhtml";
          }
      }
  
      public String logout(){
          System.out.println("chandan");
          authenticationService.logout();
          return "/faces/pages/home.xhtml?faces-redirect=true"; 
      }
  
      public String getLogin() {
          return login;
      }
  
      public void setLogin(String login) {
          this.login = login;
      }
  
      public String getPassword() {
          return password;
      }
  
      public void setPassword(String password) {
          this.password = password;
      }
  
  
  
      public void setAuthenticationService(AuthenticationService authenticationService) {
          this.authenticationService = authenticationService;
      }
  
      public void enableButton() {
          System.out.println("chandan");
          enabled = true;
      }
  
      public boolean isEnabled(){
          System.out.println("value is");
          return enabled;
      }
  
      public void setEnabled(boolean enabled) {
          System.out.println("value is sdgsdg");
          this.enabled = enabled;
      }
  </code></pre>
  
  <p>Please check why my remote command is not working.</p>