How to implement an editor Grid from Database table using GXT..??

135 views
Skip to first unread message

Raul

unread,
May 28, 2009, 8:48:18 AM5/28/09
to gwt-maven
Hi All

Can anyone help me out in using a Grid, which will be populated with
the record from one of my database table.

Say there is a table named 'users' and i want to display the list of
all users in my grid along with edit option.


I am trying it out by using GXT (http://extjs.com/products/gxt).

My basic codes look like

private final UserListServiceAsync service = (UserListServiceAsync)
GWT.create(UserListService.class);

RpcProxy<BeanModel> proxy = new RpcProxy<BeanModel>(){
@Override
protected void load(Object loadConfig, AsyncCallback callback) {
service.getUsers(callback);
}
};

BeanModelReader reader = new BeanModelReader();
loader = new BaseListLoader(proxy, reader);

store = new ListStore(loader);

List<ColumnConfig> col = new ArrayList<ColumnConfig>();

ColumnConfig column = new ColumnConfig();
column.setId("username");
column.setHeader("User Name");
col.add(column);

column = new ColumnConfig();
column.setId("name");
column.setHeader("User Full Name");
col.add(column);

column = new ColumnConfig();
column.setId("email");
column.setHeader("Email");

column.setAlignment(HorizontalAlignment.CENTER);
col.add(column);
ColumnModel cm = new ColumnModel(col);

Grid<BeanModel> grid = new Grid<BeanModel>(store, cm);



But I am having compilation errors like


Compiling module com.duke.irb.IRBM
Compiling 5 permutations
Worker permutation 1 of 5
[ERROR] Unexpected internal compiler error
java.lang.StackOverflowError
at java.io.ObjectInputStream$PeekInputStream.peek(Unknown Source)
at java.io.ObjectInputStream$BlockDataInputStream.peek(Unknown
Source)
at java.io.ObjectInputStream$BlockDataInputStream.peekByte(Unknown
Source)

..............................
................................


at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
[ERROR] Unrecoverable exception, shutting down
com.google.gwt.core.ext.UnableToCompleteException: (see previous log
entries)
at
com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.logAndTranslateException
(JavaToJavaScriptCompiler.java:610)
at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.compilePermutation
(JavaToJavaScriptCompiler.java:207)
at com.google.gwt.dev.CompilePerms.compile(CompilePerms.java:181)
at com.google.gwt.dev.ThreadedPermutationWorkerFactory
$ThreadedPermutationWorker.compile
(ThreadedPermutationWorkerFactory.java:47)
at com.google.gwt.dev.PermutationWorkerFactory$Manager
$WorkerThread.run(PermutationWorkerFactory.java:72)
at java.lang.Thread.run(Unknown Source)
[ERROR] Not all permutation were compiled , completed (1/5)



I will provide further information in case needed.


thanks in advance.


Raul

Malte

unread,
May 31, 2009, 1:09:41 PM5/31/09
to gwt-maven
First of all I would say this is the wrong forum for such a problem.
Next time use the official GXT discussion group. http://extjs.com/forum/
But you have luck, I am using GXT too and realized all that before.
Ok, now to your problem: Have you defined a BeanModelMarker interface?
So your BeanModelFactory knows your remote class and use the generics
to define type save which classes you are using.
Reply all
Reply to author
Forward
0 new messages