getMapButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
GwtCommand commandRequest = new GwtCommand(GetMapConfigurationRequest.COMMAND);
commandRequest.setCommandRequest(new GetMapConfigurationRequest("mapOsm", "gwt-samples"));
GwtCommandDispatcher.getInstance().execute(commandRequest, new CommandCallback() {
public void execute(CommandResponse response) {
SC.say("Command executed successfully");
}
});
}
});
commandLayout.addMember(getMapButton);
// Create a button that calls the GetMapConfigurationCommand:
IButton getResourcesButton = new IButton("command.GetResources");
getResourcesButton.setWidth(150);
getResourcesButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
GetResourcesRequest request = new GetResourcesRequest(
new String[] { "WEB-INF/security.xml" });
GwtCommand command = new GwtCommand("example.gwt.server.samples.GetSourceCommand");
command.setCommandRequest(request);
GwtCommandDispatcher.getInstance().execute(command, new CommandCallback() {
public void execute(CommandResponse response) {
// User mark should never get here...
SC.say("Command executed successfully");
}