raj_begood
13 Feb 2009, 9:27 AM
Hi
I have followed the ListViewExample and modified it to suit my needs, I have added an extra param (sessionKey) in the load call as follows, but am receiving some unusual errors.
If I remove the param and only use the callback as a parm, it works fine, but i need to propogate the client session key in each request to the server.
Error
17:25:21,259 INFO [STDOUT] ERROR - (TypeError): b.a.c has no properties
fileName: http://127.0.0.1:8080/secure/gwt-files/com.dummy.ui.modules.desktop.DesktopApp/1145521A73291CAA9935237C83CFDB28.cache.html
lineNumber: 2262
stack: kCc([object Object],[object Object])@http://127.0.0.1:8080/secure/gwt-files/com.dummy.ui.modules.desktop.DesktopApp/1145521A73291CAA9935237C83CFDB28.c
ache.html:2262
l$([object Object],[object Object],[object Object])@http://127.0.0.1:8080/secure/gwt-files/com.dummy.ui.modules.desktop.DesktopApp/1145521A73291CAA9935237C83C
FDB28.cache.html:614
// This is a global var which holds session info.
SessionKey sessionKey
RpcProxy proxy = new RpcProxy() {
@Override
protected void load(Object loadConfig, AsyncCallback callback) {
getServices().loadMetaDatabase(sessionKey, callback); // Fails
getServices().loadMetaDatabase(callback); // Works
}
};
ListLoader loader = new BaseListLoader(proxy, new BeanModelReader());
ListStore<BeanModel> store = new ListStore<BeanModel>(loader);
loader.load();
SessionKey
public interface SessionKey extends IsSerializable {
String getKey();
}
SessionKeyImpl
public class SessionKeyImpl implements SessionKey, IsSerializable {
private String key = null;
public SessionKeyImpl() {
}
public SessionKeyImpl(String key) {
this.key = key;
}
public String getKey() {
return this.key;
}
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SessionKeyImpl that = (SessionKeyImpl) o;
if (!key.equals(that.key)) return false;
return true;
}
public int hashCode() {
return key.hashCode();
}
public String toString() {
return key;
}
}
I have followed the ListViewExample and modified it to suit my needs, I have added an extra param (sessionKey) in the load call as follows, but am receiving some unusual errors.
If I remove the param and only use the callback as a parm, it works fine, but i need to propogate the client session key in each request to the server.
Error
17:25:21,259 INFO [STDOUT] ERROR - (TypeError): b.a.c has no properties
fileName: http://127.0.0.1:8080/secure/gwt-files/com.dummy.ui.modules.desktop.DesktopApp/1145521A73291CAA9935237C83CFDB28.cache.html
lineNumber: 2262
stack: kCc([object Object],[object Object])@http://127.0.0.1:8080/secure/gwt-files/com.dummy.ui.modules.desktop.DesktopApp/1145521A73291CAA9935237C83CFDB28.c
ache.html:2262
l$([object Object],[object Object],[object Object])@http://127.0.0.1:8080/secure/gwt-files/com.dummy.ui.modules.desktop.DesktopApp/1145521A73291CAA9935237C83C
FDB28.cache.html:614
// This is a global var which holds session info.
SessionKey sessionKey
RpcProxy proxy = new RpcProxy() {
@Override
protected void load(Object loadConfig, AsyncCallback callback) {
getServices().loadMetaDatabase(sessionKey, callback); // Fails
getServices().loadMetaDatabase(callback); // Works
}
};
ListLoader loader = new BaseListLoader(proxy, new BeanModelReader());
ListStore<BeanModel> store = new ListStore<BeanModel>(loader);
loader.load();
SessionKey
public interface SessionKey extends IsSerializable {
String getKey();
}
SessionKeyImpl
public class SessionKeyImpl implements SessionKey, IsSerializable {
private String key = null;
public SessionKeyImpl() {
}
public SessionKeyImpl(String key) {
this.key = key;
}
public String getKey() {
return this.key;
}
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SessionKeyImpl that = (SessionKeyImpl) o;
if (!key.equals(that.key)) return false;
return true;
}
public int hashCode() {
return key.hashCode();
}
public String toString() {
return key;
}
}