RemoteCommand provides a simple way to execute backing bean methods with javascript.
Sometimes you need to add a dynamic callback for when the remote command completes. Each remote command, when called, returns a promise-like object you can use for that purposes. Try opening a dev console and run the function "runRemoteCommand". See below for the code.