PDA

View Full Version : ListView with error



rgpinheiro
3 Apr 2009, 2:33 PM
I'm trying make the sample from the site but I get the following error:



[ERROR] Uncaught exception escaped
com.google.gwt.core.client.JavaScriptException: (NS_ERROR_INVALID_POINTER): Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [nsIDOM3Node.compareDocumentPosition]
QueryInterface:
function QueryInterface() {
[native code]
}

result: 2147500035
initialize:
function initialize() {
[native code]
}

at com.google.gwt.dom.client.DOMImplMozilla.isOrHasChild(Native Method)
at com.google.gwt.dom.client.Element$.isOrHasChild$(Element.java:365)
at com.google.gwt.user.client.DOM.isOrHasChild(DOM.java:968)
at com.extjs.gxt.ui.client.event.DomEvent.within(DomEvent.java:301)
at com.extjs.gxt.ui.client.widget.ListView.onMouseOut(ListView.java:665)
at com.extjs.gxt.ui.client.widget.ListView.onComponentEvent(ListView.java:366)
at com.extjs.gxt.ui.client.widget.Component.onBrowserEvent(Component.java:722)
at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1320)
at com.google.gwt.user.client.DOM.dispatchEventAndCatch(DOM.java:1299)
at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1262)

The error occurs when I leave the window with mouse...

Here is the code...



import br.srv.silt.client.dominio.entity.Product;
import br.srv.silt.client.service.product.ProductServiceFront;
import br.srv.silt.client.service.product.ProductServiceFrontAsync;

import com.extjs.gxt.ui.client.Events;
import com.extjs.gxt.ui.client.data.BaseListLoader;
import com.extjs.gxt.ui.client.data.BeanModel;
import com.extjs.gxt.ui.client.data.BeanModelReader;
import com.extjs.gxt.ui.client.data.ListLoader;
import com.extjs.gxt.ui.client.data.RpcProxy;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.util.Util;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.ListView;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.rpc.AsyncCallback;

public class ListImageSample extends LayoutContainer {

public ListImageSample() {
setLayout(new FlowLayout(10));
}

@Override
protected void onRender(Element parent, int index) {
super.onRender(parent, index);

final Product product = new Product();
product.setId(1L);

final ProductServiceFrontAsync service = ProductServiceFront.Util.getInstance();

RpcProxy proxy = new RpcProxy() {
@Override
protected void load(Object loadConfig, AsyncCallback callback) {
service.getImages(product, callback);
}
};

ListLoader loader = new BaseListLoader(proxy, new BeanModelReader());
ListStore<BeanModel> store = new ListStore<BeanModel>(loader);
loader.load();

final ContentPanel panel = new ContentPanel();
panel.setCollapsible(true);
panel.setAnimCollapse(false);
panel.setFrame(true);
panel.setId("images-view");
panel.setHeading("Simple ListView (0 items selected)");
panel.setWidth(535);
panel.setAutoHeight(true);
panel.setLayout(new FitLayout());

panel.setBodyBorder(false);

ListView<BeanModel> view = new ListView<BeanModel>() {
@Override
protected BeanModel prepareData(BeanModel model) {
String s = model.get("name");
model.set("shortName", Util.ellipse(s, 15));
String id = String.valueOf(model.get("id"));
//TODO this method will call an RPC
model.set("path", "/index/FileUploadFront?id="+ id +"&type=image");
return model;
}

};

view.setTemplate(getTemplate());
view.setStore(store);
view.setSelectOnOver(false);
view.setItemSelector("div.sample-box");

view.getSelectionModel().addListener(Events.SelectionChange, new Listener<SelectionChangedEvent<BeanModel>>() {
public void handleEvent(SelectionChangedEvent<BeanModel> be) {
panel.setHeading("Simple ListView ("+ be.getSelection().size() + " items selected)");
}
});

panel.add(view);
add(panel);
}

private native String getTemplate() /*-{
return ['<tpl for=".">',
'<div class="sample-box" id="{name}" style="border: 1px solid white">',
'<div class="sample"><img src="{path}" title="{name}" width=120 height=90> </div>',
'<span class="x-editable">{shortName}</span>' +
'</div>',
'</tpl>',
'<div class="x-clear"></div>'].join("");
}-*/;
}


import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;

public class Index extends LayoutContainer implements EntryPoint {

public void onModuleLoad() {
ListImageSample listImageSample = new ListImageSample();
RootPanel.get().add(listImageSample);
}
}
I'm using Ubuntu 8.10
GWT 1.6.3 (tested in the 1.5.3 too and got the same problem)
GXT 2.0 (actual from SVN)

Please, what's going on?

Thank in advance

sven
6 Apr 2009, 2:06 PM
I am unable to reproduce this. Please post a testcase that i am able to run without any classes that i dont have.

rgpinheiro
7 Apr 2009, 6:41 AM
Sorry, but I don't have time for this...
I'ts the same from the example! I just changed the way to get the image...

By the way, I have the premium account...

sven
7 Apr 2009, 6:44 AM
I dont get any exception in the listview example using the latest revision.

rgpinheiro
7 Apr 2009, 6:49 AM
I tested on Windows and I don't get the error

rgpinheiro
13 Apr 2009, 10:14 AM
please, I need help with this!

someone has similar problem?

rgpinheiro
15 Apr 2009, 8:59 AM
@Override
protected void onMouseOut(ListViewEvent ce) {
//
}

this worked for me...
but still remains the problem using ubuntu 8.10