onModuleLoad()
.
@@ -44,9 +30,9 @@ public void test2()
test(self, me);
}
- public static int add(int a,int b)
+ public static String add(int a,int b)
{
- return a+b;
+ return "" + a+b;
}
public native void test(Object self, MatingEngine me)
@@ -54,6 +40,7 @@ public native void test(Object self, MatingEngine me)
$wnd.__sg_entry_point = self;
$wnd.__sg_me = me;
$wnd.__sg_add = $entry(@star.genetics.client.Stargenetics_gwt_java::add(II));
+ console.info( "Done!" );
return "Not A Number";
}-*/;
@@ -62,108 +49,14 @@ public native void test(Object self, MatingEngine me)
*/
public void onModuleLoad()
{
- final Button sendButton = new Button("Send");
- final TextBox nameField = new TextBox();
- nameField.setText("GWT User");
- 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("