GwtFlags/src/com/scrontch/flags/client/GwtFlags.java
/**
	 * Send the request a random flag to the server and wait for a response.
	 */
Send the request a random flag to the server and wait for a response.
Send the request a random flag to the server and wait for a response .
public void requestRandomFlag() {
		sendButton.setEnabled(false);
		serverResponseLabel.setText("");
		flagService.getRandomFlagData(
			new AsyncCallback<FlagService.FlagData>() {
				public void onFailure(Throwable caught) {
					dialogBox
							.setText("Remote Procedure Call - Failure");
					serverResponseLabel
							.addStyleName("serverResponseLabelError");
					serverResponseLabel.setHTML(SERVER_ERROR);
					dialogBox.center();
					closeButton.setFocus(true);
				}
				public void onSuccess(FlagService.FlagData flagData) {
					flagInfo = flagData.flagInfo;
					updateButtons();
       				flagWidget.setHTML(flagData.svgString);
    				sendButton.setEnabled(true);
    				sendButton.setFocus(true);
					History.newItem(flagInfo.getQueryString());
       			}
			});
	}
public void requestRandomFlag ( ) { sendButton . setEnabled ( false ) ; serverResponseLabel . setText ( "" ) ; flagService . getRandomFlagData ( new AsyncCallback < FlagService . FlagData > ( ) { public void onFailure ( Throwable caught ) { dialogBox . setText ( "Remote Procedure Call - Failure" ) ; serverResponseLabel . addStyleName ( "serverResponseLabelError" ) ; serverResponseLabel . setHTML ( SERVER_ERROR ) ; dialogBox . center ( ) ; closeButton . setFocus ( true ) ; } public void onSuccess ( FlagService . FlagData flagData ) { flagInfo = flagData . flagInfo ; updateButtons ( ) ; flagWidget . setHTML ( flagData . svgString ) ; sendButton . setEnabled ( true ) ; sendButton . setFocus ( true ) ; History . newItem ( flagInfo . getQueryString ( ) ) ; } } ) ; }
Send the request a random flag to the server and wait for a response.
Send the request a random flag to the server and wait for a response .
// Show the RPC error message to the user
 //System.out.println("sucess.");
