Hi all,
First off I want to say I really like the idea of vaadin, the Java only idea as well as making it as desktop like as possible. However, at the moment I am a bit frustrated and I was hoping I could get some advice. I implemented the address book application in GAE using the datastore and the GAEcontainer. It seems like my version isn’t working very well so maybe its something stupid I did. I will admit I just replaced stuff with the GAEcontainer, and fiddled around until I stopped seeing errors. There wasn’t a whole lot of understanding occuring.
Anyway,
A version someone else did, it seems to work fine, load up ok and whatnot
http://vaadin-addressbook-test.appspot.com/
My version of the address book done in GAE
http://vaddybook.appspot.com/
my version take ages to update when you scroll. Sometimes when you scroll and select, it will unselect itself.
I am using the GAEContainer, and I already have a list of 103 type “Person” in the datastore.
Here are the only real changes I did. It seems odd that I have to add those container properties on every load up, but that is the only way I could get it to work with the table
package com.example.test2.data;
import java.io.Serializable;
import java.util.Random;
import com.vaadin.data.Item;
import com.vaadin.data.util.BeanItemContainer;
import com.vaadin.data.util.ObjectProperty;
import fi.abo.GAEContainer.impl.DatastoreImpl;
import fi.abo.GAEContainer.impl.GAEContainer;
@SuppressWarnings("serial")
public class PersonContainer extends GAEContainer implements
Serializable {
/**
* Natural property order for Person bean. Used in tables and forms.
*/
public static final Object[] NATURAL_COL_ORDER = new Object[]
{
"firstName", "lastName", "email", "phoneNumber", "streetAddress",
"postalCode", "city" };
/**
* "Human readable" captions for properties in same order as in
* NATURAL_COL_ORDER.
*/
public static final String[] COL_HEADERS_ENGLISH = new String[]
{
"First name", "Last name", "Email", "Phone number",
"Street Address", "Postal Code", "City" };
public PersonContainer() throws InstantiationException,
IllegalAccessException {
super("Person");
}
public static PersonContainer createWithTestData() {
PersonContainer c = null;
try {
c = new PersonContainer();
c.addContainerProperty("firstName", java.lang.String.class, "");
c.addContainerProperty("lastName", java.lang.String.class, "");
c.addContainerProperty("city", java.lang.String.class, "");
c.addContainerProperty("email", java.lang.String.class, "");
c.addContainerProperty("phoneNumber", java.lang.String.class, "");
c.addContainerProperty("streetAddress", java.lang.String.class, "");
c.addContainerProperty("postalCode", java.lang.String.class, "");
} catch (InstantiationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return c;
}
}
Any ideas?
Edit:
GAE reports pretty heavy cpu usage, which you would expect for the delay.
After looking at it a bit more it seems like maybe my performance is how GAEcontainer works, http://abocloudtest.appspot.com/, is the sample app for the container. If you drag that around its pretty similiar to mine.
That is really not very good for just a simple app, and I wouldn’t want to build something complex using GAEcontainer then. Should I expect it to work better if I directly use the google datastore methods?