I can't find an example of querying a datasource based on property values in a related collection. For example, I would like to show all of the orders that have a certain product number. Another example would be to find orders whose line item quantity were greater than a certain value.
Maybe I just can't find the right search terms (apropos) in the forum, javadoc or Quick Start. In my different attempts I either get no results ("WHERE 1=2" is appended to the query), all of the records (no where clause at all is appended), or a javascript error (below).
Thanks for any hints!
Info:
1. SmartClient Version: v8.2p_2012-04-30/Enterprise Deployment (built 2012-04-30)
2. firefox 10.0.2
3. The issue is client-side, I believe.
4. N/A
5. Stacktrace:
6. sample code if applicable
Maybe I just can't find the right search terms (apropos) in the forum, javadoc or Quick Start. In my different attempts I either get no results ("WHERE 1=2" is appended to the query), all of the records (no where clause at all is appended), or a javascript error (below).
Thanks for any hints!
Info:
1. SmartClient Version: v8.2p_2012-04-30/Enterprise Deployment (built 2012-04-30)
2. firefox 10.0.2
3. The issue is client-side, I believe.
4. N/A
5. Stacktrace:
Code:
com.google.gwt.core.client.JavaScriptException: (null): null at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:248) at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:289) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107) at com.smartgwt.client.widgets.grid.ListGrid.fetchData(ListGrid.java) at com.joe.client.presenter.SandboxPresenter.prepareFromRequest(SandboxPresenter.java:86) at com.gwtplatform.mvp.client.proxy.ProxyPlaceAbstract$3$1.execute(ProxyPlaceAbstract.java:205) at com.google.gwt.core.client.impl.SchedulerImpl$Task$.executeScheduled$(SchedulerImpl.java:50) at com.google.gwt.core.client.impl.SchedulerImpl.runScheduledTasks(SchedulerImpl.java:228) at com.google.gwt.core.client.impl.SchedulerImpl.flushPostEventPumpCommands(SchedulerImpl.java:388) at com.google.gwt.core.client.impl.SchedulerImpl$Flusher.execute(SchedulerImpl.java:78) at com.google.gwt.core.client.impl.SchedulerImpl.execute(SchedulerImpl.java:138) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:611) at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172) at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337) at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218) at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91) at com.google.gwt.core.client.impl.Impl.apply(Impl.java) at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:216) at sun.reflect.GeneratedMethodAccessor63.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:611) at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172) at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363) at java.lang.Thread.run(Thread.java:736)
Code:
final DataSource orderDataSource = DataSource.get("order"); final ListGrid orderGrid = new ListGrid(); orderGrid.setDataSource(orderDataSource); final Criterion searchCriterion = new Criterion("lineItems.productNumber", OperatorId.CONTAINS); searchCriterion.setAttribute("value", new HashSet(Arrays.asList(new String [] {"1"}))); orderGrid.fetchData(searchCriterion);
Comment