tags:

views:

163

answers:

6

Hi,

I am planning to use GWT for a small Reporting Tool and I am learning GWT now. As a first learning Project I am trying to build a CRUD screen.

I've successfully built the form and learnt about layout and the necessary widgets. However, I have 2 queries. (1) I am unable to find a widget that is similar to a spreadsheet like table that I can populate the results with. (2) I am not sure how to take the response that I get from the server on clicking the submit button in the form and use that to populate the table. It would be great if you could point me to reference/documentation on GWT to do this. I am learning GWT by reading the online documentation.

UPDATE: I cannot use SmartGWT. I am restricted to only using GWT for my project.

Thanks

+2  A: 

If you want to stick to pure GWT then ScrollTable Widget will give you a spreadsheet like look and feel. ScrollTable is much better than FlexTable Widget available currently with GWT SDK. That said ScrollTable not available as yet in GWT2, but you can find it in GWT incubator.

Here is the link to a simple demo

Source and Docs for Scroll Table here

Other option is to use Data Presentation widgets in the GWT 2.1M2 release. Sample code here

If you are looking outside of pure GWT then GXT has a nice Grid Widget. However before using GXT consider the license requirements first.

Ashwin Prabhu
+1  A: 

Im not sure it is what you need, but look at this (older) code:

loginButton.addClickHandler(new ClickHandler() {

                public void onClick(ClickEvent event) {
                    benutzerVerwaltungService.istBenutzerOk( usernameItem.getDisplayValue(), passwordItem.getDisplayValue(), new AsyncCallback< Boolean >() {                       
                        public void onFailure( Throwable caught ) {
                            SC.say( "Es ist ein Verbindungsfehlter aufgetreten! "+caught.getMessage());
                        }
                        public void onSuccess(Boolean result) {
                            // <------------ Login hier immer erfolgreich wegen || true -------------->
                            if( result.equals( Boolean.TRUE ) ) { 
                                Benutzer b = new Benutzer( usernameItem.getDisplayValue(), passwordItem.getDisplayValue(), new BenutzerRechte() );
                                LoginData.setEingeloggterBenutzer(b);
                                //SC.say( "Sie sind jetzt angemeldet!");
                                mmCallback.showMainMenu();
                            }
                            else {
                                SC.say( "Benutzer konnte nicht angemeldet werden!");
                            }
                        }
                    });
                }
            });

As you can see you can populate your data in the onSuccess MEthod. Here is the gwt tut about this stuff: GWT RPC

InsertNickHere
A: 

Use grid or flex table component of GWT.Refer this link http://examples.roughian.com/index.htm#Widgets~FlexTable.

Sonal Patil
+1  A: 

for how to take response from server, on code.google.com i uploaded one GWT application http://code.google.com/p/webservletapplication/source/checkout Take checkout of this app.Here I uses servlet to get response from server.I hope this sample app helpful to you.

Sonal Patil
A: 

I haven't used spring roo, But this may be a solution for you.

iftee
A: 

grails has a gwt plugin: http://www.grails.org/plugin/gwt

Ray Tayek