<a:form> <a:remoteCommand name="rc" update="msgs" actionListener="#{remoteCommandView.execute}" /> <a:growl id="msgs" showDetail="true" /> <a:commandButton type="button" onclick="rc()" value="Execute" icon="ui-icon-refresh" /> </a:form>
package com.jarch.showcase.view.ajax; import javax.faces.application.FacesMessage; import javax.faces.bean.ManagedBean; import javax.faces.context.FacesContext; @ManagedBean public class RemoteCommandView { public void execute() { FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Executed", "Using RemoteCommand.")); } }