onModuleLoad()
.
*/
public class SocialProfile implements EntryPoint {
- /**
- * The message displayed to the user when the server cannot be reached or
- * returns an error.
- */
- private static final String SERVER_ERROR = "An error occurred while "
- + "attempting to contact the server. Please check your network "
- + "connection and try again.";
-
- /**
- * Create a remote service proxy to talk to the server-side Greeting service.
- */
- private final GreetingServiceAsync greetingService = GWT.create(GreetingService.class);
-
/**
* This is the entry point method.
*/
public void onModuleLoad() {
- final Button sendButton = new Button( "" );
- final TextBox nameField = new TextBox();
- nameField.setText( "" );
- final Label errorLabel = new Label();
-
- // We can add style names to widgets
- sendButton.addStyleName("sendButton");
-
- // Add the nameField and sendButton to the RootPanel
- // Use RootPanel.get() to get the entire body element
- RootPanel.get("nameFieldContainer").add(nameField);
- RootPanel.get("sendButtonContainer").add(sendButton);
- RootPanel.get("errorLabelContainer").add(errorLabel);
-
- // Focus the cursor on the name field when the app loads
- nameField.setFocus(true);
- nameField.selectAll();
-
- // Create the popup dialog box
- final DialogBox dialogBox = new DialogBox();
- dialogBox.setText("Remote Procedure Call");
- dialogBox.setAnimationEnabled(true);
- final Button closeButton = new Button("Close");
- // We can set the id of a widget by accessing its Element
- closeButton.getElement().setId("closeButton");
- final Label textToServerLabel = new Label();
- final HTML serverResponseLabel = new HTML();
- VerticalPanel dialogVPanel = new VerticalPanel();
- dialogVPanel.addStyleName("dialogVPanel");
- dialogVPanel.add(new HTML("Sending name to the server:"));
- dialogVPanel.add(textToServerLabel);
- dialogVPanel.add(new HTML("
+
+ |
+
+
+
+ SSSSSS
+
+ |
+
Please enter your name: | -|
- | - |
- |