JSI
import com.farheap.jsi.server.model.ProductEnt;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DecoratedTabPanel;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.TextBox;
public class Dashboard implements EntryPoint {
/**
* Create a remote service proxy to talk to the server-side Greeting service.
*/
private final GreetingServiceAsync greetingService = GWT.create(GreetingService.class);
@Override
public void onModuleLoad() {
RootPanel rootPanel = RootPanel.get("container");
AbsolutePanel absolutePanel = new AbsolutePanel();
rootPanel.add(absolutePanel, 10, 10);
absolutePanel.setSize("710px", "507px");
DecoratedTabPanel tp = new DecoratedTabPanel();
AbsolutePanel absolutePanel_1 = new AbsolutePanel();
final TextBox name = new TextBox();
absolutePanel_1.add(name, 103, 20);
name.setSize("155px", "10px");
FlexTable flexTable = new FlexTable();
flexTable.setWidget(0, 0, absolutePanel_1);
absolutePanel_1.setSize("100%", "100%");
Label namelbl = new Label("Name");
absolutePanel_1.add(namelbl, 23, 20);
namelbl.setSize("74px", "18px");
Label medialbl = new Label("Media");
absolutePanel_1.add(medialbl, 23, 44);
medialbl.setSize("74px", "18px");
Label heightlbl = new Label("Height");
absolutePanel_1.add(heightlbl, 23, 68);
heightlbl.setSize("74px", "18px");
Label widthlbl = new Label("Width");
absolutePanel_1.add(widthlbl, 23, 92);
widthlbl.setSize("74px", "18px");
Label weightlbl = new Label("Weight");
absolutePanel_1.add(weightlbl, 23, 116);
weightlbl.setSize("74px", "18px");
final TextBox media = new TextBox();
absolutePanel_1.add(media, 103, 44);
media.setSize("155px", "10px");
final TextBox height = new TextBox();
absolutePanel_1.add(height, 103, 68);
height.setSize("155px", "10px");
final TextBox width = new TextBox();
absolutePanel_1.add(width, 103, 92);
width.setSize("155px", "10px");
final TextBox weight = new TextBox();
absolutePanel_1.add(weight, 103, 116);
weight.setSize("155px", "10px");
final Button btnSave = new Button("Save");
absolutePanel_1.add(btnSave, 103, 150);
tp.add(flexTable, "Products", true);
flexTable.setHeight("443px");
tp.add(new HTML("X"), "X");
tp.add(new HTML("Y"), "Y");
tp.add(new HTML("Z"), "Z");
tp.setSize("690px", "487px");
absolutePanel.add(tp, 10, 10);
//Create a handler for the sendButton and nameField
class MyHandler implements ClickHandler {
/**
* Fired when the user clicks on the sendButton.
*/
public void onClick(ClickEvent event) {
ProductEnt productEnt = new ProductEnt();
productEnt.setName(name.getText());
productEnt.setMedia(media.getText());
productEnt.setHeight(Float.parseFloat(height.getText()));
productEnt.setWidth(Float.parseFloat(width.getText()));
productEnt.setWeight(Float.parseFloat(weight.getText()));
greetingService.greetServer(productEnt, new AsyncCallback<String>() {
public void onFailure(Throwable caught) {
}
public void onSuccess(String result) {
}
});
}
}
btnSave.addClickHandler(new MyHandler());
}
}
Hi, I am new to GWT and made a little test. In the GWT Designer it looks fine. But when deployed on my JBoss nothing is in the browser.
I have attached the client java file and the html file.
Thanks
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment